Intervention template adjustments

* renames intervention variable to obj to match other template style
* renames open routes to detail routes
This commit is contained in:
2021-10-13 09:26:46 +02:00
parent 337d7b39e7
commit efe26ae6f5
24 changed files with 87 additions and 87 deletions
@@ -1,6 +1,6 @@
{% load i18n fontawesome_5 %}
{% if intervention.comment %}
{% if obj.comment %}
<div class="w-100">
<div class="card mt-3">
<div class="card-header rlp-gd">
@@ -15,7 +15,7 @@
</div>
<div class="card-body">
<div class="card-text font-italic">
{{intervention.comment}}
{{obj.comment}}
</div>
</div>
</div>
@@ -11,7 +11,7 @@
<div class="col-sm-6">
<div class="d-flex justify-content-end">
{% if is_default_member and has_access %}
<a href="{% url 'compensation:new' intervention.id %}" title="{% trans 'Add new compensation' %}">
<a href="{% url 'compensation:new' obj.id %}" title="{% trans 'Add new compensation' %}">
<button class="btn btn-outline-default">
{% fa5_icon 'plus' %}
{% fa5_icon 'leaf' %}
@@ -41,7 +41,7 @@
{% for comp in compensations %}
<tr>
<td class="align-middle">
<a href="{% url 'compensation:open' comp.id %}">
<a href="{% url 'compensation:detail' comp.id %}">
{{ comp.identifier }}
</a>
</td>
@@ -12,35 +12,35 @@
</button>
</a>
{% if has_access %}
<button class="btn btn-default btn-modal mr-2" title="{% trans 'Share' %}" data-form-url="{% url 'intervention:share-create' intervention.id %}">
<button class="btn btn-default btn-modal mr-2" title="{% trans 'Share' %}" data-form-url="{% url 'intervention:share-create' obj.id %}">
{% fa5_icon 'share-alt' %}
</button>
{% if is_zb_member %}
<button class="btn btn-default btn-modal mr-2" title="{% trans 'Run check' %}" data-form-url="{% url 'intervention:run-check' intervention.id %}">
<button class="btn btn-default btn-modal mr-2" title="{% trans 'Run check' %}" data-form-url="{% url 'intervention:run-check' obj.id %}">
{% fa5_icon 'star' %}
</button>
{% endif %}
{% if is_ets_member %}
{% if intervention.recorded %}
<button class="btn btn-default btn-modal mr-2" title="{% trans 'Unrecord' %}" data-form-url="{% url 'intervention:record' intervention.id %}">
{% if obj.recorded %}
<button class="btn btn-default btn-modal mr-2" title="{% trans 'Unrecord' %}" data-form-url="{% url 'intervention:record' obj.id %}">
{% fa5_icon 'bookmark' 'far' %}
</button>
{% else %}
<button class="btn btn-default btn-modal mr-2" title="{% trans 'Record' %}" data-form-url="{% url 'intervention:record' intervention.id %}">
<button class="btn btn-default btn-modal mr-2" title="{% trans 'Record' %}" data-form-url="{% url 'intervention:record' obj.id %}">
{% fa5_icon 'bookmark' %}
</button>
{% endif %}
{% endif %}
{% if is_default_member %}
<a href="{% url 'intervention:edit' intervention.id %}" class="mr-2">
<a href="{% url 'intervention:edit' obj.id %}" class="mr-2">
<button class="btn btn-default" title="{% trans 'Edit' %}">
{% fa5_icon 'edit' %}
</button>
</a>
<button class="btn btn-default btn-modal mr-2" data-form-url="{% url 'intervention:log' intervention.id %}" title="{% trans 'Show log' %}">
<button class="btn btn-default btn-modal mr-2" data-form-url="{% url 'intervention:log' obj.id %}" title="{% trans 'Show log' %}">
{% fa5_icon 'history' %}
</button>
<button class="btn btn-default btn-modal" data-form-url="{% url 'intervention:remove' intervention.id %}" title="{% trans 'Delete' %}">
<button class="btn btn-default btn-modal" data-form-url="{% url 'intervention:remove' obj.id %}" title="{% trans 'Delete' %}">
{% fa5_icon 'trash' %}
</button>
{% endif %}
@@ -4,14 +4,14 @@
<div class="row">
<div class="col-sm-6">
<h5>
<span class="badge badge-light">{{intervention.deductions.count}}</span>
<span class="badge badge-light">{{obj.deductions.count}}</span>
{% trans 'Eco Account Deductions' %}
</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-deduction' intervention.id %}" title="{% trans 'Add new deduction' %}">
<button class="btn btn-outline-default btn-modal" data-form-url="{% url 'intervention:acc-new-deduction' obj.id %}" title="{% trans 'Add new deduction' %}">
{% fa5_icon 'plus' %}
{% fa5_icon 'tree' %}
</button>
@@ -39,10 +39,10 @@
</tr>
</thead>
<tbody>
{% for deduction in intervention.deductions.all %}
{% for deduction in obj.deductions.all %}
<tr {% if deduction.account.deleted %}class="align-middle alert-danger" title="{% trans 'Eco-account deleted! Deduction invalid!' %}" {% elif not deduction.account.recorded %}class="align-middle alert-danger" title="{% trans 'Eco-account not recorded! Deduction invalid!' %}" {% endif %}>
<td class="align-middle">
<a href="{% url 'compensation:acc-open' deduction.account.id %}">
<a href="{% url 'compensation:acc-detail' deduction.account.id %}">
{% if deduction.account.deleted or not deduction.account.recorded %}
{% fa5_icon 'exclamation-triangle' %}
{% endif %}
@@ -4,14 +4,14 @@
<div class="row">
<div class="col-sm-6">
<h5>
<span class="badge badge-light">{{intervention.documents.count}}</span>
<span class="badge badge-light">{{obj.documents.count}}</span>
{% trans 'Documents' %}
</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:new-doc' intervention.id %}" title="{% trans 'Add new document' %}">
<button class="btn btn-outline-default btn-modal" data-form-url="{% url 'intervention:new-doc' obj.id %}" title="{% trans 'Add new document' %}">
{% fa5_icon 'plus' %}
{% fa5_icon 'file' %}
</button>
@@ -36,7 +36,7 @@
</tr>
</thead>
<tbody>
{% for doc in intervention.documents.all %}
{% for doc in obj.documents.all %}
<tr>
<td class="align-middle">
<a href="{% url 'intervention:get-doc' doc.id %}">
@@ -4,14 +4,14 @@
<div class="row">
<div class="col-sm-6">
<h5>
<span class="badge badge-light">{{intervention.payments.count}}</span>
<span class="badge badge-light">{{obj.payments.count}}</span>
{% trans 'Payments' %}
</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 'compensation:pay-new' intervention.id %}" title="{% trans 'Add new payment' %}">
<button class="btn btn-outline-default btn-modal" data-form-url="{% url 'compensation:pay-new' obj.id %}" title="{% trans 'Add new payment' %}">
{% fa5_icon 'plus' %}
{% fa5_icon 'money-bill-wave' %}
</button>
@@ -39,7 +39,7 @@
</tr>
</thead>
<tbody>
{% for pay in intervention.payments.all %}
{% for pay in obj.payments.all %}
<tr>
<td class="align-middle">
{{ pay.amount|floatformat:2 }} €
@@ -4,7 +4,7 @@
<div class="row">
<div class="col-sm-6">
<h5>
<span class="badge badge-light">{% if intervention.legal.revocation %}1{% else %}0{% endif %}</span>
<span class="badge badge-light">{% if obj.legal.revocation %}1{% else %}0{% endif %}</span>
{% trans 'Revocation' %}
</h5>
</div>
@@ -13,8 +13,8 @@
{% comment %}
Only show add-button if no revocation exists, yet.
{% endcomment %}
{% if is_default_member and has_access and not intervention.legal.revocation %}
<button class="btn btn-outline-default btn-modal" data-form-url="{% url 'intervention:new-revocation' intervention.id %}" title="{% trans 'Add revocation' %}">
{% if is_default_member and has_access and not obj.legal.revocation %}
<button class="btn btn-outline-default btn-modal" data-form-url="{% url 'intervention:new-revocation' obj.id %}" title="{% trans 'Add revocation' %}">
{% fa5_icon 'plus' %}
{% fa5_icon 'ban' %}
</button>
@@ -42,8 +42,8 @@
</tr>
</thead>
<tbody>
{% if intervention.legal.revocation %}
{% with intervention.legal.revocation as rev %}
{% if obj.legal.revocation %}
{% with obj.legal.revocation as rev %}
<tr>
<td class="align-middle">
{{ rev.date }}