diff --git a/compensation/tables.py b/compensation/tables.py index 401a7416..1373f2cd 100644 --- a/compensation/tables.py +++ b/compensation/tables.py @@ -5,17 +5,15 @@ Contact: michel.peltriaux@sgdnord.rlp.de Created on: 01.12.20 """ -from user.models import User +from konova.utils.message_templates import DATA_IS_UNCHECKED, DATA_CHECKED_ON_TEMPLATE, DATA_CHECKED_PREVIOUSLY_TEMPLATE from django.http import HttpRequest from django.template.loader import render_to_string from django.urls import reverse from django.utils.html import format_html -from django.utils.timezone import localtime from django.utils.translation import gettext_lazy as _ from compensation.filters import CompensationTableFilter, EcoAccountTableFilter from compensation.models import Compensation, EcoAccount -from konova.sub_settings.django_settings import DEFAULT_DATE_TIME_FORMAT from konova.utils.tables import BaseTable, TableRenderMixin import django_tables2 as tables @@ -111,16 +109,21 @@ class CompensationTable(BaseTable, TableRenderMixin): """ html = "" checked = value is not None - tooltip = _("Not checked yet") + tooltip = DATA_IS_UNCHECKED + previously_checked = record.intervention.get_last_checked_action() if checked: - value = value.timestamp - value = localtime(value) - checked_on = value.strftime(DEFAULT_DATE_TIME_FORMAT) - tooltip = _("Checked on {} by {}").format(checked_on, record.intervention.checked.user) + checked_on = value.get_timestamp_str_formatted() + tooltip = DATA_CHECKED_ON_TEMPLATE.format(checked_on, record.intervention.checked.user) html += self.render_checked_star( tooltip=tooltip, icn_filled=checked, ) + if previously_checked and not checked: + checked_on = previously_checked.get_timestamp_str_formatted() + tooltip = DATA_CHECKED_PREVIOUSLY_TEMPLATE.format(checked_on, previously_checked.user) + html += self.render_previously_checked_star( + tooltip=tooltip, + ) return format_html(html) def render_d(self, value, record: Compensation): @@ -159,9 +162,7 @@ class CompensationTable(BaseTable, TableRenderMixin): recorded = value is not None tooltip = _("Not recorded yet") if recorded: - value = value.timestamp - value = localtime(value) - on = value.strftime(DEFAULT_DATE_TIME_FORMAT) + on = value.get_timestamp_str_formatted() tooltip = _("Recorded on {} by {}").format(on, record.intervention.recorded.user) html += self.render_bookmark( tooltip=tooltip, @@ -179,8 +180,6 @@ class CompensationTable(BaseTable, TableRenderMixin): Returns: """ - if value is None: - value = User.objects.none() has_access = record.is_shared_with(self.user) html = self.render_icn( @@ -318,9 +317,7 @@ class EcoAccountTable(BaseTable, TableRenderMixin): checked = value is not None tooltip = _("Not recorded yet. Can not be used for deductions, yet.") if checked: - value = value.timestamp - value = localtime(value) - on = value.strftime(DEFAULT_DATE_TIME_FORMAT) + on = value.get_timestamp_str_formatted() tooltip = _("Recorded on {} by {}").format(on, record.recorded.user) html += self.render_bookmark( tooltip=tooltip, diff --git a/compensation/templates/compensation/detail/compensation/view.html b/compensation/templates/compensation/detail/compensation/view.html index 026a6ff6..be8dd3b9 100644 --- a/compensation/templates/compensation/detail/compensation/view.html +++ b/compensation/templates/compensation/detail/compensation/view.html @@ -66,6 +66,11 @@ {% fa5_icon 'star' 'far' %} + {% if last_checked %} + + {% fa5_icon 'star' 'fas' %} + + {% endif %} {% else %} {% fa5_icon 'star' %} diff --git a/compensation/views/compensation.py b/compensation/views/compensation.py index c3d3e2b5..31087ed7 100644 --- a/compensation/views/compensation.py +++ b/compensation/views/compensation.py @@ -23,7 +23,7 @@ from konova.utils.message_templates import FORM_INVALID, IDENTIFIER_REPLACED, DA CHECKED_RECORDED_RESET, COMPENSATION_ADDED_TEMPLATE, COMPENSATION_REMOVED_TEMPLATE, DOCUMENT_ADDED, \ COMPENSATION_STATE_REMOVED, COMPENSATION_STATE_ADDED, COMPENSATION_ACTION_REMOVED, COMPENSATION_ACTION_ADDED, \ DEADLINE_ADDED, DEADLINE_REMOVED, DOCUMENT_EDITED, COMPENSATION_STATE_EDITED, COMPENSATION_ACTION_EDITED, \ - DEADLINE_EDITED, RECORDED_BLOCKS_EDIT, PARAMS_INVALID + DEADLINE_EDITED, RECORDED_BLOCKS_EDIT, PARAMS_INVALID, DATA_CHECKED_PREVIOUSLY_TEMPLATE from konova.utils.user_checks import in_group @@ -217,8 +217,15 @@ def detail_view(request: HttpRequest, id: str): request = comp.set_status_messages(request) + last_checked = comp.intervention.get_last_checked_action() + last_checked_tooltip = "" + if last_checked: + last_checked_tooltip = DATA_CHECKED_PREVIOUSLY_TEMPLATE.format(last_checked.get_timestamp_str_formatted(), last_checked.user) + context = { "obj": comp, + "last_checked": last_checked, + "last_checked_tooltip": last_checked_tooltip, "geom_form": geom_form, "parcels": parcels, "has_access": is_data_shared, diff --git a/ema/tables.py b/ema/tables.py index 38d8a8c0..d26a31dc 100644 --- a/ema/tables.py +++ b/ema/tables.py @@ -115,7 +115,6 @@ class EmaTable(BaseTable, TableRenderMixin): ) return html - def render_r(self, value, record: Ema): """ Renders the registered column for a EMA @@ -130,9 +129,7 @@ class EmaTable(BaseTable, TableRenderMixin): recorded = value is not None tooltip = _("Not recorded yet") if recorded: - value = value.timestamp - value = localtime(value) - on = value.strftime(DEFAULT_DATE_TIME_FORMAT) + on = value.get_timestamp_str_formatted() tooltip = _("Recorded on {} by {}").format(on, record.recorded.user) html += self.render_bookmark( tooltip=tooltip, diff --git a/intervention/tables.py b/intervention/tables.py index 8f312099..cff9391c 100644 --- a/intervention/tables.py +++ b/intervention/tables.py @@ -9,12 +9,11 @@ from django.http import HttpRequest from django.template.loader import render_to_string from django.urls import reverse from django.utils.html import format_html -from django.utils.timezone import localtime from django.utils.translation import gettext_lazy as _ from intervention.filters import InterventionTableFilter from intervention.models import Intervention -from konova.sub_settings.django_settings import DEFAULT_DATE_TIME_FORMAT, DEFAULT_DATE_FORMAT +from konova.utils.message_templates import DATA_CHECKED_ON_TEMPLATE, DATA_IS_UNCHECKED, DATA_CHECKED_PREVIOUSLY_TEMPLATE from konova.utils.tables import BaseTable, TableRenderMixin import django_tables2 as tables @@ -108,16 +107,21 @@ class InterventionTable(BaseTable, TableRenderMixin): """ html = "" checked = value is not None - tooltip = _("Not checked yet") + previously_checked = record.get_last_checked_action() + tooltip = DATA_IS_UNCHECKED if checked: - value = value.timestamp - value = localtime(value) - checked_on = value.strftime(DEFAULT_DATE_TIME_FORMAT) - tooltip = _("Checked on {} by {}").format(checked_on, record.checked.user) + checked_on = value.get_timestamp_str_formatted() + tooltip = DATA_CHECKED_ON_TEMPLATE.format(checked_on, record.checked.user) html += self.render_checked_star( tooltip=tooltip, icn_filled=checked, ) + if previously_checked and not checked: + checked_on = previously_checked.get_timestamp_str_formatted() + tooltip = DATA_CHECKED_PREVIOUSLY_TEMPLATE.format(checked_on, previously_checked.user) + html += self.render_previously_checked_star( + tooltip=tooltip, + ) return format_html(html) def render_d(self, value, record: Intervention): @@ -156,9 +160,7 @@ class InterventionTable(BaseTable, TableRenderMixin): checked = value is not None tooltip = _("Not recorded yet") if checked: - value = value.timestamp - value = localtime(value) - on = value.strftime(DEFAULT_DATE_TIME_FORMAT) + on = value.get_timestamp_str_formatted() tooltip = _("Recorded on {} by {}").format(on, record.recorded.user) html += self.render_bookmark( tooltip=tooltip, diff --git a/intervention/templates/intervention/detail/view.html b/intervention/templates/intervention/detail/view.html index 55c9db99..55d57f68 100644 --- a/intervention/templates/intervention/detail/view.html +++ b/intervention/templates/intervention/detail/view.html @@ -70,6 +70,11 @@ {% fa5_icon 'star' 'far' %} + {% if last_checked %} + + {% fa5_icon 'star' 'fas' %} + + {% endif %} {% else %} {% fa5_icon 'star' %} diff --git a/intervention/views.py b/intervention/views.py index 15388dbf..36577202 100644 --- a/intervention/views.py +++ b/intervention/views.py @@ -19,7 +19,7 @@ from konova.utils.generators import generate_qr_code from konova.utils.message_templates import INTERVENTION_INVALID, FORM_INVALID, IDENTIFIER_REPLACED, \ CHECKED_RECORDED_RESET, DEDUCTION_REMOVED, DEDUCTION_ADDED, REVOCATION_ADDED, REVOCATION_REMOVED, \ COMPENSATION_REMOVED_TEMPLATE, DOCUMENT_ADDED, DEDUCTION_EDITED, REVOCATION_EDITED, DOCUMENT_EDITED, \ - RECORDED_BLOCKS_EDIT + RECORDED_BLOCKS_EDIT, DATA_CHECKED_PREVIOUSLY_TEMPLATE from konova.utils.user_checks import in_group @@ -265,9 +265,15 @@ def detail_view(request: HttpRequest, id: str): geom_form = SimpleGeomForm( instance=intervention, ) + last_checked = intervention.get_last_checked_action() + last_checked_tooltip = "" + if last_checked: + last_checked_tooltip = DATA_CHECKED_PREVIOUSLY_TEMPLATE.format(last_checked.get_timestamp_str_formatted(), last_checked.user) context = { "obj": intervention, + "last_checked": last_checked, + "last_checked_tooltip": last_checked_tooltip, "compensations": compensations, "has_access": is_data_shared, "geom_form": geom_form, diff --git a/konova/models/object.py b/konova/models/object.py index 780a0c2f..325762f4 100644 --- a/konova/models/object.py +++ b/konova/models/object.py @@ -408,6 +408,20 @@ class CheckableObjectMixin(models.Model): self.log.add(action) return action + def get_last_checked_action(self): + """ Getter for the most recent checked action on the log + + Returns: + previously_checked (UserActionLogEntry): The most recent checked action + """ + from user.models import UserAction + previously_checked = self.log.filter( + action=UserAction.CHECKED + ).order_by( + "-timestamp" + ).first() + return previously_checked + class ShareableObjectMixin(models.Model): # Users having access on this object diff --git a/konova/sub_settings/django_settings.py b/konova/sub_settings/django_settings.py index e5de97a0..746df289 100644 --- a/konova/sub_settings/django_settings.py +++ b/konova/sub_settings/django_settings.py @@ -46,8 +46,8 @@ ALLOWED_HOSTS = [ LOGIN_URL = "/login/" # Session settings -#SESSION_COOKIE_AGE = 30 * 60 # 30 minutes -#SESSION_SAVE_EVERY_REQUEST = True +SESSION_COOKIE_AGE = 60 * 60 # 60 minutes +SESSION_SAVE_EVERY_REQUEST = True # Application definition diff --git a/konova/templates/konova/includes/comment_card.html b/konova/templates/konova/includes/comment_card.html index a84f378e..d9ea59bc 100644 --- a/konova/templates/konova/includes/comment_card.html +++ b/konova/templates/konova/includes/comment_card.html @@ -6,7 +6,7 @@ {% if obj.comment %} -
+
diff --git a/konova/utils/message_templates.py b/konova/utils/message_templates.py index e062005a..f6e3ca18 100644 --- a/konova/utils/message_templates.py +++ b/konova/utils/message_templates.py @@ -81,3 +81,8 @@ GEOMETRY_CONFLICT_WITH_TEMPLATE = _("Geometry conflict detected with {}") # INTERVENTION INTERVENTION_HAS_REVOCATIONS_TEMPLATE = _("This intervention has {} revocations") + +# CHECKED +DATA_CHECKED_ON_TEMPLATE = _("Checked on {} by {}") +DATA_CHECKED_PREVIOUSLY_TEMPLATE = _("Data has changed since last check on {} by {}") +DATA_IS_UNCHECKED = _("Current data not checked yet") diff --git a/konova/utils/tables.py b/konova/utils/tables.py index d3a0406b..d7468725 100644 --- a/konova/utils/tables.py +++ b/konova/utils/tables.py @@ -112,6 +112,17 @@ class BaseTable(tables.tables.Table): icon ) + def render_previously_checked_star(self, tooltip: str = None): + """ + Returns a star icon for a check action in the past + """ + icon = "fas fa-star rlp-gd-inv" + return format_html( + "", + tooltip, + icon + ) + def render_bookmark(self, tooltip: str = None, icn_filled: bool = False): """ Returns a bookmark icon diff --git a/locale/de/LC_MESSAGES/django.mo b/locale/de/LC_MESSAGES/django.mo index fd65919a..5e1ebe07 100644 Binary files a/locale/de/LC_MESSAGES/django.mo and b/locale/de/LC_MESSAGES/django.mo differ diff --git a/locale/de/LC_MESSAGES/django.po b/locale/de/LC_MESSAGES/django.po index cc23fe5d..e735ce6c 100644 --- a/locale/de/LC_MESSAGES/django.po +++ b/locale/de/LC_MESSAGES/django.po @@ -18,15 +18,15 @@ #: konova/filters/mixins.py:277 konova/filters/mixins.py:323 #: konova/filters/mixins.py:361 konova/filters/mixins.py:362 #: konova/filters/mixins.py:393 konova/filters/mixins.py:394 -#: konova/forms.py:179 konova/forms.py:281 konova/forms.py:382 -#: konova/forms.py:426 konova/forms.py:436 konova/forms.py:449 -#: konova/forms.py:461 konova/forms.py:479 user/forms.py:42 +#: konova/forms.py:179 konova/forms.py:281 konova/forms.py:395 +#: konova/forms.py:439 konova/forms.py:449 konova/forms.py:462 +#: konova/forms.py:474 konova/forms.py:492 user/forms.py:42 #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-05-11 13:41+0200\n" +"POT-Creation-Date: 2022-05-30 09:16+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -138,9 +138,9 @@ msgstr "Zuständigkeitsbereich" #: analysis/templates/analysis/reports/includes/intervention/amount.html:17 #: analysis/templates/analysis/reports/includes/intervention/compensated_by.html:8 #: analysis/templates/analysis/reports/includes/intervention/laws.html:17 -#: compensation/tables.py:40 +#: compensation/tables.py:41 #: compensation/templates/compensation/detail/compensation/view.html:64 -#: intervention/tables.py:39 +#: intervention/tables.py:40 #: intervention/templates/intervention/detail/view.html:68 #: user/models/user_action.py:20 msgid "Checked" @@ -154,12 +154,12 @@ msgstr "Geprüft" #: analysis/templates/analysis/reports/includes/intervention/compensated_by.html:9 #: analysis/templates/analysis/reports/includes/intervention/laws.html:20 #: analysis/templates/analysis/reports/includes/old_data/amount.html:18 -#: compensation/tables.py:46 compensation/tables.py:220 +#: compensation/tables.py:47 compensation/tables.py:230 #: compensation/templates/compensation/detail/compensation/view.html:78 #: compensation/templates/compensation/detail/eco_account/includes/deductions.html:31 #: compensation/templates/compensation/detail/eco_account/view.html:45 #: ema/tables.py:44 ema/templates/ema/detail/view.html:35 -#: intervention/tables.py:45 +#: intervention/tables.py:46 #: intervention/templates/intervention/detail/view.html:82 #: user/models/user_action.py:21 msgid "Recorded" @@ -198,7 +198,7 @@ msgid "Other registration office" msgstr "Andere Zulassungsbehörden" #: analysis/templates/analysis/reports/includes/compensation/card_compensation.html:11 -#: compensation/tables.py:67 +#: compensation/tables.py:68 #: intervention/templates/intervention/detail/includes/compensations.html:8 #: intervention/templates/intervention/report/report.html:45 msgid "Compensations" @@ -227,7 +227,7 @@ msgid "Surface" msgstr "Fläche" #: analysis/templates/analysis/reports/includes/intervention/card_intervention.html:10 -#: intervention/tables.py:66 +#: intervention/tables.py:67 msgid "Interventions" msgstr "Eingriffe" @@ -285,8 +285,8 @@ msgid "Type" msgstr "Typ" #: analysis/templates/analysis/reports/includes/old_data/amount.html:24 -#: compensation/tables.py:89 intervention/forms/modalForms.py:375 -#: intervention/forms/modalForms.py:382 intervention/tables.py:88 +#: compensation/tables.py:90 intervention/forms/modalForms.py:375 +#: intervention/forms/modalForms.py:382 intervention/tables.py:89 #: intervention/templates/intervention/detail/view.html:19 #: konova/templates/konova/includes/quickstart/interventions.html:4 #: templates/navbars/navbar.html:22 @@ -294,7 +294,7 @@ msgid "Intervention" msgstr "Eingriff" #: analysis/templates/analysis/reports/includes/old_data/amount.html:34 -#: compensation/tables.py:264 +#: compensation/tables.py:274 #: compensation/templates/compensation/detail/eco_account/view.html:20 #: intervention/forms/modalForms.py:348 intervention/forms/modalForms.py:355 #: konova/templates/konova/includes/quickstart/ecoaccounts.html:4 @@ -314,9 +314,9 @@ msgstr "Vor" msgid "Show only unrecorded" msgstr "Nur unverzeichnete anzeigen" -#: compensation/forms/forms.py:32 compensation/tables.py:25 -#: compensation/tables.py:195 ema/tables.py:29 intervention/forms/forms.py:28 -#: intervention/tables.py:24 +#: compensation/forms/forms.py:32 compensation/tables.py:26 +#: compensation/tables.py:205 ema/tables.py:29 intervention/forms/forms.py:28 +#: intervention/tables.py:25 #: intervention/templates/intervention/detail/includes/compensations.html:30 msgid "Identifier" msgstr "Kennung" @@ -326,8 +326,8 @@ msgstr "Kennung" msgid "Generated automatically" msgstr "Automatisch generiert" -#: compensation/forms/forms.py:44 compensation/tables.py:30 -#: compensation/tables.py:200 +#: compensation/forms/forms.py:44 compensation/tables.py:31 +#: compensation/tables.py:210 #: compensation/templates/compensation/detail/compensation/includes/documents.html:28 #: compensation/templates/compensation/detail/compensation/view.html:32 #: compensation/templates/compensation/detail/eco_account/includes/documents.html:28 @@ -337,12 +337,12 @@ msgstr "Automatisch generiert" #: ema/tables.py:34 ema/templates/ema/detail/includes/documents.html:28 #: ema/templates/ema/detail/view.html:31 #: ema/templates/ema/report/report.html:12 intervention/forms/forms.py:40 -#: intervention/tables.py:29 +#: intervention/tables.py:30 #: intervention/templates/intervention/detail/includes/compensations.html:33 #: intervention/templates/intervention/detail/includes/documents.html:28 #: intervention/templates/intervention/detail/view.html:31 #: intervention/templates/intervention/report/report.html:12 -#: konova/forms.py:425 +#: konova/forms.py:438 msgid "Title" msgstr "Bezeichnung" @@ -369,7 +369,7 @@ msgstr "Kompensation XY; Flur ABC" #: intervention/templates/intervention/detail/includes/documents.html:34 #: intervention/templates/intervention/detail/includes/payments.html:34 #: intervention/templates/intervention/detail/includes/revocation.html:38 -#: konova/forms.py:460 konova/templates/konova/includes/comment_card.html:16 +#: konova/forms.py:473 konova/templates/konova/includes/comment_card.html:16 msgid "Comment" msgstr "Kommentar" @@ -493,7 +493,7 @@ msgid "Due on which date" msgstr "Zahlung wird an diesem Datum erwartet" #: compensation/forms/modalForms.py:65 compensation/forms/modalForms.py:363 -#: intervention/forms/modalForms.py:177 konova/forms.py:462 +#: intervention/forms/modalForms.py:177 konova/forms.py:475 msgid "Additional comment, maximum {} letters" msgstr "Zusätzlicher Kommentar, maximal {} Zeichen" @@ -675,70 +675,62 @@ msgstr "" "Es wurde bereits mehr Fläche abgebucht, als Sie nun als abbuchbar einstellen " "wollen. Kontaktieren Sie die für die Abbuchungen verantwortlichen Nutzer!" -#: compensation/tables.py:35 compensation/tables.py:205 ema/tables.py:39 -#: intervention/tables.py:34 konova/filters/mixins.py:98 +#: compensation/tables.py:36 compensation/tables.py:215 ema/tables.py:39 +#: intervention/tables.py:35 konova/filters/mixins.py:98 msgid "Parcel gmrkng" msgstr "Gemarkung" -#: compensation/tables.py:52 compensation/tables.py:226 ema/tables.py:50 -#: intervention/tables.py:51 +#: compensation/tables.py:53 compensation/tables.py:236 ema/tables.py:50 +#: intervention/tables.py:52 msgid "Editable" msgstr "Freigegeben" -#: compensation/tables.py:58 compensation/tables.py:232 ema/tables.py:56 -#: intervention/tables.py:57 +#: compensation/tables.py:59 compensation/tables.py:242 ema/tables.py:56 +#: intervention/tables.py:58 msgid "Last edit" msgstr "Zuletzt bearbeitet" -#: compensation/tables.py:89 compensation/tables.py:264 ema/tables.py:89 -#: intervention/tables.py:88 +#: compensation/tables.py:90 compensation/tables.py:274 ema/tables.py:89 +#: intervention/tables.py:89 msgid "Open {}" msgstr "Öffne {}" -#: compensation/tables.py:114 intervention/tables.py:111 -msgid "Not checked yet" -msgstr "Noch nicht geprüft" - -#: compensation/tables.py:119 intervention/tables.py:116 -msgid "Checked on {} by {}" -msgstr "Am {} von {} geprüft worden" - -#: compensation/tables.py:160 +#: compensation/tables.py:170 #: compensation/templates/compensation/detail/compensation/view.html:81 #: compensation/templates/compensation/detail/eco_account/includes/deductions.html:58 #: compensation/templates/compensation/detail/eco_account/view.html:48 #: ema/tables.py:131 ema/templates/ema/detail/view.html:38 -#: intervention/tables.py:157 +#: intervention/tables.py:167 #: intervention/templates/intervention/detail/view.html:85 msgid "Not recorded yet" msgstr "Noch nicht verzeichnet" -#: compensation/tables.py:165 compensation/tables.py:324 ema/tables.py:136 -#: intervention/tables.py:162 +#: compensation/tables.py:175 compensation/tables.py:334 ema/tables.py:136 +#: intervention/tables.py:172 msgid "Recorded on {} by {}" msgstr "Am {} von {} verzeichnet worden" -#: compensation/tables.py:187 compensation/tables.py:346 ema/tables.py:157 -#: intervention/tables.py:183 +#: compensation/tables.py:197 compensation/tables.py:356 ema/tables.py:157 +#: intervention/tables.py:193 msgid "Full access granted" msgstr "Für Sie freigegeben - Datensatz kann bearbeitet werden" -#: compensation/tables.py:187 compensation/tables.py:346 ema/tables.py:157 -#: intervention/tables.py:183 +#: compensation/tables.py:197 compensation/tables.py:356 ema/tables.py:157 +#: intervention/tables.py:193 msgid "Access not granted" msgstr "Nicht freigegeben - Datensatz nur lesbar" -#: compensation/tables.py:210 +#: compensation/tables.py:220 #: compensation/templates/compensation/detail/eco_account/view.html:36 #: konova/templates/konova/widgets/progressbar.html:3 msgid "Available" msgstr "Verfügbar" -#: compensation/tables.py:241 +#: compensation/tables.py:251 msgid "Eco Accounts" msgstr "Ökokonten" -#: compensation/tables.py:319 +#: compensation/tables.py:329 msgid "Not recorded yet. Can not be used for deductions, yet." msgstr "" "Noch nicht verzeichnet. Kann noch nicht für Abbuchungen genutzt werden." @@ -871,7 +863,7 @@ msgstr "Dokumente" #: compensation/templates/compensation/detail/eco_account/includes/documents.html:14 #: ema/templates/ema/detail/includes/documents.html:14 #: intervention/templates/intervention/detail/includes/documents.html:14 -#: konova/forms.py:478 +#: konova/forms.py:491 msgid "Add new document" msgstr "Neues Dokument hinzufügen" @@ -879,7 +871,7 @@ msgstr "Neues Dokument hinzufügen" #: compensation/templates/compensation/detail/eco_account/includes/documents.html:31 #: ema/templates/ema/detail/includes/documents.html:31 #: intervention/templates/intervention/detail/includes/documents.html:31 -#: konova/forms.py:435 +#: konova/forms.py:448 msgid "Created on" msgstr "Erstellt" @@ -887,7 +879,7 @@ msgstr "Erstellt" #: compensation/templates/compensation/detail/eco_account/includes/documents.html:61 #: ema/templates/ema/detail/includes/documents.html:61 #: intervention/templates/intervention/detail/includes/documents.html:65 -#: konova/forms.py:540 +#: konova/forms.py:553 msgid "Edit document" msgstr "Dokument bearbeiten" @@ -1150,17 +1142,17 @@ msgid "Compensation {} edited" msgstr "Kompensation {} bearbeitet" #: compensation/views/compensation.py:182 compensation/views/eco_account.py:173 -#: ema/views.py:240 intervention/views.py:334 +#: ema/views.py:240 intervention/views.py:332 msgid "Edit {}" msgstr "Bearbeite {}" #: compensation/views/compensation.py:261 compensation/views/eco_account.py:359 -#: ema/views.py:194 intervention/views.py:538 +#: ema/views.py:194 intervention/views.py:536 msgid "Log" msgstr "Log" #: compensation/views/compensation.py:605 compensation/views/eco_account.py:727 -#: ema/views.py:558 intervention/views.py:684 +#: ema/views.py:558 intervention/views.py:682 msgid "Report {}" msgstr "Bericht {}" @@ -1181,32 +1173,32 @@ msgid "Eco-account removed" msgstr "Ökokonto entfernt" #: compensation/views/eco_account.py:380 ema/views.py:282 -#: intervention/views.py:637 +#: intervention/views.py:635 msgid "{} unrecorded" msgstr "{} entzeichnet" #: compensation/views/eco_account.py:380 ema/views.py:282 -#: intervention/views.py:637 +#: intervention/views.py:635 msgid "{} recorded" msgstr "{} verzeichnet" #: compensation/views/eco_account.py:804 ema/views.py:628 -#: intervention/views.py:435 +#: intervention/views.py:433 msgid "{} has already been shared with you" msgstr "{} wurde bereits für Sie freigegeben" #: compensation/views/eco_account.py:809 ema/views.py:633 -#: intervention/views.py:440 +#: intervention/views.py:438 msgid "{} has been shared with you" msgstr "{} ist nun für Sie freigegeben" #: compensation/views/eco_account.py:816 ema/views.py:640 -#: intervention/views.py:447 +#: intervention/views.py:445 msgid "Share link invalid" msgstr "Freigabelink ungültig" #: compensation/views/eco_account.py:839 ema/views.py:663 -#: intervention/views.py:470 +#: intervention/views.py:468 msgid "Share settings updated" msgstr "Freigabe Einstellungen aktualisiert" @@ -1312,7 +1304,7 @@ msgstr "Datum Zulassung bzw. Satzungsbeschluss" msgid "Binding on" msgstr "Datum Bestandskraft bzw. Rechtskraft" -#: intervention/forms/forms.py:211 intervention/views.py:97 +#: intervention/forms/forms.py:211 intervention/views.py:95 msgid "New intervention" msgstr "Neuer Eingriff" @@ -1392,7 +1384,7 @@ msgstr "Kompensationen und Zahlungen geprüft" msgid "Run check" msgstr "Prüfung vornehmen" -#: intervention/forms/modalForms.py:264 konova/forms.py:581 +#: intervention/forms/modalForms.py:264 konova/forms.py:594 msgid "" "I, {} {}, confirm that all necessary control steps have been performed by " "myself." @@ -1532,27 +1524,27 @@ msgstr "" "Kein Ausgleich jeglicher Art gefunden (Kompensation, Ersatzzahlung, " "Abbuchung)" -#: intervention/views.py:54 +#: intervention/views.py:52 msgid "Interventions - Overview" msgstr "Eingriffe - Übersicht" -#: intervention/views.py:87 +#: intervention/views.py:85 msgid "Intervention {} added" msgstr "Eingriff {} hinzugefügt" -#: intervention/views.py:322 +#: intervention/views.py:320 msgid "Intervention {} edited" msgstr "Eingriff {} bearbeitet" -#: intervention/views.py:358 +#: intervention/views.py:356 msgid "{} removed" msgstr "{} entfernt" -#: intervention/views.py:491 +#: intervention/views.py:489 msgid "Check performed" msgstr "Prüfung durchgeführt" -#: intervention/views.py:642 +#: intervention/views.py:640 msgid "There are errors on this intervention:" msgstr "Es liegen Fehler in diesem Eingriff vor:" @@ -1645,11 +1637,11 @@ msgstr "Speichern" msgid "Not editable" msgstr "Nicht editierbar" -#: konova/forms.py:178 konova/forms.py:381 +#: konova/forms.py:178 konova/forms.py:394 msgid "Confirm" msgstr "Bestätige" -#: konova/forms.py:190 konova/forms.py:390 +#: konova/forms.py:190 konova/forms.py:403 msgid "Remove" msgstr "Löschen" @@ -1662,48 +1654,49 @@ msgstr "Sie sind dabei {} {} zu löschen" msgid "Geometry" msgstr "Geometrie" -#: konova/forms.py:325 +#: konova/forms.py:331 msgid "Only surfaces allowed. Points or lines must be buffered." -msgstr "Nur Flächen erlaubt. Punkte oder Linien müssen zu Flächen gepuffert werden." +msgstr "" +"Nur Flächen erlaubt. Punkte oder Linien müssen zu Flächen gepuffert werden." -#: konova/forms.py:391 +#: konova/forms.py:404 msgid "Are you sure?" msgstr "Sind Sie sicher?" -#: konova/forms.py:437 +#: konova/forms.py:450 msgid "When has this file been created? Important for photos." msgstr "Wann wurde diese Datei erstellt oder das Foto aufgenommen?" -#: konova/forms.py:448 +#: konova/forms.py:461 #: venv/lib/python3.7/site-packages/django/db/models/fields/files.py:231 msgid "File" msgstr "Datei" -#: konova/forms.py:450 +#: konova/forms.py:463 msgid "Allowed formats: pdf, jpg, png. Max size 15 MB." msgstr "Formate: pdf, jpg, png. Maximal 15 MB." -#: konova/forms.py:515 +#: konova/forms.py:528 msgid "Added document" msgstr "Dokument hinzugefügt" -#: konova/forms.py:572 +#: konova/forms.py:585 msgid "Confirm record" msgstr "Verzeichnen bestätigen" -#: konova/forms.py:580 +#: konova/forms.py:593 msgid "Record data" msgstr "Daten verzeichnen" -#: konova/forms.py:587 +#: konova/forms.py:600 msgid "Confirm unrecord" msgstr "Entzeichnen bestätigen" -#: konova/forms.py:588 +#: konova/forms.py:601 msgid "Unrecord data" msgstr "Daten entzeichnen" -#: konova/forms.py:589 +#: konova/forms.py:602 msgid "I, {} {}, confirm that this data must be unrecorded." msgstr "" "Ich, {} {}, bestätige, dass diese Daten wieder entzeichnet werden müssen." @@ -2059,6 +2052,18 @@ msgstr "Geometriekonflikt mit folgenden Einträgen erkannt: {}" msgid "This intervention has {} revocations" msgstr "Dem Eingriff liegen {} Widersprüche vor" +#: konova/utils/message_templates.py:86 +msgid "Checked on {} by {}" +msgstr "Am {} von {} geprüft worden" + +#: konova/utils/message_templates.py:87 +msgid "Data has changed since last check on {} by {}" +msgstr "Daten wurden nach der letzten Prüfung geändert. Letzte Prüfung am {} durch {}" + +#: konova/utils/message_templates.py:88 +msgid "Current data not checked yet" +msgstr "Momentane Daten noch nicht geprüft" + #: konova/utils/messenger.py:70 msgid "{} checked" msgstr "{} geprüft" @@ -2489,8 +2494,9 @@ msgid "" msgstr "" "\n" " Diese Daten sind noch nicht veröffentlicht und/oder haben das " -"Bestands-/Rechtskraftdatum noch nicht erreicht. Sie können daher aktuell nicht " -"eingesehen werden. Schauen Sie zu einem späteren Zeitpunkt wieder vorbei. \n" +"Bestands-/Rechtskraftdatum noch nicht erreicht. Sie können daher aktuell " +"nicht eingesehen werden. Schauen Sie zu einem späteren Zeitpunkt wieder " +"vorbei. \n" " " #: templates/table/gmrkng_col.html:6 diff --git a/user/models/user_action.py b/user/models/user_action.py index d797bb2c..198ff2fd 100644 --- a/user/models/user_action.py +++ b/user/models/user_action.py @@ -8,6 +8,7 @@ Created on: 15.11.21 import uuid from django.db import models +from django.utils.timezone import localtime from django.utils.translation import gettext_lazy as _ from konova.sub_settings.django_settings import DEFAULT_DATE_TIME_FORMAT @@ -122,3 +123,13 @@ class UserActionLogEntry(models.Model): comment=comment, ) return action + + def get_timestamp_str_formatted(self): + """ Getter for formatted timestamp string of the entry + + Returns: + val (str): The formatted timestamp as string + """ + val = self.timestamp + val = localtime(val) + return val.strftime(DEFAULT_DATE_TIME_FORMAT)