mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-02 04:39:54 -05:00
Merge branch 'develop' into feature/importer_to_vue
# Conflicts: # vue/src/apps/RecipeEditView/RecipeEditView.vue # vue/src/utils/openapi/api.ts
This commit is contained in:
@@ -612,6 +612,18 @@ export class Models {
|
||||
list: {
|
||||
params: ["filter_list"],
|
||||
},
|
||||
create: {
|
||||
params: [["name",]],
|
||||
form: {
|
||||
name: {
|
||||
form_field: true,
|
||||
type: "text",
|
||||
field: "name",
|
||||
label: "Name",
|
||||
placeholder: "",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
static MEAL_PLAN = {
|
||||
|
||||
@@ -46,6 +46,7 @@ export class StandardToasts {
|
||||
static FAIL_FETCH = "FAIL_FETCH"
|
||||
static FAIL_UPDATE = "FAIL_UPDATE"
|
||||
static FAIL_DELETE = "FAIL_DELETE"
|
||||
static FAIL_DELETE_PROTECTED = "FAIL_DELETE_PROTECTED"
|
||||
static FAIL_MOVE = "FAIL_MOVE"
|
||||
static FAIL_MERGE = "FAIL_MERGE"
|
||||
|
||||
@@ -81,6 +82,9 @@ export class StandardToasts {
|
||||
case StandardToasts.FAIL_DELETE:
|
||||
makeToast(i18n.tc("Failure"), i18n.tc("err_deleting_resource") + (err_details ? "\n" + err_details : ""), "danger")
|
||||
break
|
||||
case StandardToasts.FAIL_DELETE_PROTECTED:
|
||||
makeToast(i18n.tc("Protected"), i18n.tc("err_deleting_protected_resource"), "danger")
|
||||
break
|
||||
case StandardToasts.FAIL_MOVE:
|
||||
makeToast(i18n.tc("Failure"), i18n.tc("err_moving_resource") + (err_details ? "\n" + err_details : ""), "danger")
|
||||
break
|
||||
@@ -187,6 +191,10 @@ export function calculateAmount(amount, factor) {
|
||||
let return_string = ""
|
||||
let fraction = frac(amount * factor, 10, true)
|
||||
|
||||
if (fraction[0] === 0 && fraction[1] === 0 && fraction[2] === 1) {
|
||||
return roundDecimals(amount * factor)
|
||||
}
|
||||
|
||||
if (fraction[0] > 0) {
|
||||
return_string += fraction[0]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user