1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-11-27 02:43:01 +00:00

Compare commits

..

No commits in common. "b2b1f03b46335cde4e2773c285d466c4b9395a80" and "a7e87ea639b7bb398409c984376b4b5d1cd7e00f" have entirely different histories.

9 changed files with 473 additions and 1850 deletions

View File

@ -1,62 +0,0 @@
from django.db import migrations
def create_14_mandatory_allergens(apps, schema_editor):
"""
There are 14 mandatory allergens, they are pre-injected
"""
Allergen = apps.get_model("food", "allergen")
Allergen.objects.get_or_create(
name="Gluten",
)
Allergen.objects.get_or_create(
name="Fruits à coques",
)
Allergen.objects.get_or_create(
name="Crustacés",
)
Allergen.objects.get_or_create(
name="Céléri",
)
Allergen.objects.get_or_create(
name="Oeufs",
)
Allergen.objects.get_or_create(
name="Moutarde",
)
Allergen.objects.get_or_create(
name="Poissons",
)
Allergen.objects.get_or_create(
name="Soja",
)
Allergen.objects.get_or_create(
name="Lait",
)
Allergen.objects.get_or_create(
name="Sulfites",
)
Allergen.objects.get_or_create(
name="Sésame",
)
Allergen.objects.get_or_create(
name="Lupin",
)
Allergen.objects.get_or_create(
name="Arachides",
)
Allergen.objects.get_or_create(
name="Mollusques",
)
class Migration(migrations.Migration):
dependencies = [
('food', '0002_transformedfood_shelf_life'),
]
operations = [
migrations.RunPython(create_14_mandatory_allergens),
]

View File

