added ability to order property types
This commit is contained in:
@ -131,6 +131,7 @@ export default {
|
||||
'property_amount_total': rp.property_amount * this.recipe.servings * (this.servings / this.recipe.servings),
|
||||
'missing_value': false,
|
||||
'unit': rp.property_type.unit,
|
||||
'type': rp.property_type,
|
||||
}
|
||||
)
|
||||
})
|
||||
@ -147,11 +148,23 @@ export default {
|
||||
'property_amount_total': fp.total_value * (this.servings / this.recipe.servings),
|
||||
'missing_value': fp.missing_value,
|
||||
'unit': fp.unit,
|
||||
'type': fp,
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
return pt_list
|
||||
|
||||
function compare(a,b){
|
||||
if(a.type.order > b.type.order){
|
||||
return 1
|
||||
}
|
||||
if(a.type.order < b.type.order){
|
||||
return -1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
return pt_list.sort(compare)
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
@ -319,6 +319,7 @@
|
||||
"CategoryName": "Category Name",
|
||||
"SupermarketName": "Supermarket Name",
|
||||
"CategoryInstruction": "Drag categories to change the order categories appear in shopping list.",
|
||||
"OrderInformation": "Objects are ordered from small to large numbers.",
|
||||
"shopping_recent_days_desc": "Days of recent shopping list entries to display.",
|
||||
"shopping_recent_days": "Recent Days",
|
||||
"download_pdf": "Download PDF",
|
||||
|
@ -281,7 +281,7 @@ export class Models {
|
||||
apiName: "Unit",
|
||||
paginated: true,
|
||||
create: {
|
||||
params: [["name", "plural_name", "description", "base_unit","open_data_slug",]],
|
||||
params: [["name", "plural_name", "description", "base_unit", "open_data_slug",]],
|
||||
form: {
|
||||
show_help: true,
|
||||
name: {
|
||||
@ -711,7 +711,7 @@ export class Models {
|
||||
},
|
||||
},
|
||||
create: {
|
||||
params: [['name', 'icon', 'unit', 'description']],
|
||||
params: [['name', 'icon', 'unit', 'description','order']],
|
||||
form: {
|
||||
show_help: true,
|
||||
name: {
|
||||
@ -745,6 +745,15 @@ export class Models {
|
||||
placeholder: "",
|
||||
optional: true,
|
||||
},
|
||||
order: {
|
||||
form_field: true,
|
||||
type: "number",
|
||||
field: "order",
|
||||
label: "Order",
|
||||
placeholder: "",
|
||||
optional: true,
|
||||
helpt_text: "OrderInformation",
|
||||
},
|
||||
open_data_slug: {
|
||||
form_field: true,
|
||||
type: "text",
|
||||
|
Reference in New Issue
Block a user