Documents removing
* adds generic modal rendering using package django-bootstrap-modal-forms * adds document file removing from hard drive * adds translations
This commit is contained in:
parent
df8b62de22
commit
76c7cce9bc
@ -1,7 +1,12 @@
|
|||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
{% load i18n static fontawesome_5 %}
|
{% load i18n static fontawesome_5 %}
|
||||||
|
|
||||||
|
{% block head %}
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
{% block body %}
|
{% block body %}
|
||||||
|
|
||||||
<div id="detail-header" class="row">
|
<div id="detail-header" class="row">
|
||||||
<div class="col-sm-12 col-md-12 col-lg-6">
|
<div class="col-sm-12 col-md-12 col-lg-6">
|
||||||
<h3>{% trans 'Intervention' %} {{intervention.identifier}}</h3>
|
<h3>{% trans 'Intervention' %} {{intervention.identifier}}</h3>
|
||||||
@ -293,11 +298,9 @@
|
|||||||
</td>
|
</td>
|
||||||
<td class="align-middle">{{ doc.comment }}</td>
|
<td class="align-middle">{{ doc.comment }}</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="{% url 'doc-remove' doc.id %}" class="mr-2">
|
<button data-form-url="{% url 'doc-remove' doc.id %}" class="btn btn-default del-btn" title="{% trans 'Remove document' %}">
|
||||||
<button class="btn btn-default" title="{% trans 'Remove document' %}">
|
|
||||||
{% fa5_icon 'trash' %}
|
{% fa5_icon 'trash' %}
|
||||||
</button>
|
</button>
|
||||||
</a>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@ -308,4 +311,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{% with 'del-btn' as btn_class %}
|
||||||
|
{% include 'modal/modal_form_script.html' %}
|
||||||
|
{% endwith %}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
@ -23,6 +23,7 @@ class BaseContext:
|
|||||||
"user": None,
|
"user": None,
|
||||||
"current_role": None,
|
"current_role": None,
|
||||||
"help_link": HELP_LINK,
|
"help_link": HELP_LINK,
|
||||||
|
"modal_reload_page": "true", # must be string and lower case true, since it's used in JS code
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, request: HttpRequest, additional_context: dict = {}):
|
def __init__(self, request: HttpRequest, additional_context: dict = {}):
|
||||||
|
@ -8,10 +8,12 @@ Created on: 16.11.20
|
|||||||
|
|
||||||
from abc import abstractmethod
|
from abc import abstractmethod
|
||||||
|
|
||||||
|
from bootstrap_modal_forms.forms import BSModalModelForm, BSModalForm
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.contrib.gis.forms import GeometryField, OSMWidget
|
from django.contrib.gis.forms import GeometryField, OSMWidget
|
||||||
from django.contrib.gis.geos import Polygon
|
from django.contrib.gis.geos import Polygon
|
||||||
|
from django.urls import reverse
|
||||||
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 _
|
||||||
|
|
||||||
@ -127,3 +129,18 @@ class SimpleGeomForm(BaseForm):
|
|||||||
self.fields["geom"].widget.attrs["default_zoom"] = 1
|
self.fields["geom"].widget.attrs["default_zoom"] = 1
|
||||||
self.initialize_form_field("geom", geom)
|
self.initialize_form_field("geom", geom)
|
||||||
self.area = geom.area
|
self.area = geom.area
|
||||||
|
|
||||||
|
|
||||||
|
class RemoveDocumentForm(BaseForm, BSModalForm):
|
||||||
|
confirm = forms.BooleanField(
|
||||||
|
label=_("Confirm"),
|
||||||
|
label_suffix=_(""),
|
||||||
|
widget=forms.CheckboxInput(),
|
||||||
|
required=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
super().__init__(*args, **kwargs)
|
||||||
|
self.instance = kwargs.get("instance", None)
|
||||||
|
self.form_title = _("Remove document")
|
||||||
|
self.form_caption = _("This will remove '{}'. Are you sure?").format(self.instance.title)
|
||||||
|
@ -5,6 +5,7 @@ Contact: michel.peltriaux@sgdnord.rlp.de
|
|||||||
Created on: 17.11.20
|
Created on: 17.11.20
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
import os
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
@ -65,6 +66,19 @@ class Document(BaseResource):
|
|||||||
document = models.FileField()
|
document = models.FileField()
|
||||||
comment = models.TextField()
|
comment = models.TextField()
|
||||||
|
|
||||||
|
def delete(self, using=None, keep_parents=False):
|
||||||
|
""" Custom delete function to remove the real file from the hard drive
|
||||||
|
|
||||||
|
Args:
|
||||||
|
using ():
|
||||||
|
keep_parents ():
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
|
||||||
|
"""
|
||||||
|
os.remove(self.document.file.name)
|
||||||
|
super().delete(using=using, keep_parents=keep_parents)
|
||||||
|
|
||||||
|
|
||||||
class Geometry(BaseResource):
|
class Geometry(BaseResource):
|
||||||
"""
|
"""
|
||||||
|
@ -55,6 +55,7 @@ INSTALLED_APPS = [
|
|||||||
'django.contrib.gis',
|
'django.contrib.gis',
|
||||||
'simple_sso.sso_server',
|
'simple_sso.sso_server',
|
||||||
'django_tables2',
|
'django_tables2',
|
||||||
|
'bootstrap_modal_forms',
|
||||||
'fontawesome_5',
|
'fontawesome_5',
|
||||||
'bootstrap4',
|
'bootstrap4',
|
||||||
'konova',
|
'konova',
|
||||||
|
@ -38,7 +38,7 @@ urlpatterns = [
|
|||||||
# Documents
|
# Documents
|
||||||
path('document/<id>', get_document_view, name="doc-open"),
|
path('document/<id>', get_document_view, name="doc-open"),
|
||||||
path('document/new', new_document_view, name="doc-new"),
|
path('document/new', new_document_view, name="doc-new"),
|
||||||
path('document/<id>/remove>', remove_document_view, name="doc-remove"),
|
path('document/<id>/remove', remove_document_view, name="doc-remove"),
|
||||||
|
|
||||||
# Autocomplete paths
|
# Autocomplete paths
|
||||||
path("atcmplt/orgs", OrganisationAutocomplete.as_view(), name="orgs-autocomplete"),
|
path("atcmplt/orgs", OrganisationAutocomplete.as_view(), name="orgs-autocomplete"),
|
||||||
|
@ -14,6 +14,7 @@ from django.utils import timezone
|
|||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
from konova.contexts import BaseContext
|
from konova.contexts import BaseContext
|
||||||
|
from konova.forms import RemoveDocumentForm
|
||||||
from konova.models import Document
|
from konova.models import Document
|
||||||
from news.models import ServerMessage
|
from news.models import ServerMessage
|
||||||
from konova.settings import SSO_SERVER_BASE
|
from konova.settings import SSO_SERVER_BASE
|
||||||
@ -104,17 +105,43 @@ def new_document_view(request: HttpRequest):
|
|||||||
def remove_document_view(request: HttpRequest, id: str):
|
def remove_document_view(request: HttpRequest, id: str):
|
||||||
""" Renders a form for uploading new documents
|
""" Renders a form for uploading new documents
|
||||||
|
|
||||||
|
This function works using a modal. We are not using the regular way, the django bootstrap modal forms are
|
||||||
|
intended to be used. Instead of View classes we work using the classic way of dealing with forms (see below).
|
||||||
|
It is important to mention, that modal forms, which should reload the page afterwards, must provide a
|
||||||
|
'reload_page' bool in the context. This way, the modal may reload the page or not.
|
||||||
|
|
||||||
|
For further details see the comments in templates/modal or
|
||||||
|
https://github.com/trco/django-bootstrap-modal-forms
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
request (HttpRequest): The incoming request
|
request (HttpRequest): The incoming request
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
template = "modal/modal_form.html"
|
||||||
doc = get_object_or_404(Document, id=id)
|
doc = get_object_or_404(Document, id=id)
|
||||||
title = doc.title
|
title = doc.title
|
||||||
#doc.delete()
|
form = RemoveDocumentForm(request.POST or None, instance=doc)
|
||||||
|
if request.method == "POST":
|
||||||
|
if form.is_valid():
|
||||||
|
doc.delete()
|
||||||
messages.success(
|
messages.success(
|
||||||
request,
|
request,
|
||||||
_("Document '{}' deleted").format(title)
|
_("Document '{}' deleted").format(title)
|
||||||
)
|
)
|
||||||
return redirect(request.META.get("HTTP_REFERER", "home"))
|
return redirect(request.META.get("HTTP_REFERER", "home"))
|
||||||
|
else:
|
||||||
|
messages.info(
|
||||||
|
request,
|
||||||
|
_("There was an error on this form.")
|
||||||
|
)
|
||||||
|
return redirect(request.META.get("HTTP_REFERER", "home"))
|
||||||
|
elif request.method == "GET":
|
||||||
|
context = {
|
||||||
|
"form": form,
|
||||||
|
}
|
||||||
|
context = BaseContext(request, context).context
|
||||||
|
return render(request, template, context)
|
||||||
|
else:
|
||||||
|
raise NotImplementedError
|
Binary file not shown.
@ -4,14 +4,14 @@
|
|||||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||||
#
|
#
|
||||||
#: 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:71
|
#: intervention/filters.py:38 intervention/filters.py:39 konova/forms.py:73
|
||||||
#: user/forms.py:38
|
#: konova/forms.py:137 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-23 16:00+0200\n"
|
"POT-Creation-Date: 2021-07-23 18:26+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,15 +23,15 @@ 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:174
|
#: intervention/templates/intervention/detail-view.html:179
|
||||||
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:57
|
#: intervention/templates/intervention/detail-view.html:62
|
||||||
#: intervention/templates/intervention/detail-view.html:177
|
#: intervention/templates/intervention/detail-view.html:182
|
||||||
#: intervention/templates/intervention/detail-view.html:276
|
#: intervention/templates/intervention/detail-view.html:281
|
||||||
msgid "Title"
|
msgid "Title"
|
||||||
msgstr "Bezeichnung"
|
msgstr "Bezeichnung"
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ msgid "Actions"
|
|||||||
msgstr "Aktionen"
|
msgstr "Aktionen"
|
||||||
|
|
||||||
#: compensation/tables.py:44
|
#: compensation/tables.py:44
|
||||||
#: intervention/templates/intervention/detail-view.html:154
|
#: intervention/templates/intervention/detail-view.html:159
|
||||||
msgid "Compensations"
|
msgid "Compensations"
|
||||||
msgstr "Kompensationen"
|
msgstr "Kompensationen"
|
||||||
|
|
||||||
@ -101,7 +101,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:65
|
#: intervention/templates/intervention/detail-view.html:70
|
||||||
msgid "Law"
|
msgid "Law"
|
||||||
msgstr "Gesetz"
|
msgstr "Gesetz"
|
||||||
|
|
||||||
@ -110,7 +110,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:85
|
#: intervention/templates/intervention/detail-view.html:90
|
||||||
msgid "Intervention handler"
|
msgid "Intervention handler"
|
||||||
msgstr "Eingriffsverursacher"
|
msgstr "Eingriffsverursacher"
|
||||||
|
|
||||||
@ -159,12 +159,12 @@ msgid "Edit intervention"
|
|||||||
msgstr "Eingriff bearbeiten"
|
msgstr "Eingriff bearbeiten"
|
||||||
|
|
||||||
#: intervention/tables.py:33
|
#: intervention/tables.py:33
|
||||||
#: intervention/templates/intervention/detail-view.html:89
|
#: 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:103
|
#: intervention/templates/intervention/detail-view.html:108
|
||||||
msgid "Recorded"
|
msgid "Recorded"
|
||||||
msgstr "Verzeichnet"
|
msgstr "Verzeichnet"
|
||||||
|
|
||||||
@ -181,7 +181,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:7
|
#: 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"
|
||||||
@ -210,112 +210,112 @@ 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:12
|
#: 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:17
|
#: 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:23
|
#: intervention/templates/intervention/detail-view.html:28
|
||||||
msgid "Share"
|
msgid "Share"
|
||||||
msgstr "Freigabe"
|
msgstr "Freigabe"
|
||||||
|
|
||||||
#: intervention/templates/intervention/detail-view.html:28
|
#: 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:33
|
#: intervention/templates/intervention/detail-view.html:38
|
||||||
msgid "Record"
|
msgid "Record"
|
||||||
msgstr "Verzeichnen"
|
msgstr "Verzeichnen"
|
||||||
|
|
||||||
#: intervention/templates/intervention/detail-view.html:38
|
#: intervention/templates/intervention/detail-view.html:43
|
||||||
msgid "Edit"
|
msgid "Edit"
|
||||||
msgstr "Bearbeiten"
|
msgstr "Bearbeiten"
|
||||||
|
|
||||||
#: intervention/templates/intervention/detail-view.html:43
|
#: 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:61
|
#: intervention/templates/intervention/detail-view.html:66
|
||||||
msgid "Process type"
|
msgid "Process type"
|
||||||
msgstr "Verfahrenstyp"
|
msgstr "Verfahrenstyp"
|
||||||
|
|
||||||
#: intervention/templates/intervention/detail-view.html:69
|
#: 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:73
|
#: 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:77
|
#: 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:81
|
#: 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:117
|
#: 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:121
|
#: 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:125
|
#: 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:129
|
#: intervention/templates/intervention/detail-view.html:134
|
||||||
msgid "by"
|
msgid "by"
|
||||||
msgstr "von"
|
msgstr "von"
|
||||||
|
|
||||||
#: intervention/templates/intervention/detail-view.html:138
|
#: 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:159
|
#: intervention/templates/intervention/detail-view.html:164
|
||||||
msgid "Add new compensation"
|
msgid "Add new compensation"
|
||||||
msgstr "Neue Kompensation hinzufügen"
|
msgstr "Neue Kompensation hinzufügen"
|
||||||
|
|
||||||
#: intervention/templates/intervention/detail-view.html:204
|
#: intervention/templates/intervention/detail-view.html:209
|
||||||
msgid "Payments"
|
msgid "Payments"
|
||||||
msgstr "Ersatzzahlungen"
|
msgstr "Ersatzzahlungen"
|
||||||
|
|
||||||
#: intervention/templates/intervention/detail-view.html:209
|
#: intervention/templates/intervention/detail-view.html:214
|
||||||
msgid "Add new payment"
|
msgid "Add new payment"
|
||||||
msgstr "Neue Zahlung hinzufügen"
|
msgstr "Neue Zahlung hinzufügen"
|
||||||
|
|
||||||
#: intervention/templates/intervention/detail-view.html:224
|
#: intervention/templates/intervention/detail-view.html:229
|
||||||
msgid "Amount"
|
msgid "Amount"
|
||||||
msgstr "Betrag"
|
msgstr "Betrag"
|
||||||
|
|
||||||
#: intervention/templates/intervention/detail-view.html:227
|
#: intervention/templates/intervention/detail-view.html:232
|
||||||
msgid "Transfer comment"
|
msgid "Transfer comment"
|
||||||
msgstr "Verwendungszweck"
|
msgstr "Verwendungszweck"
|
||||||
|
|
||||||
#: intervention/templates/intervention/detail-view.html:256
|
#: intervention/templates/intervention/detail-view.html:261
|
||||||
msgid "Documents"
|
msgid "Documents"
|
||||||
msgstr "Dokumente"
|
msgstr "Dokumente"
|
||||||
|
|
||||||
#: intervention/templates/intervention/detail-view.html:261
|
#: intervention/templates/intervention/detail-view.html:266
|
||||||
msgid "Add new document"
|
msgid "Add new document"
|
||||||
msgstr "Neues Dokument hinzufügen"
|
msgstr "Neues Dokument hinzufügen"
|
||||||
|
|
||||||
#: intervention/templates/intervention/detail-view.html:279
|
#: intervention/templates/intervention/detail-view.html:284
|
||||||
msgid "Comment"
|
msgid "Comment"
|
||||||
msgstr "Kommentar"
|
msgstr "Kommentar"
|
||||||
|
|
||||||
#: intervention/templates/intervention/detail-view.html:282
|
#: intervention/templates/intervention/detail-view.html:287
|
||||||
msgid "Action"
|
msgid "Action"
|
||||||
msgstr "Aktionen"
|
msgstr "Aktionen"
|
||||||
|
|
||||||
#: intervention/templates/intervention/detail-view.html:297
|
#: intervention/templates/intervention/detail-view.html:301 konova/forms.py:145
|
||||||
msgid "Remove document"
|
msgid "Remove document"
|
||||||
msgstr "Dokument löschen"
|
msgstr "Dokument löschen"
|
||||||
|
|
||||||
@ -353,22 +353,26 @@ 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:44
|
#: konova/forms.py:46
|
||||||
msgid "Not editable"
|
msgid "Not editable"
|
||||||
msgstr "Nicht editierbar"
|
msgstr "Nicht editierbar"
|
||||||
|
|
||||||
#: konova/forms.py:70
|
#: konova/forms.py:72 konova/forms.py:136
|
||||||
msgid "Confirm"
|
msgid "Confirm"
|
||||||
msgstr "Bestätigen"
|
msgstr "Bestätige"
|
||||||
|
|
||||||
#: konova/forms.py:82
|
#: konova/forms.py:84
|
||||||
msgid "Remove"
|
msgid "Remove"
|
||||||
msgstr "Entferne"
|
msgstr "Entferne"
|
||||||
|
|
||||||
#: konova/forms.py:84
|
#: konova/forms.py:86
|
||||||
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:146
|
||||||
|
msgid "This will remove '{}'. Are you sure?"
|
||||||
|
msgstr "Hiermit wird '{}' gelöscht. Sind Sie sicher?"
|
||||||
|
|
||||||
#: konova/management/commands/setup_data.py:42
|
#: konova/management/commands/setup_data.py:42
|
||||||
msgid "On new related data"
|
msgid "On new related data"
|
||||||
msgstr "Wenn neue Daten für mich angelegt werden"
|
msgstr "Wenn neue Daten für mich angelegt werden"
|
||||||
@ -421,11 +425,13 @@ msgstr "Ökokonto"
|
|||||||
msgid "Withdraw"
|
msgid "Withdraw"
|
||||||
msgstr "Abbuchen"
|
msgstr "Abbuchen"
|
||||||
|
|
||||||
#: konova/views.py:118
|
#: konova/views.py:133
|
||||||
#, fuzzy
|
|
||||||
#| msgid "Document identifier"
|
|
||||||
msgid "Document '{}' deleted"
|
msgid "Document '{}' deleted"
|
||||||
msgstr "Aktenzeichen"
|
msgstr "Dokument '{}' gelöscht"
|
||||||
|
|
||||||
|
#: konova/views.py:139
|
||||||
|
msgid "There was an error on this form."
|
||||||
|
msgstr "Es gab einen Fehler im Formular."
|
||||||
|
|
||||||
#: news/templates/news/dashboard-news.html:12 news/templates/news/index.html:19
|
#: news/templates/news/dashboard-news.html:12 news/templates/news/index.html:19
|
||||||
msgid "Published on"
|
msgid "Published on"
|
||||||
@ -467,6 +473,10 @@ msgstr "Abbrechen"
|
|||||||
msgid "Save"
|
msgid "Save"
|
||||||
msgstr "Speichern"
|
msgstr "Speichern"
|
||||||
|
|
||||||
|
#: templates/modal/modal_form.html:30
|
||||||
|
msgid "Continue"
|
||||||
|
msgstr "Weiter"
|
||||||
|
|
||||||
#: templates/navbar.html:4
|
#: templates/navbar.html:4
|
||||||
msgid "Kompensationsverzeichnis Service Portal"
|
msgid "Kompensationsverzeichnis Service Portal"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -4,6 +4,7 @@ certifi==2020.11.8
|
|||||||
chardet==3.0.4
|
chardet==3.0.4
|
||||||
Django==3.1.3
|
Django==3.1.3
|
||||||
django-autocomplete-light==3.8.1
|
django-autocomplete-light==3.8.1
|
||||||
|
django-bootstrap-modal-forms==2.2.0
|
||||||
django-bootstrap4==3.0.1
|
django-bootstrap4==3.0.1
|
||||||
django-debug-toolbar==3.1.1
|
django-debug-toolbar==3.1.1
|
||||||
django-filter==2.4.0
|
django-filter==2.4.0
|
||||||
|
@ -8,6 +8,10 @@
|
|||||||
{% bootstrap_javascript jquery='full' %}
|
{% bootstrap_javascript jquery='full' %}
|
||||||
{% fontawesome_5_static %}
|
{% fontawesome_5_static %}
|
||||||
<link rel="stylesheet" href="{% static 'css/konova.css' %}">
|
<link rel="stylesheet" href="{% static 'css/konova.css' %}">
|
||||||
|
{% comment %}
|
||||||
|
Adds script for modal rendering
|
||||||
|
{% endcomment %}
|
||||||
|
<script src="{% static 'js/jquery.bootstrap.modal.forms.min.js' %}"></script>
|
||||||
{% block head %}
|
{% block head %}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
@ -27,6 +31,15 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{% comment %}
|
||||||
|
The modal wrapper, which can be used on every view can stay on the base.html template
|
||||||
|
{% endcomment %}
|
||||||
|
<div class="modal fade" tabindex="-1" role="dialog" id="modal">
|
||||||
|
<div class="modal-dialog" role="document">
|
||||||
|
<div class="modal-content"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
{% block body %}
|
{% block body %}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
32
templates/modal/modal_form.html
Normal file
32
templates/modal/modal_form.html
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
{% load i18n %}
|
||||||
|
{% comment %}
|
||||||
|
A generic modal form template which is based on django-bootstrap-modal-forms package
|
||||||
|
https://pypi.org/project/django-bootstrap-modal-forms/
|
||||||
|
{% endcomment %}
|
||||||
|
|
||||||
|
|
||||||
|
<form method="post" action="{{form.action_url}}">
|
||||||
|
{% csrf_token %}
|
||||||
|
<div class="modal-header">
|
||||||
|
<h5 class="modal-title">{{form.form_title}}</h5>
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal-body">
|
||||||
|
<article class="mb-5">{{form.form_caption}}</article>
|
||||||
|
{% for field in form %}
|
||||||
|
<div class="form-group{% if field.errors %} invalid{% endif %}">
|
||||||
|
<label for="{{ field.id_for_label }}">{{ field.label }}</label>
|
||||||
|
{{ field }}
|
||||||
|
{% for error in field.errors %}
|
||||||
|
<p class="help-block">{{ error }}</p>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="submit" class="btn btn-default">{% trans 'Continue' %}</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
18
templates/modal/modal_form_script.html
Normal file
18
templates/modal/modal_form_script.html
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{% comment %}
|
||||||
|
Taken from https://github.com/trco/django-bootstrap-modal-forms
|
||||||
|
|
||||||
|
isDeleteForm refers to reloading the whole page after submitting the form in our case.
|
||||||
|
|
||||||
|
{% endcomment %}
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function() {
|
||||||
|
$(".{{btn_class}}").each(function () {
|
||||||
|
$(this).modalForm({
|
||||||
|
formURL: $(this).data("form-url"),
|
||||||
|
isDeleteForm: {{modal_reload_page}},
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
Loading…
Reference in New Issue
Block a user