Skip to content

Commit efa0364

Browse files
authoredMay 30, 2024
Merge pull request #489 from bruecksen/473-bug-separate-buttons-in-production-plan-on-small-devices
473 improve production plan on mobile screens
2 parents 48d40fa + c93488b commit efa0364

File tree

6 files changed

+83
-38
lines changed

6 files changed

+83
-38
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,59 @@
11
{% load i18n %}
2-
{% if production_plan.is_planned %}
3-
<a href="{% url "workshop:production-plan-start" pk=production_plan.pk %}{% if next_url%}?next={{ next_url }}{% endif %}" class="btn btn-warning {{ btn_css }} d-print-none">{% trans "Start" %}</a>
4-
{% elif production_plan.is_production %}
5-
<a href="{% url "workshop:production-plan-finish" pk=production_plan.pk %}{% if next_url%}?next={{ next_url }}{% endif %}" class="btn btn-success {{ btn_css }} d-print-none">{% trans "Finish" %}</a>
6-
{% endif %}
7-
{% if production_plan.is_canceled %}
8-
<a href="{% url "workshop:production-plan-update" pk=production_plan.pk %}{% if next_url%}?next={{ next_url }}{% endif %}" class="btn btn-outline-primary {{ btn_css }} d-print-none">{% trans "Reset" %}</a>
2+
<div class="d-none d-sm-block">
3+
{% if production_plan.is_planned or production_plan.is_production %}
4+
<div class="btn-group btn-group-sm">
5+
{% if production_plan.is_planned %}
6+
<a role="button" class="btn btn-warning {{ btn_css }} d-print-none" href="{% url "workshop:production-plan-start" pk=production_plan.pk %}{% if next_url%}?next={{ next_url }}{% endif %}">{% trans "Start" %}</a>
7+
<a role="button" class="btn btn-warning dropdown-toggle dropdown-toggle-split" data-bs-toggle="dropdown" aria-expanded="false">
8+
<span class="visually-hidden">Toggle Dropdown</span>
9+
</a>
10+
{% elif production_plan.is_production %}
11+
<a role="button" class="btn btn-success {{ btn_css }} d-print-none" href="{% url "workshop:production-plan-finish" pk=production_plan.pk %}{% if next_url%}?next={{ next_url }}{% endif %}">{% trans "Finish" %}</a>
12+
<a role="button" class="btn btn-success dropdown-toggle dropdown-toggle-split" data-bs-toggle="dropdown" aria-expanded="false">
13+
<span class="visually-hidden">Toggle Dropdown</span>
14+
</a>
15+
{% endif %}
16+
<ul class="dropdown-menu">
17+
{% if production_plan.is_canceled %}
18+
<li><a class="dropdown-item d-print-none" href="{% url "workshop:production-plan-update" pk=production_plan.pk %}{% if next_url%}?next={{ next_url }}{% endif %}">{% trans "Reset" %}</a></li>
19+
{% else %}
20+
<li><a class="dropdown-item d-print-none" href="{% url "workshop:production-plan-cancel" pk=production_plan.pk %}{% if next_url%}?next={{ next_url }}{% endif %}">{% trans "Cancel" %}</a></li>
21+
{% endif %}
22+
</ul>
23+
</div>
924
{% else %}
10-
<a href="{% url "workshop:production-plan-cancel" pk=production_plan.pk %}{% if next_url%}?next={{ next_url }}{% endif %}" class="btn btn-outline-primary {{ btn_css }} d-print-none">{% trans "Cancel" %}</a>
25+
<div class="dropdown">
26+
<button type="button" class="btn btn-sm btn-outline-primary dropdown-toggle-split" data-bs-toggle="dropdown" aria-expanded="false">
27+
<i class="fa-solid fa-ellipsis-vertical"></i>
28+
<span class="visually-hidden">Toggle Dropdown</span>
29+
</button>
30+
<ul class="dropdown-menu">
31+
{% if production_plan.is_canceled %}
32+
<li><a class="dropdown-item d-print-none" href="{% url "workshop:production-plan-update" pk=production_plan.pk %}{% if next_url%}?next={{ next_url }}{% endif %}">{% trans "Reset" %}</a></li>
33+
{% else %}
34+
<li><a class="dropdown-item d-print-none" href="{% url "workshop:production-plan-cancel" pk=production_plan.pk %}{% if next_url%}?next={{ next_url }}{% endif %}">{% trans "Cancel" %}</a></li>
35+
{% endif %}
36+
</ul>
37+
</div>
1138
{% endif %}
39+
</div>
40+
<div class="d-block d-sm-none">
41+
<div class="dropdown">
42+
<button type="button" class="btn btn-sm btn-outline-primary dropdown-toggle-split" data-bs-toggle="dropdown" aria-expanded="false">
43+
<i class="fa-solid fa-ellipsis-vertical"></i>
44+
<span class="visually-hidden">Toggle Dropdown</span>
45+
</button>
46+
<ul class="dropdown-menu">
47+
{% if production_plan.is_planned %}
48+
<li><a role="button" class="dropdown-item btn-warning {{ btn_css }} d-print-none" href="{% url "workshop:production-plan-start" pk=production_plan.pk %}{% if next_url%}?next={{ next_url }}{% endif %}">{% trans "Start" %}</a></li>
49+
{% elif production_plan.is_production %}
50+
<li><a role="button" class="dropdown-item btn-success {{ btn_css }} d-print-none" href="{% url "workshop:production-plan-finish" pk=production_plan.pk %}{% if next_url%}?next={{ next_url }}{% endif %}">{% trans "Finish" %}</a></li>
51+
{% endif %}
52+
{% if production_plan.is_canceled %}
53+
<li><a class="dropdown-item d-print-none" href="{% url "workshop:production-plan-update" pk=production_plan.pk %}{% if next_url%}?next={{ next_url }}{% endif %}">{% trans "Reset" %}</a></li>
54+
{% else %}
55+
<li><a class="dropdown-item d-print-none" href="{% url "workshop:production-plan-cancel" pk=production_plan.pk %}{% if next_url%}?next={{ next_url }}{% endif %}">{% trans "Cancel" %}</a></li>
56+
{% endif %}
57+
</ul>
58+
</div>
59+
</div>

