1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-21 18:08:21 +02:00

Improve/modify form, view, template. Add permissions

This commit is contained in:
quark
2024-08-17 02:28:27 +02:00
parent 6d7076b03e
commit debeb33d46
11 changed files with 605 additions and 132 deletions

View File

@ -7,14 +7,14 @@ SPDX-License-Identifier: GPL-3.0-or-later
{% block content %}
<div class="card bg-white mb-3">
<h3 class="card-header text-center">
HTML finished <br>
{{ title }}
{{ title }} {% trans 'number' %} {{ qrcode.qr_code_number }}
</h3>
<div class="card-body">
<p>{% trans 'QR-code number' %} : {{ qrcode.qr_code_number }}</p>
<p>{% trans 'Name' %} : {{ qrcode.food_container.name }}</p>
<p>{% trans 'Owner' %} : {{ qrcode.food_container.owner }}</p>
<p>{% trans 'Expiry date' %} : {{ qrcode.food_container.expiry_date }}</p>
<ul>
<li><p>{% trans 'Name' %} : {{ qrcode.food_container.name }}</p></li>
<li><p>{% trans 'Owner' %} : {{ qrcode.food_container.owner }}</p></li>
<li><p>{% trans 'Expiry date' %} : {{ qrcode.food_container.expiry_date }}</p></li>
</ul>
{% if qrcode.food_container.polymorphic_ctype.model == 'basicfood' and can_update_basic %}
<a class="btn btn-sm btn-warning" href="{% url "food:basic_update" pk=qrcode.food_container.pk %}" data-turbolinks="false">
{% trans 'Update' %}
@ -24,9 +24,14 @@ SPDX-License-Identifier: GPL-3.0-or-later
{% trans 'Update' %}
</a>
{% endif %}
{% if can_view_detail %}
<a class="btn btn-sm btn-primary" href="{% url "food:food_view" pk=qrcode.food_container.pk %}">
{% trans 'View details' %}
</a>
{% endif %}
{% if can_add_ingredient %}
<a class="btn btn-sm btn-success" href="{% url "food:add_ingredient" pk=qrcode.food_container.pk %}">
{% trans 'Add the ingredient' %}
{% trans 'Add to a meal' %}
</a>
{% endif %}
</div>