From a868f4509538d185c4532c2c7cd4996bd4f9df2a Mon Sep 17 00:00:00 2001 From: Tobias Bengfort Date: Wed, 15 Sep 2021 11:58:02 +0200 Subject: [PATCH 1/3] show not_available_until if it should have been set on guardians see https://git.mpib-berlin.mpg.de/castellum/castellum/-/merge_requests/2038#note_22451 --- castellum/contacts/templates/contacts/__contact.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/castellum/contacts/templates/contacts/__contact.html b/castellum/contacts/templates/contacts/__contact.html index fb82f124b..8185e9e73 100644 --- a/castellum/contacts/templates/contacts/__contact.html +++ b/castellum/contacts/templates/contacts/__contact.html @@ -32,4 +32,16 @@ {% if summary %}({{ summary }}){% endif %} {% endwith %} + + {# also show not_available_until if it should have been set on guardians #} + {% if not subject.is_available and subject.contact.guardians.exists %} +
{% translate "Currently available" %}
+
+ {% translate "No" %} + {% icon 'phone' %} + {% blocktranslate with next_available=subject.not_available_until %} + (not until {{ next_available }}) + {% endblocktranslate %} +
+ {% endif %} -- GitLab From 498f273d90e2fa4bdda80c3b98a2663a30e40dc5 Mon Sep 17 00:00:00 2001 From: Tobias Bengfort Date: Wed, 15 Sep 2021 15:32:30 +0200 Subject: [PATCH 2/3] add contact data heading --- castellum/contacts/templates/contacts/__contact.html | 11 +---------- .../templates/contacts/__contact_detail.html | 12 ++++++++++++ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/castellum/contacts/templates/contacts/__contact.html b/castellum/contacts/templates/contacts/__contact.html index 8185e9e73..56ca00ed4 100644 --- a/castellum/contacts/templates/contacts/__contact.html +++ b/castellum/contacts/templates/contacts/__contact.html @@ -3,16 +3,7 @@ {% for guardian in subject.contact.guardians.all %} {% has_privacy_level guardian.subject.privacy_level user as can_access %} {% if can_access %} -
-
{% translate 'Legal guardian' %}
-
- {{ guardian.full_name }} - {% if guardian.guardian_of.count > 1 %} - {% icon 'users' label=_('This guardian has other wards who may also be suitable for this study.') %} - {% endif %} -
-
- {% include 'contacts/__contact_detail.html' with contact=guardian %} + {% include 'contacts/__contact_detail.html' with contact=guardian guardian=True %} {% else %}
{% translate 'Legal guardian' %}
diff --git a/castellum/contacts/templates/contacts/__contact_detail.html b/castellum/contacts/templates/contacts/__contact_detail.html index a2c6a98e7..2799289a3 100644 --- a/castellum/contacts/templates/contacts/__contact_detail.html +++ b/castellum/contacts/templates/contacts/__contact_detail.html @@ -1,6 +1,18 @@ {% load i18n utils %} +

{% translate 'Contact data' %}

+
+ {% if guardian %} +
{% translate 'Legal guardian' %}
+
+ {{ contact.full_name }} + {% if contact.guardian_of.count > 1 %} + {% icon 'users' label=_('This guardian has other wards who may also be suitable for this study.') %} + {% endif %} +
+ {% endif %} +
{{ contact|verbose_name:'email' }}
{{ contact|display:'email' }} -- GitLab From 0d253c40ceef198cd3ec50c87c4239237e6c977c Mon Sep 17 00:00:00 2001 From: Tobias Bengfort Date: Wed, 15 Sep 2021 15:33:29 +0200 Subject: [PATCH 3/3] mv ward info to top --- .../templates/contacts/__contact.html | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/castellum/contacts/templates/contacts/__contact.html b/castellum/contacts/templates/contacts/__contact.html index 56ca00ed4..23fc2a0ff 100644 --- a/castellum/contacts/templates/contacts/__contact.html +++ b/castellum/contacts/templates/contacts/__contact.html @@ -1,20 +1,5 @@ {% load i18n auth utils reliability %} -{% for guardian in subject.contact.guardians.all %} - {% has_privacy_level guardian.subject.privacy_level user as can_access %} - {% if can_access %} - {% include 'contacts/__contact_detail.html' with contact=guardian guardian=True %} - {% else %} -
-
{% translate 'Legal guardian' %}
-
{% translate 'Insufficient privacy level' %}
-
- {% endif %} -
-{% empty %} - {% include 'contacts/__contact_detail.html' with contact=subject.contact %} -{% endfor %} -
{% translate "Reliability" %}
@@ -36,3 +21,18 @@
{% endif %}
+ +{% for guardian in subject.contact.guardians.all %} +
+ {% has_privacy_level guardian.subject.privacy_level user as can_access %} + {% if can_access %} + {% include 'contacts/__contact_detail.html' with contact=guardian guardian=True %} + {% else %} +
+
{% translate 'Legal guardian' %}
+
{% translate 'Insufficient privacy level' %}
+
+ {% endif %} +{% empty %} + {% include 'contacts/__contact_detail.html' with contact=subject.contact %} +{% endfor %} -- GitLab