Compare commits

...

3 Commits

Author SHA1 Message Date
mipel
c76a061740 Template improvements
* refactors templates/table.html into templates/generic_index.html
* adds DummyFilterInput as do-not-render-widget
* hardens combination of q filter and other filters on index view rendering
2021-07-28 09:53:14 +02:00
mipel
1d77eb293e Harden search filter
* hardens search filter against whitespaces
* renames 'Show all' filter to 'Show unshared' for clarification
* adds translation
2021-07-28 08:54:48 +02:00
mipel
d919eee3b4 Dashboard dynamic content
* replaces static dummy values with database values
* renames 'Your own' into 'Shared with you' for clarification
* adds translation
2021-07-28 08:50:53 +02:00
10 changed files with 295 additions and 216 deletions

View File

@ -89,6 +89,9 @@ class Compensation(BaseObject):
geometry = models.ForeignKey(Geometry, null=True, blank=True, on_delete=models.SET_NULL) geometry = models.ForeignKey(Geometry, null=True, blank=True, on_delete=models.SET_NULL)
documents = models.ManyToManyField("konova.Document", blank=True) documents = models.ManyToManyField("konova.Document", blank=True)
# Holds which intervention is simply a newer version of this dataset
next_version = models.ForeignKey("Compensation", null=True, blank=True, on_delete=models.DO_NOTHING)
intervention = models.ForeignKey( intervention = models.ForeignKey(
Intervention, Intervention,
on_delete=models.CASCADE, on_delete=models.CASCADE,

View File

@ -11,20 +11,26 @@ from django.contrib.auth.models import User
from django.db.models import QuerySet, Q from django.db.models import QuerySet, Q
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
from intervention.forms import DummyFilterInput
from intervention.models import Intervention from intervention.models import Intervention
class InterventionTableFilter(django_filters.FilterSet): class InterventionTableFilter(django_filters.FilterSet):
q = django_filters.Filter(
method='_filter_by_keyword',
widget=forms.HiddenInput(), # use search bar in template, we only need the filter logic in here!
)
sa = django_filters.BooleanFilter( sa = django_filters.BooleanFilter(
method='_filter_show_all', method='_filter_show_all',
label=_("Show all"), label=_("Show unshared"),
label_suffix=_(""), label_suffix=_(""),
widget=forms.CheckboxInput() widget=forms.CheckboxInput()
) )
q = django_filters.Filter(
method='_filter_by_keyword',
# Since we use a custom search bar in the template, we need to 'render' this filter
# as 'anonymous' HiddenInput (no id, no name). This way our custom search bar's id and name won't be
# overwritten with these id and name (which would be equal)
# This way we can use the simple filter method mapping for a parameter without using a predefined widget!
widget=DummyFilterInput(),
)
sr = django_filters.BooleanFilter( sr = django_filters.BooleanFilter(
method='_filter_show_recorded', method='_filter_show_recorded',
label=_("Show recorded"), label=_("Show recorded"),
@ -72,6 +78,7 @@ class InterventionTableFilter(django_filters.FilterSet):
Returns: Returns:
""" """
value = value.strip()
# build filter expression # build filter expression
q = Q(title__icontains=value) | Q(identifier__icontains=value) q = Q(title__icontains=value) | Q(identifier__icontains=value)
return queryset.filter(q) return queryset.filter(q)

View File

@ -218,3 +218,13 @@ class OpenInterventionForm(EditInterventionForm):
# Disable all form fields # Disable all form fields
for field in self.fields: for field in self.fields:
self.disable_form_field(field) self.disable_form_field(field)
class DummyFilterInput(forms.HiddenInput):
""" A dummy input widget
Does not render anything. Can be used to keep filter logic using django_filter without having a pre defined
filter widget being rendered to the template.
"""
template_name = "intervention/dummy-filter-input.html"

View File

@ -0,0 +1,5 @@
{% comment %}
This is an empty template.
It's used to dismiss a default widget for a django_filter filter and to use a predefined input directly in the
template without losing the comfort of matching the filter methods declared in the filter
{% endcomment %}

View File

@ -1,5 +1,5 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% load i18n fontawesome_5 %} {% load i18n fontawesome_5 humanize %}
{% block body %} {% block body %}
{% include 'news/dashboard-news.html' %} {% include 'news/dashboard-news.html' %}
@ -21,11 +21,11 @@
<div class="col-sm"> <div class="col-sm">
<div class="col-md mb-2"> <div class="col-md mb-2">
<div>{% trans 'Total' %}</div> <div>{% trans 'Total' %}</div>
<div class="class badge badge-pill rlp-gd-outline w-100">{{total_intervention_count}}</div> <div class="class badge badge-pill rlp-gd-outline w-100">{{total_intervention_count|intcomma}}</div>
</div> </div>
<div class="col-md"> <div class="col-md">
<div>{% trans 'Your own' %}</div> <div>{% trans 'Shared with you' %}</div>
<div class="class badge badge-pill rlp-gd-outline w-100">{{user_intervention_count}}</div> <div class="class badge badge-pill rlp-gd-outline w-100">{{user_intervention_count|intcomma}}</div>
</div> </div>
</div> </div>
</div> </div>
@ -59,11 +59,11 @@
<div class="col-sm"> <div class="col-sm">
<div class="col-md mb-2"> <div class="col-md mb-2">
<div>{% trans 'Total' %}</div> <div>{% trans 'Total' %}</div>
<div class="class badge badge-pill rlp-gd-outline w-100">{{total_compensation_count}}</div> <div class="class badge badge-pill rlp-gd-outline w-100">{{total_compensation_count|intcomma}}</div>
</div> </div>
<div class="col-md"> <div class="col-md">
<div>{% trans 'Your own' %}</div> <div>{% trans 'Shared with you' %}</div>
<div class="class badge badge-pill rlp-gd-outline w-100">{{user_compensation_count}}</div> <div class="class badge badge-pill rlp-gd-outline w-100">{{user_compensation_count|intcomma}}</div>
</div> </div>
</div> </div>
</div> </div>
@ -98,11 +98,11 @@
<div class="col-sm"> <div class="col-sm">
<div class="col-md mb-2"> <div class="col-md mb-2">
<div>{% trans 'Total' %}</div> <div>{% trans 'Total' %}</div>
<div class="class badge badge-pill rlp-gd-outline w-100">{{total_eco_count}}</div> <div class="class badge badge-pill rlp-gd-outline w-100">{{total_eco_count|intcomma}}</div>
</div> </div>
<div class="col-md"> <div class="col-md">
<div>{% trans 'Your own' %}</div> <div>{% trans 'Shared with you' %}</div>
<div class="class badge badge-pill rlp-gd-outline w-100">{{user_eco_count}}</div> <div class="class badge badge-pill rlp-gd-outline w-100">{{user_eco_count|intcomma}}</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -13,6 +13,8 @@ from django.shortcuts import redirect, render, get_object_or_404
from django.utils import timezone from django.utils import timezone
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
from compensation.models import Compensation, EcoAccount
from intervention.models import Intervention
from konova.contexts import BaseContext from konova.contexts import BaseContext
from konova.forms import RemoveModalForm from konova.forms import RemoveModalForm
from konova.models import Document from konova.models import Document
@ -47,6 +49,8 @@ def home_view(request: HttpRequest):
""" """
template = "konova/home.html" template = "konova/home.html"
now = timezone.now() now = timezone.now()
user = request.user
# Fetch the four newest active and published ServerMessages # Fetch the four newest active and published ServerMessages
msgs = ServerMessage.objects.filter( msgs = ServerMessage.objects.filter(
is_active=True, is_active=True,
@ -56,14 +60,43 @@ def home_view(request: HttpRequest):
"-publish_on" "-publish_on"
)[:4] )[:4]
# First fetch all valid objects (undeleted, only newest versions)
interventions = Intervention.objects.filter(
deleted_on=None,
deleted_by=None,
next_version=None,
)
# Then fetch only user related ones
user_interventions = interventions.filter(
users__in=[user]
)
# Repeat for other objects
comps = Compensation.objects.filter(
deleted_on=None,
deleted_by=None,
next_version=None,
)
user_comps = comps.filter(
users__in=[user]
)
eco_accs = EcoAccount.objects.filter(
deleted_on=None,
deleted_by=None,
next_version=None,
)
user_ecco_accs = eco_accs.filter(
users__in=[user]
)
additional_context = { additional_context = {
"msgs": msgs, "msgs": msgs,
"total_intervention_count": 123, "total_intervention_count": interventions.count(),
"user_intervention_count": 5, "user_intervention_count": user_interventions.count(),
"total_compensation_count": 123, "total_compensation_count": comps.count(),
"user_compensation_count": 5, "user_compensation_count": user_comps.count(),
"total_eco_count": 123, "total_eco_count": eco_accs.count(),
"user_eco_count": 5, "user_eco_count": user_ecco_accs.count(),
} }
context = BaseContext(request, additional_context).context context = BaseContext(request, additional_context).context
return render(request, template, context) return render(request, template, context)

Binary file not shown.

View File

@ -3,16 +3,17 @@
# This file is distributed under the same license as the PACKAGE package. # This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# #
#: compensation/forms.py:26 compensation/forms.py:32 compensation/forms.py:45 #: compensation/forms.py:27 compensation/forms.py:32 compensation/forms.py:45
#: intervention/filters.py:25 intervention/filters.py:31 #: intervention/filters.py:25 intervention/filters.py:31
#: intervention/filters.py:38 intervention/filters.py:39 konova/forms.py:73 #: intervention/filters.py:38 intervention/filters.py:39 konova/forms.py:78
#: konova/forms.py:149 konova/forms.py:172 user/forms.py:38 #: konova/forms.py:154 konova/forms.py:181 konova/forms.py:186
#: konova/forms.py:198 konova/forms.py:209 konova/forms.py:222 user/forms.py:38
#, fuzzy #, fuzzy
msgid "" 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-26 10:44+0200\n" "POT-Creation-Date: 2021-07-28 08:51+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"
@ -22,16 +23,17 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: compensation/forms.py:25 #: compensation/forms.py:26
#: intervention/templates/intervention/detail-view.html:227 #: intervention/templates/intervention/detail/related-objects.html:78
msgid "Amount" msgid "Amount"
msgstr "Betrag" msgstr "Betrag"
#: compensation/forms.py:27 #: compensation/forms.py:28
msgid "Amount in Euro" msgid "Amount in Euro"
msgstr "Betrag in Euro" msgstr "Betrag in Euro"
#: compensation/forms.py:31 #: compensation/forms.py:31
#: intervention/templates/intervention/detail/related-objects.html:81
msgid "Due on" msgid "Due on"
msgstr "Fällig am" msgstr "Fällig am"
@ -47,29 +49,29 @@ msgstr "Verwendungszweck"
msgid "Note for money transfer" msgid "Note for money transfer"
msgstr "Verwendungszweck für Überweisung" msgstr "Verwendungszweck für Überweisung"
#: compensation/forms.py:55 #: compensation/forms.py:54
msgid "Payment" msgid "Payment"
msgstr "Zahlung" msgstr "Zahlung"
#: compensation/forms.py:56 #: compensation/forms.py:55
msgid "Add a payment for intervention '{}'" msgid "Add a payment for intervention '{}'"
msgstr "Neue Ersatzzahlung zu Eingriff '{}' hinzufügen" msgstr "Neue Ersatzzahlung zu Eingriff '{}' hinzufügen"
#: 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:179 #: intervention/templates/intervention/detail/related-objects.html:30
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:62 #: intervention/templates/intervention/detail/related-documents.html:28
#: intervention/templates/intervention/detail-view.html:182 #: intervention/templates/intervention/detail/related-objects.html:33
#: intervention/templates/intervention/detail-view.html:287 #: intervention/templates/intervention/detail/view.html:62 konova/forms.py:180
msgid "Title" msgid "Title"
msgstr "Bezeichnung" msgstr "Bezeichnung"
#: compensation/tables.py:28 compensation/tables.py:81 #: compensation/tables.py:28 compensation/tables.py:81 konova/forms.py:185
msgid "Created on" msgid "Created on"
msgstr "Erstellt" msgstr "Erstellt"
@ -78,7 +80,7 @@ msgid "Actions"
msgstr "Aktionen" msgstr "Aktionen"
#: compensation/tables.py:44 #: compensation/tables.py:44
#: intervention/templates/intervention/detail-view.html:159 #: intervention/templates/intervention/detail/related-objects.html:10
msgid "Compensations" msgid "Compensations"
msgstr "Kompensationen" msgstr "Kompensationen"
@ -110,7 +112,8 @@ msgstr "Ökokonten"
msgid "Payment added" msgid "Payment added"
msgstr "Zahlung hinzugefügt" msgstr "Zahlung hinzugefügt"
#: compensation/views.py:142 compensation/views.py:180 konova/views.py:137 #: compensation/views.py:142 compensation/views.py:180
#: intervention/views.py:101 konova/views.py:153
msgid "There was an error on this form." msgid "There was an error on this form."
msgstr "Es gab einen Fehler im Formular." msgstr "Es gab einen Fehler im Formular."
@ -119,8 +122,8 @@ msgid "Payment removed"
msgstr "Zahlung gelöscht" msgstr "Zahlung gelöscht"
#: intervention/filters.py:24 #: intervention/filters.py:24
msgid "Show all" msgid "Show unshared"
msgstr "Alle anzeigen" msgstr "Nicht freigegebene anzeigen"
#: intervention/filters.py:30 #: intervention/filters.py:30
msgid "Show recorded" msgid "Show recorded"
@ -147,7 +150,7 @@ msgid "Which intervention type is this"
msgstr "Welcher Eingriffstyp" msgstr "Welcher Eingriffstyp"
#: intervention/forms.py:44 #: intervention/forms.py:44
#: intervention/templates/intervention/detail-view.html:70 #: intervention/templates/intervention/detail/view.html:70
msgid "Law" msgid "Law"
msgstr "Gesetz" msgstr "Gesetz"
@ -156,7 +159,7 @@ msgid "Based on which law"
msgstr "Basiert auf welchem Recht" msgstr "Basiert auf welchem Recht"
#: intervention/forms.py:50 #: intervention/forms.py:50
#: intervention/templates/intervention/detail-view.html:90 #: intervention/templates/intervention/detail/view.html:90
msgid "Intervention handler" msgid "Intervention handler"
msgstr "Eingriffsverursacher" msgstr "Eingriffsverursacher"
@ -205,12 +208,12 @@ msgid "Edit intervention"
msgstr "Eingriff bearbeiten" msgstr "Eingriff bearbeiten"
#: intervention/tables.py:33 #: intervention/tables.py:33
#: intervention/templates/intervention/detail-view.html:94 #: intervention/templates/intervention/detail/view.html:94
msgid "Checked" msgid "Checked"
msgstr "Geprüft" msgstr "Geprüft"
#: intervention/tables.py:39 #: intervention/tables.py:39
#: intervention/templates/intervention/detail-view.html:108 #: intervention/templates/intervention/detail/view.html:108
msgid "Recorded" msgid "Recorded"
msgstr "Verzeichnet" msgstr "Verzeichnet"
@ -227,7 +230,7 @@ msgid "Interventions"
msgstr "Eingriffe" msgstr "Eingriffe"
#: intervention/tables.py:92 intervention/tables.py:170 #: intervention/tables.py:92 intervention/tables.py:170
#: intervention/templates/intervention/detail-view.html:12 #: intervention/templates/intervention/detail/view.html:12
#: konova/templates/konova/home.html:11 templates/navbar.html:22 #: konova/templates/konova/home.html:11 templates/navbar.html:22
msgid "Intervention" msgid "Intervention"
msgstr "Eingriff" msgstr "Eingriff"
@ -256,125 +259,131 @@ msgstr "Für Sie freigegeben - Datensatz kann bearbeitet werden"
msgid "Access not granted" msgid "Access not granted"
msgstr "Nicht freigegeben - Datensatz nur lesbar" msgstr "Nicht freigegeben - Datensatz nur lesbar"
#: intervention/templates/intervention/detail-view.html:17 #: intervention/templates/intervention/detail/related-documents.html:10
msgid "Documents"
msgstr "Dokumente"
#: intervention/templates/intervention/detail/related-documents.html:15
#: konova/forms.py:221
msgid "Add new document"
msgstr "Neues Dokument hinzufügen"
#: intervention/templates/intervention/detail/related-documents.html:31
#: konova/forms.py:208
msgid "Comment"
msgstr "Kommentar"
#: intervention/templates/intervention/detail/related-documents.html:34
#: intervention/templates/intervention/detail/related-objects.html:87
msgid "Action"
msgstr "Aktionen"
#: intervention/templates/intervention/detail/related-documents.html:48
msgid "Remove document"
msgstr "Dokument löschen"
#: intervention/templates/intervention/detail/related-objects.html:15
msgid "Add new compensation"
msgstr "Neue Kompensation hinzufügen"
#: intervention/templates/intervention/detail/related-objects.html:60
msgid "Payments"
msgstr "Ersatzzahlungen"
#: intervention/templates/intervention/detail/related-objects.html:65
msgid "Add new payment"
msgstr "Neue Zahlung hinzufügen"
#: intervention/templates/intervention/detail/related-objects.html:84
msgid "Transfer comment"
msgstr "Verwendungszweck"
#: intervention/templates/intervention/detail/related-objects.html:102
msgid "Remove payment"
msgstr "Zahlung entfernen"
#: intervention/templates/intervention/detail/view.html:17
msgid "Open in LANIS" msgid "Open in LANIS"
msgstr "In LANIS öffnen" msgstr "In LANIS öffnen"
#: intervention/templates/intervention/detail-view.html:22 #: intervention/templates/intervention/detail/view.html:22
msgid "Public report" msgid "Public report"
msgstr "Öffentlicher Bericht" msgstr "Öffentlicher Bericht"
#: intervention/templates/intervention/detail-view.html:28 #: intervention/templates/intervention/detail/view.html:28
msgid "Share" msgid "Share"
msgstr "Freigabe" msgstr "Freigabe"
#: intervention/templates/intervention/detail-view.html:33 #: intervention/templates/intervention/detail/view.html:33
msgid "Run check" msgid "Run check"
msgstr "Prüfung vornehmen" msgstr "Prüfung vornehmen"
#: intervention/templates/intervention/detail-view.html:38 #: intervention/templates/intervention/detail/view.html:38
msgid "Record" msgid "Record"
msgstr "Verzeichnen" msgstr "Verzeichnen"
#: intervention/templates/intervention/detail-view.html:43 #: intervention/templates/intervention/detail/view.html:43
msgid "Edit" msgid "Edit"
msgstr "Bearbeiten" msgstr "Bearbeiten"
#: intervention/templates/intervention/detail-view.html:48 #: intervention/templates/intervention/detail/view.html:48
#: 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:66 #: intervention/templates/intervention/detail/view.html:66
msgid "Process type" msgid "Process type"
msgstr "Verfahrenstyp" msgstr "Verfahrenstyp"
#: intervention/templates/intervention/detail-view.html:74 #: intervention/templates/intervention/detail/view.html:74
msgid "Registration office" msgid "Registration office"
msgstr "Zulassungsbehörde" msgstr "Zulassungsbehörde"
#: intervention/templates/intervention/detail-view.html:78 #: intervention/templates/intervention/detail/view.html:78
msgid "Registration office file number" msgid "Registration office file number"
msgstr "Aktenzeichen Zulassungsbehörde" msgstr "Aktenzeichen Zulassungsbehörde"
#: intervention/templates/intervention/detail-view.html:82 #: intervention/templates/intervention/detail/view.html:82
msgid "Conservation office" msgid "Conservation office"
msgstr "Naturschutzbehörde" msgstr "Naturschutzbehörde"
#: intervention/templates/intervention/detail-view.html:86 #: intervention/templates/intervention/detail/view.html:86
msgid "Conversation office file number" msgid "Conversation office file number"
msgstr "Aktenzeichen Naturschutzbehörde" msgstr "Aktenzeichen Naturschutzbehörde"
#: intervention/templates/intervention/detail-view.html:122 #: intervention/templates/intervention/detail/view.html:122
msgid "Registration date" msgid "Registration date"
msgstr "Datum Zulassung bzw. Satzungsbeschluss" msgstr "Datum Zulassung bzw. Satzungsbeschluss"
#: intervention/templates/intervention/detail-view.html:126 #: intervention/templates/intervention/detail/view.html:126
msgid "Binding on" msgid "Binding on"
msgstr "Datum Bestandskraft" msgstr "Datum Bestandskraft"
#: intervention/templates/intervention/detail-view.html:130 #: intervention/templates/intervention/detail/view.html:130
msgid "Last modified" msgid "Last modified"
msgstr "Zuletzt bearbeitet" msgstr "Zuletzt bearbeitet"
#: intervention/templates/intervention/detail-view.html:134 #: intervention/templates/intervention/detail/view.html:134
msgid "by" msgid "by"
msgstr "von" msgstr "von"
#: intervention/templates/intervention/detail-view.html:143 #: intervention/templates/intervention/detail/view.html:143
msgid "No geometry added, yet." msgid "No geometry added, yet."
msgstr "Keine Geometrie vorhanden" msgstr "Keine Geometrie vorhanden"
#: intervention/templates/intervention/detail-view.html:164
msgid "Add new compensation"
msgstr "Neue Kompensation hinzufügen"
#: intervention/templates/intervention/detail-view.html:209
msgid "Payments"
msgstr "Ersatzzahlungen"
#: intervention/templates/intervention/detail-view.html:214
msgid "Add new payment"
msgstr "Neue Zahlung hinzufügen"
#: intervention/templates/intervention/detail-view.html:230
msgid "Transfer comment"
msgstr "Verwendungszweck"
#: intervention/templates/intervention/detail-view.html:233
#: intervention/templates/intervention/detail-view.html:293
msgid "Action"
msgstr "Aktionen"
#: intervention/templates/intervention/detail-view.html:247
msgid "Remove payment"
msgstr "Zahlung entfernen"
#: intervention/templates/intervention/detail-view.html:267
msgid "Documents"
msgstr "Dokumente"
#: intervention/templates/intervention/detail-view.html:272
msgid "Add new document"
msgstr "Neues Dokument hinzufügen"
#: intervention/templates/intervention/detail-view.html:290
msgid "Comment"
msgstr "Kommentar"
#: intervention/templates/intervention/detail-view.html:307 konova/forms.py:180
msgid "Remove document"
msgstr "Dokument löschen"
#: intervention/views.py:62 #: intervention/views.py:62
msgid "Intervention {} added" msgid "Intervention {} added"
msgstr "Eingriff {} hinzugefügt" msgstr "Eingriff {} hinzugefügt"
#: intervention/views.py:65 intervention/views.py:128 #: intervention/views.py:65 intervention/views.py:166
msgid "Invalid input" msgid "Invalid input"
msgstr "Eingabe fehlerhaft" msgstr "Eingabe fehlerhaft"
#: intervention/views.py:102 #: intervention/views.py:94
msgid "Document '{}' added"
msgstr "Dokument '{}' hinzugefügt"
#: intervention/views.py:140
msgid "" msgid ""
"Remember: This data has not been shared with you, yet. This means you can " "Remember: This data has not been shared with you, yet. This means you can "
"only read but can not edit or perform any actions like running a check or " "only read but can not edit or perform any actions like running a check or "
@ -384,7 +393,7 @@ msgstr ""
"bedeutet, dass Sie nur lesenden Zugriff hierauf haben und weder bearbeiten, " "bedeutet, dass Sie nur lesenden Zugriff hierauf haben und weder bearbeiten, "
"noch Prüfungen durchführen oder verzeichnen können." "noch Prüfungen durchführen oder verzeichnen können."
#: intervention/views.py:125 #: intervention/views.py:163
msgid "{} edited" msgid "{} edited"
msgstr "{} bearbeitet" msgstr "{} bearbeitet"
@ -400,29 +409,42 @@ msgstr "Hierfür müssen Sie Administrator sein!"
msgid "You need to be part of another user group." msgid "You need to be part of another user group."
msgstr "Hierfür müssen Sie einer anderen Nutzergruppe angehören!" msgstr "Hierfür müssen Sie einer anderen Nutzergruppe angehören!"
#: konova/forms.py:46 #: konova/forms.py:51
msgid "Not editable" msgid "Not editable"
msgstr "Nicht editierbar" msgstr "Nicht editierbar"
#: konova/forms.py:72 konova/forms.py:148 konova/forms.py:171 #: konova/forms.py:77 konova/forms.py:153
msgid "Confirm" msgid "Confirm"
msgstr "Bestätige" msgstr "Bestätige"
#: konova/forms.py:84 konova/forms.py:156 #: konova/forms.py:89 konova/forms.py:162
msgid "Remove" msgid "Remove"
msgstr "Löschen" msgstr "Löschen"
#: konova/forms.py:86 #: konova/forms.py:91
msgid "You are about to remove {} {}" msgid "You are about to remove {} {}"
msgstr "Sie sind dabei {} {} zu löschen" msgstr "Sie sind dabei {} {} zu löschen"
#: konova/forms.py:157 #: konova/forms.py:163
msgid "Are you sure?" msgid "Are you sure?"
msgstr "" msgstr ""
#: konova/forms.py:181 #: konova/forms.py:187
msgid "This will remove '{}'. Are you sure?" msgid "When has this file been created? Important for photos."
msgstr "Hiermit wird '{}' gelöscht. Sind Sie sicher?" msgstr ""
#: konova/forms.py:197
#: venv/lib/python3.7/site-packages/django/db/models/fields/files.py:231
msgid "File"
msgstr ""
#: konova/forms.py:199
msgid "Must be smaller than 15 Mb"
msgstr ""
#: konova/forms.py:210
msgid "Additional comment on this file"
msgstr "Zusätzlicher Kommentar"
#: konova/management/commands/setup_data.py:42 #: konova/management/commands/setup_data.py:42
msgid "On new related data" msgid "On new related data"
@ -455,8 +477,8 @@ msgstr "Insgesamt"
#: konova/templates/konova/home.html:27 konova/templates/konova/home.html:65 #: konova/templates/konova/home.html:27 konova/templates/konova/home.html:65
#: konova/templates/konova/home.html:104 #: konova/templates/konova/home.html:104
msgid "Your own" msgid "Shared with you"
msgstr "Eigene" msgstr "Für Sie freigegeben"
#: konova/templates/konova/home.html:35 konova/templates/konova/home.html:73 #: konova/templates/konova/home.html:35 konova/templates/konova/home.html:73
#: konova/templates/konova/home.html:114 #: konova/templates/konova/home.html:114
@ -476,7 +498,7 @@ msgstr "Ökokonto"
msgid "Withdraw" msgid "Withdraw"
msgstr "Abbuchen" msgstr "Abbuchen"
#: konova/views.py:131 #: konova/views.py:147
msgid "Document '{}' deleted" msgid "Document '{}' deleted"
msgstr "Dokument '{}' gelöscht" msgstr "Dokument '{}' gelöscht"
@ -1045,10 +1067,6 @@ msgstr ""
msgid "Universally unique identifier" msgid "Universally unique identifier"
msgstr "" msgstr ""
#: venv/lib/python3.7/site-packages/django/db/models/fields/files.py:231
msgid "File"
msgstr ""
#: venv/lib/python3.7/site-packages/django/db/models/fields/files.py:379 #: venv/lib/python3.7/site-packages/django/db/models/fields/files.py:379
msgid "Image" msgid "Image"
msgstr "" msgstr ""
@ -1848,15 +1866,21 @@ msgstr ""
msgid "A fontawesome icon field" msgid "A fontawesome icon field"
msgstr "" msgstr ""
#~ msgid "Show all"
#~ msgstr "Alle anzeigen"
#~ msgid "This will remove '{}'. Are you sure?"
#~ msgstr "Hiermit wird '{}' gelöscht. Sind Sie sicher?"
#~ msgid "Your own"
#~ msgstr "Eigene"
#~ msgid "Default" #~ msgid "Default"
#~ msgstr "Standard" #~ msgstr "Standard"
#~ msgid "Quickstart" #~ msgid "Quickstart"
#~ msgstr "Schnellstart" #~ msgstr "Schnellstart"
#~ msgid "Proceed with login"
#~ msgstr "Mit Login fortfahren"
#~ msgid "Logged in as" #~ msgid "Logged in as"
#~ msgstr "Eingeloggt als" #~ msgstr "Eingeloggt als"
@ -2022,9 +2046,6 @@ msgstr ""
#~ msgid "Current role" #~ msgid "Current role"
#~ msgstr "Aktuelle Rolle" #~ msgstr "Aktuelle Rolle"
#~ msgid "Additional comment"
#~ msgstr "Zusätzlicher Kommentar"
#~ msgid "Object title" #~ msgid "Object title"
#~ msgstr "Objekt Titel" #~ msgstr "Objekt Titel"

View File

@ -1,5 +1,94 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% load django_tables2 %}
{% load i18n static fontawesome_5 %}
{% block body %} {% block body %}
{% include 'table.html' %} <div class="col-md">
{% if table.title is not None %}
<div class="row">
<h3>
{{ table.title }}
</h3>
</div>
{% endif %}
<div class="row">
{% if table.add_new_entries %}
<div class="col-md">
<a href="{{ table.add_new_url }}">
<button class="btn btn-default" title="{% trans 'New entry' %}">
<i class="fas fa-plus mr-2"></i>
{% trans 'New' %}
</button>
</a>
</div>
{% endif %}
</div>
{% comment %}
Search input and rpp selector
{% endcomment %}
<form method="get">
<div class="row my-1">
<div class="col-sm-12 col-md-8 col-lg-6">
<div class="input-group">
<input id="id_{{table.filter.filters.q.field_name}}" name="{{table.filter.filters.q.field_name}}" type="text" class="form-control" aria-label="{% trans 'Search for keywords' %}" placeholder="{% trans 'Search' %}" value="{{ request.GET.q }}">
<div class="input-group-append" title="{% trans 'Start search' %}">
<button type="submit" class="btn btn-default input-group-text">
<span class="">
{% fa5_icon 'search' %}
</span>
</button>
</div>
</div>
</div>
<div class="col-md d-flex justify-content-end">
<div class="dropdown show">
<div class="btn btn-default dropdown-toggle" href="#" role="button" id="rppToggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{% trans 'Results per page' %}
</div>
<div class="dropdown-menu dropdown-menu-right">
{% for rpp_option in table.results_per_page_choices %}
<a class="dropdown-item {% if table.results_per_page_chosen == rpp_option %}selected{% endif %}" href="{% querystring table.results_per_page_parameter=rpp_option %}">
{{ rpp_option }}
</a>
{% endfor %}
</div>
</div>
</div>
</div>
{% comment %}
Filter section
{% endcomment %}
<div class="row">
<div class="col-md">
<div class="card">
<div id="filterHeader" class="card-header cursor-pointer" data-toggle="collapse" data-target="#filter" aria-expanded="true" aria-controls="filter">
<h5>
{% fa5_icon 'filter' %}
{% trans 'Filter' %}
</h5>
</div>
<div id="filter" class="collapse" aria-labelledby="filterHeader">
<div class="card-body">
{{ table.filter.form.as_p }}
<button class="btn btn-default" title="{% trans 'Filter' %}">
{% fa5_icon 'filter' %}
{% trans 'Apply filter' %}
</button>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
{% comment %}
Table section
{% endcomment %}
{% render_table table %}
{% endblock %} {% endblock %}

View File

@ -1,89 +0,0 @@
{% load django_tables2 %}
{% load i18n static fontawesome_5 %}
<div class="col-md">
{% if table.title is not None %}
<div class="row">
<h3>
{{ table.title }}
</h3>
</div>
{% endif %}
<div class="row">
{% if table.add_new_entries %}
<div class="col-md">
<a href="{{ table.add_new_url }}">
<button class="btn btn-default" title="{% trans 'New entry' %}">
<i class="fas fa-plus mr-2"></i>
{% trans 'New' %}
</button>
</a>
</div>
{% endif %}
</div>
{% comment %}
Search input and rpp selector
{% endcomment %}
<div class="row my-1">
<div class="col-sm-12 col-md-8 col-lg-6">
<form method="get">
<div class="input-group">
<input id="id_q" name="q" type="text" class="form-control" aria-label="{% trans 'Search for keywords' %}" placeholder="{% trans 'Search' %}" value="{{ request.GET.q }}">
<div class="input-group-append" title="{% trans 'Start search' %}">
<button type="submit" class="btn btn-default input-group-text">
<span class="">
{% fa5_icon 'search' %}
</span>
</button>
</div>
</div>
</form>
</div>
<div class="col-md d-flex justify-content-end">
<div class="dropdown show">
<div class="btn btn-default dropdown-toggle" href="#" role="button" id="rppToggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{% trans 'Results per page' %}
</div>
<div class="dropdown-menu dropdown-menu-right">
{% for rpp_option in table.results_per_page_choices %}
<a class="dropdown-item {% if table.results_per_page_chosen == rpp_option %}selected{% endif %}" href="{% querystring table.results_per_page_parameter=rpp_option %}">
{{ rpp_option }}
</a>
{% endfor %}
</div>
</div>
</div>
</div>
{% comment %}
Filter section
{% endcomment %}
<div class="row">
<div class="col-md">
<div class="card">
<div id="filterHeader" class="card-header cursor-pointer" data-toggle="collapse" data-target="#filter" aria-expanded="true" aria-controls="filter">
<h5>
{% fa5_icon 'filter' %}
{% trans 'Filter' %}
</h5>
</div>
<div id="filter" class="collapse" aria-labelledby="filterHeader">
<div class="card-body">
<form method="get">
{{ table.filter.form.as_p }}
<button class="btn btn-default" title="{% trans 'Filter' %}">
{% fa5_icon 'filter' %}
{% trans 'Apply filter' %}
</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
{% comment %}
Table section
{% endcomment %}
{% render_table table %}