* adds record control button * adds html markup for invalid withdraws (unrecorded account) * adds constraint to is_valid() method of NewWithdrawForm for checking whether the selected account for a withdraw is recorded or not * adds/updates translations
66 lines
2.9 KiB
HTML
66 lines
2.9 KiB
HTML
{% load i18n l10n fontawesome_5 humanize %}
|
|
<div id="eco-account-withdraws" class="card">
|
|
<div class="card-header rlp-r">
|
|
<div class="row">
|
|
<div class="col-sm-6">
|
|
<h5>
|
|
<span class="badge badge-light">{{intervention.withdraws.count}}</span>
|
|
{% trans 'Eco Account Withdraws' %}
|
|
</h5>
|
|
</div>
|
|
<div class="col-sm-6">
|
|
<div class="d-flex justify-content-end">
|
|
{% if is_default_member and has_access %}
|
|
<button class="btn btn-outline-default btn-modal" data-form-url="{% url 'intervention:acc-new-withdraw' intervention.id %}" title="{% trans 'Add new withdraw' %}">
|
|
{% fa5_icon 'plus' %}
|
|
{% fa5_icon 'tree' %}
|
|
</button>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="card-body scroll-300">
|
|
<table class="table table-hover">
|
|
<thead>
|
|
<tr>
|
|
<th scope="col">
|
|
{% trans 'Account Identifier' %}
|
|
</th>
|
|
<th scope="col">
|
|
{% trans 'Amount' %}
|
|
</th>
|
|
<th scope="col">
|
|
{% trans 'Created' %}
|
|
</th>
|
|
<th scope="col">
|
|
{% trans 'Action' %}
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for withdraw in intervention.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 %}>
|
|
<td class="align-middle">
|
|
<a href="{% url 'compensation:acc-open' withdraw.account.id %}">
|
|
{% if withdraw.account.deleted or not withdraw.account.recorded %}
|
|
{% fa5_icon 'exclamation-triangle' %}
|
|
{% endif %}
|
|
{{ withdraw.account.identifier }}
|
|
</a>
|
|
</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>
|
|
{% if is_default_member and has_access %}
|
|
<button data-form-url="{% url 'compensation:withdraw-remove' withdraw.account.id withdraw.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove Withdraw' %}">
|
|
{% fa5_icon 'trash' %}
|
|
</button>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div> |