refactor: Reanmed templates

- fix: Added browse subcommand for products
This commit is contained in:
Aerex
2019-07-07 13:58:01 -05:00
parent d479b4f621
commit 6af9bef334
21 changed files with 397 additions and 88 deletions

1
templates/debug.yml Normal file
View File

@@ -0,0 +1 @@
{{ grocy | tojson(indent=2) | safe }}

20
templates/product/add.yml Normal file
View File

@@ -0,0 +1,20 @@
# Legend:
# Location Name (id): {% for valid_value in grocy.meta.entities.locations.valid_values %}{{ valid_value.name }}({{ valid_value.id}}){% if not loop.last %}{{ ', '}}{% endif %}{% endfor %}
# Product Group (id): {% for valid_value in grocy.meta.entities.product_groups.valid_values %}{{ valid_value.name }}({{ valid_value.id}}){% if not loop.last %}{{ ', '}}{% endif %}{% endfor %}
# Quanity Units (id): {% for valid_value in grocy.meta.entities.quantity_units.valid_values %}{{ valid_value.name }}({{ valid_value.id}}){% if not loop.last %}{{ ', '}}{% endif %}{% endfor %}
name:
description: |-
barcode:
location_id:
min_stock_amount: 0
default_best_before_days: 0
product_group_id:
qu_id_purchase:
qu_id_stock:
default_best_before_days_after_open: 0
qu_factor_purchase_to_stock: 0
allow_partial_units_in_stock: False
enable_tare_weight_handling: False
tare_weight: 0
not_check_stock_fulfillment_for_recipes: False

View File

18
templates/recipe/edit.yml Normal file
View File

@@ -0,0 +1,18 @@
name: {{ grocy.fields.name }}
description: |
{{ grocy.fields.description }}
base_servings: {{ grocy.fields.base_servings | default("1") }}
desired_servings: {{ grocy.fields.desired_servings | default("1") }}
not_check_shoppinglist: {{ grocy.fields.not_check_shoppinglist | default("1") }}
products: {% for ingredient in grocy.fields.ingredientsp%}
- id: {{ ingredient.id }}
name: {{ ingredient.name }}
description: {{ ingredient.description | default(null) }}
note: {{ ingredient.note }}
amount: {{ ingredient.amount }}
qu_id: {{ ingredient.qu_id }}
only_check_single_unit_in_stock: {{ ingredient.only_check_single_unit_in_stock }}
ingredient_group: {{ ingredient.ingredient_group | default(null) }}
not_check_stock_fulfillment: {{ ingredient.not_check_stock_fulfillment }}{% endfor %}

20
templates/recipe/view.yml Normal file
View File

@@ -0,0 +1,20 @@
name: {{ grocy.fields.name }}
servings: {{ grocy.fields.base_servings }}
costs: {{ grocy.fields.fulfillment.costs }}
ingredients: {% for ingredient in grocy.fields.ingredients %}
- product_id: {{ ingredient.id }}
name: {{ ingredient.name}}
description: {{ ingredient.description | default(null) }}
note: {{ ingredient.note }}
amount: {{ ingredient.amount }}
qu_id: {{ ingredient.qu_id }}
only_check_single_unit_in_stock: {{ ingredient.only_check_single_unit_in_stock }}
ingredient_group: {{ ingredient.ingredient_group | default(null) }}
not_check_stock_fulfillment: {{ ingredient.not_check_stock_fulfillment }}{% endfor %}
description: |-
{{ grocy.fields.description }}

View File

@@ -1,24 +0,0 @@
name: {{ name }}
description: |
{{ description }}
picture_file_name: {% if picture_file_name is not none %}
{{picture_file_name}}
{% else %}
{% endif %}
base_servings: {{ base_servings | default("1") }}
desired_servings: {{ desired_servings | default("1") }}
not_check_shoppinglist: {{ not_check_shoppinglist | default("1") }}
products: {% for product in products %}
- id: {{ product.id }}
name: {{ product.name }}
description: {{ product.description | default(null) }}
note: {{ recipes_pos[loop.index0].note }}
amount: {{ recipes_pos[loop.index0].amount }}
qu_id: {{ recipes_pos[loop.index0].qu_id }}
only_check_single_unit_in_stock: {{ recipes_pos[loop.index0].only_check_single_unit_in_stock }}
ingredient_group: {{ recipes_pos[loop.index0].ingredient_group | default(null) }}
not_check_stock_fulfillment: {{ recipes_pos[loop.index0].not_check_stock_fulfillment }}{% endfor %}