Intervention Detail View

* adds related object overview in detail view
* adds comment field to payment model for 'Verwendungszweck'
* simplifies intervention urls
* adds translations
This commit is contained in:
mipel
2021-07-22 14:58:58 +02:00
parent 5e48bac013
commit ff11051fbb
6 changed files with 186 additions and 29 deletions

View File

@@ -13,7 +13,17 @@
LANIS
</button>
</a>
<a href="{% url 'home' %}" class="mr-2">
<button class="btn btn-default" title="{% trans 'Public report' %}">
{% fa5_icon 'file-alt' %}
</button>
</a>
{% if has_access %}
<a href="{% url 'home' %}" class="mr-2">
<button class="btn btn-default" title="{% trans 'Share' %}">
{% fa5_icon 'share-alt' %}
</button>
</a>
<a href="{% url 'home' %}" class="mr-2">
<button class="btn btn-default" title="{% trans 'Run check' %}">
{% fa5_icon 'star' %}
@@ -116,6 +126,107 @@
{{geom_form.geom}}
</div>
</div>
<div id="related-objects" class="row"></div>
<hr>
<div id="related-objects" class="row mb-5">
<div class="col-sm-12 col-md-12 col-lg-6">
<div id="related-compensations" class="card">
<div class="card-header rlp-r">
<div class="row">
<div class="col-sm-6">
<h5>
<span class="badge badge-light">{{intervention.compensations.count}}</span>
{% trans 'Compensations' %}
</h5>
</div>
<div class="col-sm-6">
<div class="d-flex justify-content-end">
<a href="{% url 'compensation:new' %}" title="{% trans 'Add new compensation' %}">
<button class="btn btn-outline-default">
{% fa5_icon 'plus' %}
{% fa5_icon 'leaf' %}
</button>
</a>
</div>
</div>
</div>
</div>
<div class="card-body">
<table class="table table-hover">
<thead>
<tr>
<th scope="col">
{% trans 'Identifier' %}
</th>
<th scope="col">
{% trans 'Title' %}
</th>
</tr>
</thead>
<tbody>
{% for comp in intervention.compensations.all %}
<tr>
<td>
<a href="{% url 'compensation:open' comp.id %}">
{{ comp.identifier }}
</a>
</td>
<td>{{ comp.title }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
<div class="col-sm-12 col-md-12 col-lg-6">
<div id="related-payments" class="card">
<div class="card-header rlp-r">
<div class="row">
<div class="col-sm-6">
<h5>
<span class="badge badge-light">{{intervention.payments.count}}</span>
{% trans 'Payments' %}
</h5>
</div>
<div class="col-sm-6">
<div class="d-flex justify-content-end">
<a href="{% url 'compensation:new' %}" title="{% trans 'Add new payment' %}">
<button class="btn btn-outline-default">
{% fa5_icon 'plus' %}
{% fa5_icon 'money-bill-wave' %}
</button>
</a>
</div>
</div>
</div>
</div>
<div class="card-body">
<table class="table table-hover">
<thead>
<tr>
<th scope="col">
{% trans 'Amount' %}
</th>
<th scope="col">
{% trans 'Transfer comment' %}
</th>
</tr>
</thead>
<tbody>
{% for pay in intervention.payments.all %}
<a href="{% url 'payment:open' pay.id %}">
<tr>
<td>{{ pay.amount }}</td>
<td>{{ pay.comment }}</td>
</tr>
</a>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
{% endblock %}

View File

@@ -13,7 +13,7 @@ app_name = "intervention"
urlpatterns = [
path("", index_view, name="index"),
path('new/', new_view, name='new'),
path('open/<id>', open_view, name='open'),
path('edit/<id>', edit_view, name='edit'),
path('remove/<id>', remove_view, name='remove'),
path('<id>', open_view, name='open'),
path('<id>/edit', edit_view, name='edit'),
path('<id>/remove', remove_view, name='remove'),
]