[EcoAccount] See recorded state of withdraw #6

* adds prefiltering of withdraws --> excludes withdraws of as deleted flagged interventions
* renders intervention-recorded icon into eco account withdraws details view
* fixes bug in case of document deleting which does not contain any files
* renames RecordForm into RecordModalForm for more clarity
This commit is contained in:
mipel
2021-08-26 15:45:24 +02:00
parent 6655ed1f57
commit 8f641daee4
8 changed files with 46 additions and 15 deletions

View File

@@ -4,7 +4,7 @@
<div class="row">
<div class="col-sm-6">
<h5>
<span class="badge badge-light">{{obj.withdraws.count}}</span>
<span class="badge badge-light">{{withdraws.count}}</span>
{% trans 'Eco Account Withdraws' %}
</h5>
</div>
@@ -27,6 +27,9 @@
<th scope="col">
{% trans 'Intervention Identifier' %}
</th>
<th scope="col">
{% trans 'Recorded' %}
</th>
<th scope="col">
{% trans 'Amount' %}
</th>
@@ -39,16 +42,20 @@
</tr>
</thead>
<tbody>
{% for withdraw in obj.withdraws.all %}
<tr {% if withdraw.account.deleted %}class="align-middle alert-danger" title="{% trans 'Eco-account deleted! Withdraw invalid!' %}" {% elif not withdraw.account.recorded %}class="align-middle alert-danger" title="{% trans 'Eco-account not recorded! Withdraw invalid!' %}" {% endif %}>
{% for withdraw in withdraws %}
<tr>
<td class="align-middle">
<a href="{% url 'intervention:open' withdraw.intervention.id %}">
{% if withdraw.account.deleted or not withdraw.account.recorded %}
{% fa5_icon 'exclamation-triangle' %}
{% endif %}
{{ withdraw.intervention.identifier }}
</a>
</td>
<td class="align-middle">
{% if withdraw.intervention.recorded %}
<em title='{{ withdraw.intervention.recorded_tooltip }}' class='fas fa-bookmark registered-bookmark'></em>
{% else %}
<em title='{{ withdraw.intervention.recorded_tooltip }}' class='far fa-bookmark'></em>
{% endif %}
</td>
<td class="align-middle">{{ withdraw.surface|floatformat:2|intcomma }} m²</td>
<td class="align-middle">{{ withdraw.created.timestamp|default_if_none:""|naturalday}}</td>
<td>