‎bakeup/templates/workshop/includes/production_plan_table.html

+25-28
Original file line numberDiff line numberDiff line change
@@ -26,39 +26,36 @@
2626
<td class="align-middle" data-bs-toggle="collapse" data-bs-target="#pb-{{ production_plan.root.pk }}" width="5%">{{ production_plan.root.production_day.day_of_sale|date:'d.m.' }}</td>
2727
<td class="align-middle" data-bs-toggle="collapse" data-bs-target="#pb-{{ production_plan.root.pk }}" width="5%">{{ production_plan.root.quantity|floatformat }}x</td>
2828
<td class="accordion-toggle align-middle"><span class="text-uppercase fw-bold"><a href="{% url 'workshop:product-detail' pk=production_plan.root.product.product_template.pk %}">{{ production_plan.root.product }}</a></span> ({{ production_plan.root.quantity|multiply:production_plan.root.product.weight|floatformat:0 }} g) {% include "workshop/includes/production_plan_state.html" with state_css_class=production_plan.root.get_state_css_class label=production_plan.root.get_state_display_value %}</td>
29-
<td class="text-end">
30-
{% include "workshop/includes/production_plan_actions.html" with production_plan=production_plan.root btn_css="btn-sm" %}
31-
</td>
29+
<td class="text-end">{% include "workshop/includes/production_plan_actions.html" with production_plan=production_plan.root btn_css="btn-sm" %}</td>
3230
</tr>
3331
<tr class="tr-collapsed">
3432
<td></td>
3533
<td colspan="4">
3634
<div class="collapse d-print-block{% if expand_all %} show{% endif %}" id="pb-{{ production_plan.root.pk }}">
37-
<table class="table table-sm table-borderless">
38-
<tbody>
39-
<tr>
40-
<td width=33%">{% for child_plan in production_plan|get_item:'Hauptteig' %}
41-
{% include "workshop/includes/production_plan_ingredients.html" with plan=child_plan %}
42-
{% endfor %}
43-
</td>
44-
<td width="33%">{% for child_plan in production_plan|get_item:'Vorteig' %}
45-
{% include "workshop/includes/production_plan_ingredients.html" with plan=child_plan %}
46-
{% endfor %}
47-
</td>
48-
<td width="33%">{% for child_plan in production_plan|get_item:'Zubereitungen' %}
49-
{% include "workshop/includes/production_plan_ingredients.html" with plan=child_plan %}
50-
{% endfor %}
51-
</td>
52-
</tr>
53-
<tr>
54-
<td>
55-
{% if not production_plan.root.is_locked %}
56-
<a href="{% url 'workshop:production-plan-update' pk=production_plan.root.pk %}" class="btn btn-outline-primary btn-sm d-print-none"><i class="fas fa-sync-alt"></i> {% trans "Update plan" %}</a>
57-
{% endif %}
58-
</td>
59-
</tr>
60-
</tbody>
61-
</table>
35+
<div class="row">
36+
<div class="col-12 col-sm-6 col-lg-4">
37+
{% for child_plan in production_plan|get_item:'Hauptteig' %}
38+
{% include "workshop/includes/production_plan_ingredients.html" with plan=child_plan %}
39+
{% endfor %}
40+
</div>
41+
<div class="col-12 col-sm-6 col-lg-4">
42+
{% for child_plan in production_plan|get_item:'Vorteig' %}
43+
{% include "workshop/includes/production_plan_ingredients.html" with plan=child_plan %}
44+
{% endfor %}
45+
</div>
46+
<div class="col-12 col-sm-6 col-lg-4">
47+
{% for child_plan in production_plan|get_item:'Zubereitungen' %}
48+
{% include "workshop/includes/production_plan_ingredients.html" with plan=child_plan %}
49+
{% endfor %}
50+
</div>
51+
</div>
52+
<div class="row mb-2">
53+
<div class="col">
54+
{% if not production_plan.root.is_locked %}
55+
<a href="{% url 'workshop:production-plan-update' pk=production_plan.root.pk %}" class="btn btn-outline-primary btn-sm d-print-none"><i class="fas fa-sync-alt"></i> {% trans "Update plan" %}</a>
56+
{% endif %}
57+
</div>
58+
</div>
6259
</div>
6360
</td>
6461
</tr>

‎locale/de_DE/LC_MESSAGES/django.mo

-2 Bytes
Binary file not shown.

‎locale/de_DE/LC_MESSAGES/django.po

+1-1
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,7 @@ msgstr "Tag"
815815
#: bakeup/templates/workshop/includes/dashboard.html:33
816816
#: bakeup/templates/workshop/includes/production_plan_table.html:12
817817
msgid "Qty"
818-
msgstr "Menge"
818+
msgstr "Qty"
819819

820820
#: bakeup/templates/workshop/includes/dashboard.html:46
821821
msgid "Go to production plans"
-2 Bytes
Binary file not shown.

‎locale/de_DE@formal/LC_MESSAGES/django.po

+1-1
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ msgstr "Tag"
850850
#: bakeup/templates/workshop/includes/dashboard.html:33
851851
#: bakeup/templates/workshop/includes/production_plan_table.html:12
852852
msgid "Qty"
853-
msgstr "Menge"
853+
msgstr "Qty"
854854

855855
#: bakeup/templates/workshop/includes/dashboard.html:46
856856
msgid "Go to production plans"

0 commit comments

Comments
 (0)
Please sign in to comment.