@ -11,17 +11,17 @@ SPDX-License-Identifier: GPL-3.0-or-later
{{ title }} {{ title }}
</h3> </h3>
<div class="card-body"> <div class="card-body">
<p>{% trans 'Name' %} : {{ food.name }}</p> <p>name : {{ food.name }}</p>
<p>{% trans 'Owner' %} : {{ food.owner }}</p> <p>owner : {{ food.owner }}</p>
<p>{% trans 'Arrival date' %} : {{ food.arrival_date }}</p> <p>arrival_date : {{ food.arrival_date }}</p>
<p>{% trans 'Expiry date' %} : {{ food.expiry_date }}</p> <p>expiry_date : {{ food.expiry_date }}</p>
<p>{% trans 'Allergens' %} :</p> <p>allergens :</p>
<ul> <ul>
{% for allergen in food.allergens.iterator %} {% for allergen in food.allergens.iterator %}
<li>{{ allergen.name }}</li> <li>{{ allergen.name }}</li>
{% endfor %} {% endfor %}
</ul> </ul>
<a href="{% url "food:basic_update" pk=food.pk %}">{% trans 'Update' %}</a> <a href="{% url "food:basic_update" pk=food.pk %}">Update</a>
</div> </div>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -11,14 +11,14 @@ SPDX-License-Identifier: GPL-3.0-or-later
{{ title }} {{ title }}
</h3> </h3>
<div class="card-body"> <div class="card-body">
<p>{% trans 'QR-code' %} : {{ qrcode.qr_code_number }}</p> <p>qrcode : {{ qrcode.qr_code_number }}</p>
<p>{% trans 'Name' %} : {{ qrcode.food_container.name }}</p> <p>name : {{ qrcode.food_container.name }}</p>
{% if qrcode.food_container.polymorphic_ctype.name == 'Basic food' %} {% if qrcode.food_container.polymorphic_ctype.name == 'Basic food' %}
<a href="{% url "food:basic_update" pk=qrcode.food_container.pk %}">{% trans 'Update' %}</a> <a href="{% url "food:basic_update" pk=qrcode.food_container.pk %}">Update</a>
{% else %} {% else %}
<a href="{% url "food:transformed_update" pk=qrcode.food_container.pk %}">{% trans 'Update' %}</a> <a href="{% url "food:transformed_update" pk=qrcode.food_container.pk %}">Update</a>
{% endif %} {% endif %}
<a href="{% url "food:add_ingredient" pk=qrcode.food_container.pk %}">{% trans 'Add the ingredient' %}</a> <a href="{% url "food:add_ingredient" pk=qrcode.food_container.pk %}">Add the ingrdient</a>
</div> </div>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -11,23 +11,23 @@ SPDX-License-Identifier: GPL-3.0-or-later
{{ title }} {{ title }}
</h3> </h3>
<div class="card-body"> <div class="card-body">
<p>{% trans 'Name' %} : {{ food.name }}</p> <p>name : {{ food.name }}</p>
<p>{% trans 'Owner' %} : {{ food.owner }}</p> <p>owner : {{ food.owner }}</p>
<p>{% trans 'Creation date' %} : {{ food.creation_date }}</p> <p>creation_date : {{ food.creation_date }}</p>
<p>{% trans 'Expiry date' %} : {{ food.expiry_date }}</p> <p>expiry_date : {{ food.expiry_date }}</p>
<p>{% trans 'Allergens' %} :</p> <p>allergens :</p>
<ul> <ul>
{% for allergen in food.allergens.iterator %} {% for allergen in food.allergens.iterator %}
<li>{{ allergen.name }}</li> <li>{{ allergen.name }}</li>
{% endfor %} {% endfor %}
</ul> </ul>
<p>{% trans 'Ingredients' %} :</p> <p>ingredients :</p>
<ul> <ul>
{% for ingredient in food.ingredient.iterator %} {% for ingredient in food.ingredient.iterator %}
<li><a href="{% url "food:food_view" pk=ingredient.pk %}">{{ ingredient.name }}</a></li> <li><a href="{% url "food:food_view" pk=ingredient.pk %}">{{ ingredient.name }}</a></li>
{% endfor %} {% endfor %}
</ul> </ul>
<a href="{% url "food:transformed_update" pk=food.pk %}">{% trans 'Update' %}</a> <a href="{% url "food:transformed_update" pk=food.pk %}">Update</a>
</div> </div>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -9,15 +9,15 @@ SPDX-License-Identifier: GPL-3.0-or-later
<div class="card bg-light mb-3"> <div class="card bg-light mb-3">
<div class="card-footer"> <div class="card-footer">
<a class="btn btn-sm btn-success" href="{% url 'food:transformed_create' %}" data-turbolinks="false"> <a class="btn btn-sm btn-success" href="{% url 'food:transformed_create' %}" data-turbolinks="false">
{% trans 'New meal' %} New transformed food
</a> </a>
</div> </div>
<h3 class="card-header text-center"> <h3 class="card-header text-center">
{% trans 'In preparation' %} In preparation
</h3> </h3>
{% render_table table %} {% render_table table %}
<h3 class="card-header text-center"> <h3 class="card-header text-center">
{% trans 'Free' %} Open
</h3> </h3>
{% render_table open_table %} {% render_table open_table %}
</div> </div>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -66,12 +66,10 @@ SPDX-License-Identifier: GPL-3.0-or-later
<a class="nav-link {% if request.path_info == url %}active{% endif %}" href="{{ url }}"><i class="fa fa-coffee"></i> {% trans 'Consumptions' %}</a> <a class="nav-link {% if request.path_info == url %}active{% endif %}" href="{{ url }}"><i class="fa fa-coffee"></i> {% trans 'Consumptions' %}</a>
</li> </li>
{% endif %} {% endif %}
{% if request.user.is_authenticated %}
<li class="nav-item"> <li class="nav-item">
{% url 'food:food_list' as url %} {% url 'food:food_list' as url %}
<a class="nav-link {% if request.path_info == url %}active{% endif %}" href="{{ url }}"><i class="fa fa-cutlery"></i>_{% trans 'Food' %}</a> <a data-turbolinks="false" class="nav-link" href="{{ url }}">Food</a>
</li> </li>
{% endif %}
{% if user.is_authenticated and user|is_member:"Kfet" %} {% if user.is_authenticated and user|is_member:"Kfet" %}
<li class="nav-item"> <li class="nav-item">
{% url 'note:transfer' as url %} {% url 'note:transfer' as url %}