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 4d651aec24
commit a304f8d42e
6 changed files with 186 additions and 29 deletions

View File

@ -23,6 +23,12 @@ class Payment(BaseResource):
""" """
amount = models.FloatField(validators=[MinValueValidator(limit_value=0.00)]) amount = models.FloatField(validators=[MinValueValidator(limit_value=0.00)])
due_on = models.DateField(null=True) due_on = models.DateField(null=True)
comment = models.CharField(
max_length=1000,
null=True,
blank=True,
help_text="Refers to german money transfer 'Verwendungszweck'",
)
class CompensationControl(BaseResource): class CompensationControl(BaseResource):

View File

@ -13,7 +13,17 @@
LANIS LANIS
</button> </button>
</a> </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 %} {% 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"> <a href="{% url 'home' %}" class="mr-2">
<button class="btn btn-default" title="{% trans 'Run check' %}"> <button class="btn btn-default" title="{% trans 'Run check' %}">
{% fa5_icon 'star' %} {% fa5_icon 'star' %}
@ -116,6 +126,107 @@
{{geom_form.geom}} {{geom_form.geom}}
</div> </div>
</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 %} {% endblock %}

View File

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

View File

@ -143,6 +143,21 @@ a {
*/ */
box-shadow: 1px 1px 3px var(--rlp-gray-dark); box-shadow: 1px 1px 3px var(--rlp-gray-dark);
} }
.btn-outline-default{
color: white;
border: 1px solid white;
}
.btn-outline-default:hover{
/*
color: var(--rlp-gray-light);
color: var(--rlp-red);;
background-color: unset;
border: 1px solid var(--rlp-red);
*/
box-shadow: 1px 1px 3px var(--rlp-gray-light);
color: var(--rlp-red);
background-color: white;
}
.cursor-pointer{ .cursor-pointer{
cursor: pointer; cursor: pointer;

Binary file not shown.

View File

@ -11,7 +11,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-07-22 13:15+0200\n" "POT-Creation-Date: 2021-07-22 14:57+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -23,14 +23,16 @@ msgstr ""
#: compensation/tables.py:18 compensation/tables.py:71 intervention/forms.py:26 #: compensation/tables.py:18 compensation/tables.py:71 intervention/forms.py:26
#: intervention/tables.py:23 #: intervention/tables.py:23
#: intervention/templates/intervention/detail-view.html:159
msgid "Identifier" msgid "Identifier"
msgstr "Kennung" msgstr "Kennung"
#: compensation/tables.py:23 compensation/tables.py:76 intervention/forms.py:33 #: compensation/tables.py:23 compensation/tables.py:76 intervention/forms.py:33
#: intervention/tables.py:28 #: intervention/tables.py:28
#: intervention/templates/intervention/detail-view.html:47 #: intervention/templates/intervention/detail-view.html:57
#: intervention/templates/intervention/detail-view.html:162
msgid "Title" msgid "Title"
msgstr "Titel" msgstr "Bezeichnung"
#: compensation/tables.py:28 compensation/tables.py:81 #: compensation/tables.py:28 compensation/tables.py:81
msgid "Created on" msgid "Created on"
@ -41,6 +43,7 @@ msgid "Actions"
msgstr "Aktionen" msgstr "Aktionen"
#: compensation/tables.py:44 #: compensation/tables.py:44
#: intervention/templates/intervention/detail-view.html:139
msgid "Compensations" msgid "Compensations"
msgstr "Kompensationen" msgstr "Kompensationen"
@ -153,12 +156,12 @@ msgid "Edit intervention"
msgstr "Eingriff bearbeiten" msgstr "Eingriff bearbeiten"
#: intervention/tables.py:33 #: intervention/tables.py:33
#: intervention/templates/intervention/detail-view.html:67 #: intervention/templates/intervention/detail-view.html:77
msgid "Checked" msgid "Checked"
msgstr "Geprüft" msgstr "Geprüft"
#: intervention/tables.py:39 #: intervention/tables.py:39
#: intervention/templates/intervention/detail-view.html:81 #: intervention/templates/intervention/detail-view.html:91
msgid "Recorded" msgid "Recorded"
msgstr "Verzeichnet" msgstr "Verzeichnet"
@ -206,57 +209,85 @@ msgstr "Nicht freigegeben - Datensatz nur lesbar"
#: intervention/templates/intervention/detail-view.html:12 #: intervention/templates/intervention/detail-view.html:12
msgid "Open in LANIS" msgid "Open in LANIS"
msgstr "" msgstr "In LANIS öffnen"
#: intervention/templates/intervention/detail-view.html:18 #: intervention/templates/intervention/detail-view.html:17
msgid "Run check" msgid "Public report"
msgstr "" msgstr "Öffentlicher Bericht"
#: intervention/templates/intervention/detail-view.html:23 #: intervention/templates/intervention/detail-view.html:23
msgid "Share"
msgstr "Freigabe"
#: intervention/templates/intervention/detail-view.html:28
msgid "Run check"
msgstr "Prüfung vornehmen"
#: intervention/templates/intervention/detail-view.html:33
msgid "Record" msgid "Record"
msgstr "Verzeichnen" msgstr "Verzeichnen"
#: intervention/templates/intervention/detail-view.html:28 #: intervention/templates/intervention/detail-view.html:38
msgid "Edit" msgid "Edit"
msgstr "Bearbeiten" msgstr "Bearbeiten"
#: intervention/templates/intervention/detail-view.html:33 #: intervention/templates/intervention/detail-view.html:43
#: venv/lib/python3.7/site-packages/django/forms/formsets.py:391 #: venv/lib/python3.7/site-packages/django/forms/formsets.py:391
msgid "Delete" msgid "Delete"
msgstr "Löschen" msgstr "Löschen"
#: intervention/templates/intervention/detail-view.html:51 #: intervention/templates/intervention/detail-view.html:61
msgid "Registration office" msgid "Registration office"
msgstr "Zulassungsbehörde" msgstr "Zulassungsbehörde"
#: intervention/templates/intervention/detail-view.html:55 #: intervention/templates/intervention/detail-view.html:65
msgid "Registration office file number" msgid "Registration office file number"
msgstr "Aktenzeichen Zulassungsbehörde" msgstr "Aktenzeichen Zulassungsbehörde"
#: intervention/templates/intervention/detail-view.html:59 #: intervention/templates/intervention/detail-view.html:69
msgid "Conservation office" msgid "Conservation office"
msgstr "Naturschutzbehörde" msgstr "Naturschutzbehörde"
#: intervention/templates/intervention/detail-view.html:63 #: intervention/templates/intervention/detail-view.html:73
msgid "Conversation office file number" msgid "Conversation office file number"
msgstr "Aktenzeichen Naturschutzbehörde" msgstr "Aktenzeichen Naturschutzbehörde"
#: intervention/templates/intervention/detail-view.html:95 #: intervention/templates/intervention/detail-view.html:105
msgid "Registration date" msgid "Registration date"
msgstr "Datum Zulassung bzw. Satzungsbeschluss" msgstr "Datum Zulassung bzw. Satzungsbeschluss"
#: intervention/templates/intervention/detail-view.html:99 #: intervention/templates/intervention/detail-view.html:109
msgid "Binding on" msgid "Binding on"
msgstr "Datum Bestandskraft" msgstr "Datum Bestandskraft"
#: intervention/templates/intervention/detail-view.html:103 #: intervention/templates/intervention/detail-view.html:113
msgid "Last modified" msgid "Last modified"
msgstr "Zuletzt bearbeitet" msgstr "Zuletzt bearbeitet"
#: intervention/templates/intervention/detail-view.html:107 #: intervention/templates/intervention/detail-view.html:117
msgid "by" msgid "by"
msgstr "von" msgstr "von"
#: intervention/templates/intervention/detail-view.html:144
msgid "Add new compensation"
msgstr "Neue Kompensation hinzufügen"
#: intervention/templates/intervention/detail-view.html:189
msgid "Payments"
msgstr "Ersatzzahlungen"
#: intervention/templates/intervention/detail-view.html:194
msgid "Add new payment"
msgstr "Neue Zahlung hinzufügen"
#: intervention/templates/intervention/detail-view.html:209
msgid "Amount"
msgstr "Betrag"
#: intervention/templates/intervention/detail-view.html:212
msgid "Transfer comment"
msgstr "Verwendungszweck"
#: intervention/views.py:62 #: intervention/views.py:62
msgid "Intervention {} added" msgid "Intervention {} added"
msgstr "Eingriff {} hinzugefügt" msgstr "Eingriff {} hinzugefügt"
@ -1744,9 +1775,6 @@ msgstr ""
#~ msgid "Delete intervention" #~ msgid "Delete intervention"
#~ msgstr "Eingriff löschen" #~ msgstr "Eingriff löschen"
#~ msgid "Add new compensation"
#~ msgstr "Neue Kompensation hinzufügen"
#~ msgid "Delete compensation" #~ msgid "Delete compensation"
#~ msgstr "Kompensation löschen" #~ msgstr "Kompensation löschen"
@ -1816,9 +1844,6 @@ msgstr ""
#~ msgid "New action" #~ msgid "New action"
#~ msgstr "Neue Maßnahme" #~ msgstr "Neue Maßnahme"
#~ msgid "Annual report"
#~ msgstr "Jahresbericht"
#~ msgid "You are currently working as " #~ msgid "You are currently working as "
#~ msgstr "Sie arbeiten gerade als " #~ msgstr "Sie arbeiten gerade als "