From 647480166a5b78a75f95459cd5935813ef2a1d65 Mon Sep 17 00:00:00 2001 From: Serghei Mihai Date: Wed, 24 Oct 2018 12:10:14 +0200 Subject: [PATCH] templates: add option to hide receiver from form history (#27119) --- wcs/forms/common.py | 3 ++- wcs/templates/wcs/formdata_history.html | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/wcs/forms/common.py b/wcs/forms/common.py index 78a36d3a..73c5491a 100644 --- a/wcs/forms/common.py +++ b/wcs/forms/common.py @@ -272,9 +272,10 @@ class FormStatusPage(Directory, FormTemplateMixin): if not self.formdef.is_user_allowed_read_status_and_history(get_request().user, self.filled): return + hide_receiver = get_publisher().get_site_option('hide_receiver_in_form_history', 'variables') return template.render( list(self.get_formdef_template_variants(self.history_templates)), - {'formdata': self.filled}) + {'formdata': self.filled, 'hide_receiver': hide_receiver}) def check_receiver(self): session = get_session() diff --git a/wcs/templates/wcs/formdata_history.html b/wcs/templates/wcs/formdata_history.html index 58f6c594..5dfcd6a9 100644 --- a/wcs/templates/wcs/formdata_history.html +++ b/wcs/templates/wcs/formdata_history.html @@ -22,10 +22,13 @@ {% endif %}
{% if evolution.who %} + {% if evolution.who != '_submitter' and hide_receiver %} + {% else %} {{evolution.get_author_name|default_if_none:""}} {% if evolution.get_author_qualification %}({{evolution.get_author_qualification}}){% endif %} {% endif %} + {% endif %} {% if not evolution.status %} {{evolution.datetime}} {% endif %} -- 2.19.1