Fix bugs in html templates

This commit is contained in:
Edgar P. Burkhart 2023-12-30 11:12:38 +01:00
parent 47d8ff0382
commit fe95222474
Signed by: edpibu
GPG Key ID: 9833D3C5A25BD227
7 changed files with 36 additions and 29 deletions

View File

@ -34,7 +34,9 @@
</td>
<td class="value">{{ cat.sum_m|pmrvalue }}</td>
<td class="bar m">
<div style="width: {% widthratio cat.sum_m max -100 %}%"></div>
{% if cat.sum_m %}
<div style="width: {% widthratio cat.sum_m max -100 %}%"></div>
{% endif %}
{% if cat.sum < 0 %}
<div class="tot" style="width:{% widthratio cat.sum max -100 %}%">
<span>{{ cat.sum|pmrvalue }}</span>
@ -42,7 +44,9 @@
{% endif %}
</td>
<td class="bar p">
<div style="width: {% widthratio cat.sum_p max 100 %}%"></div>
{% if cat.sum_p %}
<div style="width: {% widthratio cat.sum_p max 100 %}%"></div>
{% endif %}
{% if cat.sum > 0 %}
<div class="tot" style="width:{% widthratio cat.sum max 100 %}%">
<span>{{ cat.sum|pmrvalue }}</span>

View File

@ -30,7 +30,7 @@
{% block pre %}{% endblock %}
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
{% if instance|adding %}<input hidden name="next" value="{{ request.path }}" />{% endif %}
{% if instance|adding %}<input hidden name="next" value="{{ request.path }}">{% endif %}
{{ form }}
</form>
{% block tables %}{% endblock %}

View File

@ -29,11 +29,11 @@
{% if not form.instance|adding %}
<a class="del" href="{{ form.instance.get_delete_url }}">{% translate "Delete" %}</a>
{% endif %}
<input type="reset" value="{% translate "Reset" %}" />
<input type="reset" value="{% translate "Reset" %}">
{% if form.instance|adding %}
<input type="submit" value="{% translate "Create" %}" />
<input type="submit" value="{% translate "Create" %}">
{% else %}
<input type="submit" value="{% translate "Save" %}" />
<input type="submit" value="{% translate "Save" %}">
{% endif %}
{% endblock %}
</td>

View File

@ -1,7 +1,7 @@
{% extends "main/form/form_base.html" %}
{% load i18n %}
{% block buttons %}
<input hidden value="{{ next }}" name="next" />
<input type="reset" />
<input type="submit" value="{% translate "Log in" %}" />
<input hidden value="{{ next }}" name="next">
<input type="reset">
<input type="submit" value="{% translate "Log in" %}">
{% endblock %}

View File

@ -1,4 +1,5 @@
{% extends "main/base.html" %}
{% load main_extras %}
{% load static %}
{% load i18n %}
{% block link %}

View File

@ -6,9 +6,11 @@
<col class="desc" span="3">
</colgroup>
<thead>
<th>{% translate "Name" %}</th>
<th>{% translate "File" %}</th>
<th>{% translate "Delete" %}</th>
<tr>
<th>{% translate "Name" %}</th>
<th>{% translate "File" %}</th>
<th>{% translate "Delete" %}</th>
</tr>
</thead>
<tbody>
{% for invoice in transaction.invoices %}
@ -20,21 +22,21 @@
<a href="{{ invoice.file.url }}">{% translate "File" %} [{{ invoice.file|extension }}]</a>
</td>
<td>
<a href="{{ invoice.get_delete_url }}">{% translate "Delete" %}
</td>
</tr>
{% empty %}
<tr>
<td class="empty" colspan="3">{% translate "No invoice" %}</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<td colspan="3">
<a href="{% url "new_invoice" transaction.pk %}">{% translate "Create invoice" %}</a>
<a href="{{ invoice.get_delete_url }}">{% translate "Delete" %}</a>
</td>
</tr>
</tfoot>
</table>
</div>
{% empty %}
<tr>
<td class="empty" colspan="3">{% translate "No invoice" %}</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<td colspan="3">
<a href="{% url "new_invoice" transaction.pk %}">{% translate "Create invoice" %}</a>
</td>
</tr>
</tfoot>
</table>
</div>

View File

@ -1,5 +1,5 @@
{% extends "transaction/transaction_list.html" %}
{% load i18n static category %}
{% load i18n main_extras static category %}
{% block link %}
{{ block.super }}
{% css "main/css/plot.css" %}