From 6d83406aecd9be6b9a976c483eb81b7c453dd43b Mon Sep 17 00:00:00 2001 From: Tobias Bengfort Date: Tue, 14 Sep 2021 16:23:58 +0200 Subject: [PATCH 1/3] change "guardian" to "legal representative" in UI --- castellum/contacts/forms.py | 4 ++-- .../migrations/0010_alter_contact_guardians.py | 18 ++++++++++++++++++ castellum/contacts/models.py | 5 ++++- .../contacts/templates/contacts/__contact.html | 2 +- .../templates/contacts/__contact_detail.html | 4 ++-- .../templates/contacts/__guardian_item.html | 2 +- .../templates/contacts/contact_form.html | 8 ++++---- .../templates/recruitment/contact.html | 2 +- .../migrations/0023_subject_blocked.py | 2 +- castellum/subjects/models.py | 4 ++-- .../templates/subjects/guardian_search.html | 6 +++--- .../subjects/subject_confirm_delete.html | 2 +- .../templates/subjects/subject_detail.html | 6 +++--- .../templates/subjects/subject_export.html | 2 +- tests/contacts/forms/test_contact_form.py | 2 +- 15 files changed, 45 insertions(+), 24 deletions(-) create mode 100644 castellum/contacts/migrations/0010_alter_contact_guardians.py diff --git a/castellum/contacts/forms.py b/castellum/contacts/forms.py index 0947b0c79..579395684 100644 --- a/castellum/contacts/forms.py +++ b/castellum/contacts/forms.py @@ -63,7 +63,7 @@ class AddressForm(forms.ModelForm): class ContactForm(forms.ModelForm): guardians_pane = forms.ChoiceField(required=False, choices=[ ('self', _('Full of age')), - ('guardians', _('Has legal guardian')), + ('guardians', _('Has legal representative')), ], widget=forms.RadioSelect) class Meta: @@ -155,7 +155,7 @@ class ContactForm(forms.ModelForm): age = datetime.date.today() - date_of_birth if not is_guardians_pane and age.days // 365 < settings.CASTELLUM_FULL_AGE: msg = _( - 'Subjects under the age of {} need a legal guardian.' + 'Subjects under the age of {} need a legal representative.' ).format(settings.CASTELLUM_FULL_AGE) raise ValidationError(msg, code='invalid') diff --git a/castellum/contacts/migrations/0010_alter_contact_guardians.py b/castellum/contacts/migrations/0010_alter_contact_guardians.py new file mode 100644 index 000000000..a401b412e --- /dev/null +++ b/castellum/contacts/migrations/0010_alter_contact_guardians.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.7 on 2021-09-14 14:24 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('contacts', '0009_phonetic_diacritics'), + ] + + operations = [ + migrations.AlterField( + model_name='contact', + name='guardians', + field=models.ManyToManyField(blank=True, related_name='guardian_of', to='contacts.Contact', verbose_name='Legal representatives'), + ), + ] diff --git a/castellum/contacts/models.py b/castellum/contacts/models.py index be67c65fc..08510e56e 100644 --- a/castellum/contacts/models.py +++ b/castellum/contacts/models.py @@ -158,7 +158,10 @@ class Contact(TimeStampedModel): ) guardians = models.ManyToManyField( - 'contacts.Contact', verbose_name=_('Guardians'), related_name='guardian_of', blank=True + 'contacts.Contact', + verbose_name=_('Legal representatives'), + related_name='guardian_of', + blank=True, ) objects = ContactQuerySet.as_manager() diff --git a/castellum/contacts/templates/contacts/__contact.html b/castellum/contacts/templates/contacts/__contact.html index 23fc2a0ff..4fc105afc 100644 --- a/castellum/contacts/templates/contacts/__contact.html +++ b/castellum/contacts/templates/contacts/__contact.html @@ -29,7 +29,7 @@ {% include 'contacts/__contact_detail.html' with contact=guardian guardian=True %} {% else %}
-
{% translate 'Legal guardian' %}
+
{% translate 'Legal representative' %}
{% translate 'Insufficient privacy level' %}
{% endif %} diff --git a/castellum/contacts/templates/contacts/__contact_detail.html b/castellum/contacts/templates/contacts/__contact_detail.html index 5a0180aec..ddc0cbb09 100644 --- a/castellum/contacts/templates/contacts/__contact_detail.html +++ b/castellum/contacts/templates/contacts/__contact_detail.html @@ -4,11 +4,11 @@
{% if guardian %} -
{% translate 'Legal guardian' %}
+
{% translate 'Legal representative' %}
{{ 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.') %} + {% icon 'users' label=_('This legal representative has other wards who may also be suitable for this study.') %} {% endif %}
{% endif %} diff --git a/castellum/contacts/templates/contacts/__guardian_item.html b/castellum/contacts/templates/contacts/__guardian_item.html index 82fbd160a..9fafb83b6 100644 --- a/castellum/contacts/templates/contacts/__guardian_item.html +++ b/castellum/contacts/templates/contacts/__guardian_item.html @@ -2,7 +2,7 @@
-
{% translate 'Guardian' %}
+
{% translate 'Legal representative' %}
{% if name == 'guardians_remove' %} diff --git a/castellum/contacts/templates/contacts/contact_form.html b/castellum/contacts/templates/contacts/contact_form.html index d0856e847..05946a89e 100644 --- a/castellum/contacts/templates/contacts/contact_form.html +++ b/castellum/contacts/templates/contacts/contact_form.html @@ -15,7 +15,7 @@ {% include 'utils/form_errors.html' with form=form %} {% if not object.is_complete %} - + {% endif %} {% csrf_token %} @@ -31,7 +31,7 @@
{% if form.guardians_blocked > 0 %}

- {% blocktranslate with count=form.guardians_blocked %}{{ count }} guardians not listed because of insufficient privacy level.{% endblocktranslate %} + {% blocktranslate with count=form.guardians_blocked %}{{ count }} legal representatives not listed because of insufficient privacy level.{% endblocktranslate %}

{% endif %} @@ -49,13 +49,13 @@ {% include 'contacts/__guardian_item.html' with name=form.guardians_add.name pk=subject.pk label=subject label=subject.contact.full_name removed=False %} {% endfor %} - + {% else %} {% has_perm 'subjects.view_subject' user as can_view_subject %} {% for subject_id, contact in form.guardians %}
-
{% translate 'Guardian' %}
+
{% translate 'Legal representative' %}
{{ contact }}
diff --git a/castellum/recruitment/templates/recruitment/contact.html b/castellum/recruitment/templates/recruitment/contact.html index d86d94ed9..ba17cb072 100644 --- a/castellum/recruitment/templates/recruitment/contact.html +++ b/castellum/recruitment/templates/recruitment/contact.html @@ -16,7 +16,7 @@ {% endif %} {% if subject.contact.has_guardian and study.geo_filter %} {% endif %} {% endif %} diff --git a/castellum/subjects/migrations/0023_subject_blocked.py b/castellum/subjects/migrations/0023_subject_blocked.py index 37b1c136f..5e1ce543e 100644 --- a/castellum/subjects/migrations/0023_subject_blocked.py +++ b/castellum/subjects/migrations/0023_subject_blocked.py @@ -13,6 +13,6 @@ class Migration(migrations.Migration): migrations.AddField( model_name='subject', name='blocked', - field=models.BooleanField(default=False, help_text='The subject has been blocked due to inappropriate behaviour. They will neither be considered for recruitment, nor contacted as guardians. Blocking this subject does not automatically block their ward nor their co-guardians. They may thus still receive information about the recruitment process of their wards.', verbose_name='Subject is blocked'), + field=models.BooleanField(default=False, help_text='The subject has been blocked due to inappropriate behaviour. They will neither be considered for recruitment, nor contacted as a legal representative. Blocking this subject does not automatically block their ward nor their co-representatives. They may thus still receive information about the recruitment process of their wards.', verbose_name='Subject is blocked'), ), ] diff --git a/castellum/subjects/models.py b/castellum/subjects/models.py index 896dadfea..06b8a885a 100644 --- a/castellum/subjects/models.py +++ b/castellum/subjects/models.py @@ -88,9 +88,9 @@ class Subject(TimeStampedModel): blocked = models.BooleanField(_('Subject is blocked'), default=False, help_text=_( 'The subject has been blocked due to inappropriate behaviour. ' - 'They will neither be considered for recruitment, nor contacted as guardians. ' + 'They will neither be considered for recruitment, nor contacted as a legal representative. ' 'Blocking this subject does not automatically block their ward nor their ' - 'co-guardians. They may thus still receive information about the recruitment ' + 'co-representatives. They may thus still receive information about the recruitment ' 'process of their wards.' )) diff --git a/castellum/subjects/templates/subjects/guardian_search.html b/castellum/subjects/templates/subjects/guardian_search.html index b0fb97e17..e25f80aa3 100644 --- a/castellum/subjects/templates/subjects/guardian_search.html +++ b/castellum/subjects/templates/subjects/guardian_search.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% load i18n static bootstrap4 auth utils %} -{% block title %}{% translate "Guardians" %} · {{ block.super }}{% endblock %} +{% block title %}{% translate "Legal representatives" %} · {{ block.super }}{% endblock %} {% block content %}

{% translate 'Total number of subjects' %}: {{ count_total }}

@@ -81,9 +81,9 @@
{% if can_access %} - + {% else %} - + {% endif %}
diff --git a/castellum/subjects/templates/subjects/subject_confirm_delete.html b/castellum/subjects/templates/subjects/subject_confirm_delete.html index 6253ae391..f213fee74 100644 --- a/castellum/subjects/templates/subjects/subject_confirm_delete.html +++ b/castellum/subjects/templates/subjects/subject_confirm_delete.html @@ -9,7 +9,7 @@ {% if is_last_guardian %}

- {% translate "This subject is the only guardian of another subject. Deletion means that this subject's ward becomes unreachable!" %} + {% translate "This subject is the only legal representative of another subject. Deletion means that this subject's ward becomes unreachable!" %}

{% endif %} diff --git a/castellum/subjects/templates/subjects/subject_detail.html b/castellum/subjects/templates/subjects/subject_detail.html index a40e63df1..a0321cefd 100644 --- a/castellum/subjects/templates/subjects/subject_detail.html +++ b/castellum/subjects/templates/subjects/subject_detail.html @@ -26,7 +26,7 @@ {% endif %} {% if subject.contact.guardian_of.exists %} -
{% translate 'Guardian of' %}
+
{% translate 'Legal representative of' %}
{% for c in subject.contact.guardian_of.all %} {% has_privacy_level c.subject.privacy_level user as can_access %} @@ -94,7 +94,7 @@
- {% translate 'Guardianship' %} + {% translate 'Legal representative' %} {% translate 'Art. 6 (1) lit. a, Art. 9 (2) lit. a GDPR and Art. 1626, 1902 BGB' %}
@@ -102,7 +102,7 @@ {{ subject.contact|display:'is_guardian' }} {% else %} {% url 'subjects:index' as url %} - {% blocktranslate with url=url %}If applicable, find or create a subject and set this one as their guardian.{% endblocktranslate %} + {% blocktranslate with url=url %}If applicable, find or create a subject and set this one as their legal representative.{% endblocktranslate %} {% endif %}
diff --git a/castellum/subjects/templates/subjects/subject_export.html b/castellum/subjects/templates/subjects/subject_export.html index f35e2a0b8..cc0088a15 100644 --- a/castellum/subjects/templates/subjects/subject_export.html +++ b/castellum/subjects/templates/subjects/subject_export.html @@ -112,7 +112,7 @@
{{ subject.contact|verbose_name:'guardians' }}
{{ subject.contact|display:'guardians' }}
-
{% translate 'Guardian of' %}
+
{% translate 'Legal representative of' %}
{{ subject.contact|display:'guardian_of' }}
diff --git a/tests/contacts/forms/test_contact_form.py b/tests/contacts/forms/test_contact_form.py index f862023b7..403800c75 100644 --- a/tests/contacts/forms/test_contact_form.py +++ b/tests/contacts/forms/test_contact_form.py @@ -284,7 +284,7 @@ def test_contact_form_with_guardians_remove(user, full_data, contact): @pytest.mark.django_db def test_contact_form_underage_without_guardian(user, full_data): - msg = 'Subjects under the age of 16 need a legal guardian.' + msg = 'Subjects under the age of 16 need a legal representative.' full_data.update({ 'date_of_birth': '{}-01-01'.format(datetime.date.today().year), }) -- GitLab From ada2a127806fc6545d7e47420190d62667ea4ff7 Mon Sep 17 00:00:00 2001 From: Tobias Bengfort Date: Tue, 14 Sep 2021 16:33:19 +0200 Subject: [PATCH 2/3] avoid the word "ward" --- castellum/contacts/templates/contacts/__contact_detail.html | 2 +- castellum/subjects/migrations/0023_subject_blocked.py | 2 +- castellum/subjects/models.py | 6 +++--- .../subjects/templates/subjects/subject_confirm_delete.html | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/castellum/contacts/templates/contacts/__contact_detail.html b/castellum/contacts/templates/contacts/__contact_detail.html index ddc0cbb09..abc58013a 100644 --- a/castellum/contacts/templates/contacts/__contact_detail.html +++ b/castellum/contacts/templates/contacts/__contact_detail.html @@ -8,7 +8,7 @@
{{ contact.full_name }} {% if contact.guardian_of.count > 1 %} - {% icon 'users' label=_('This legal representative has other wards who may also be suitable for this study.') %} + {% icon 'users' label=_('This person represents other subjects who may also be suitable for this study.') %} {% endif %}
{% endif %} diff --git a/castellum/subjects/migrations/0023_subject_blocked.py b/castellum/subjects/migrations/0023_subject_blocked.py index 5e1ce543e..9cb3ab32e 100644 --- a/castellum/subjects/migrations/0023_subject_blocked.py +++ b/castellum/subjects/migrations/0023_subject_blocked.py @@ -13,6 +13,6 @@ class Migration(migrations.Migration): migrations.AddField( model_name='subject', name='blocked', - field=models.BooleanField(default=False, help_text='The subject has been blocked due to inappropriate behaviour. They will neither be considered for recruitment, nor contacted as a legal representative. Blocking this subject does not automatically block their ward nor their co-representatives. They may thus still receive information about the recruitment process of their wards.', verbose_name='Subject is blocked'), + field=models.BooleanField(default=False, help_text='The person has been blocked due to inappropriate behaviour. They will neither be considered for recruitment, nor contacted as a legal representative. Blocking this person does not automatically block any represented subjects nor co-representatives. They may thus still receive information about the recruitment process.', verbose_name='Subject is blocked'), ), ] diff --git a/castellum/subjects/models.py b/castellum/subjects/models.py index 06b8a885a..345612275 100644 --- a/castellum/subjects/models.py +++ b/castellum/subjects/models.py @@ -87,11 +87,11 @@ class Subject(TimeStampedModel): deceased = models.BooleanField(_('Subject is deceased'), default=False) blocked = models.BooleanField(_('Subject is blocked'), default=False, help_text=_( - 'The subject has been blocked due to inappropriate behaviour. ' + 'The person has been blocked due to inappropriate behaviour. ' 'They will neither be considered for recruitment, nor contacted as a legal representative. ' - 'Blocking this subject does not automatically block their ward nor their ' + 'Blocking this person does not automatically block any represented subjects nor ' 'co-representatives. They may thus still receive information about the recruitment ' - 'process of their wards.' + 'process.' )) source = models.CharField(_('Data source'), max_length=128, blank=True) diff --git a/castellum/subjects/templates/subjects/subject_confirm_delete.html b/castellum/subjects/templates/subjects/subject_confirm_delete.html index f213fee74..a8a8daecb 100644 --- a/castellum/subjects/templates/subjects/subject_confirm_delete.html +++ b/castellum/subjects/templates/subjects/subject_confirm_delete.html @@ -9,7 +9,7 @@ {% if is_last_guardian %}

- {% translate "This subject is the only legal representative of another subject. Deletion means that this subject's ward becomes unreachable!" %} + {% translate "This person is the only legal representative of another subject. Deletion means that this subject becomes unreachable!" %}

{% endif %} -- GitLab From 5785963200c87f260fd175a141cdfdf9b34482e3 Mon Sep 17 00:00:00 2001 From: Tobias Bengfort Date: Wed, 22 Sep 2021 17:57:16 +0200 Subject: [PATCH 3/3] more specific person/subject wording --- .../subjects/templates/subjects/subject_confirm_delete.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/castellum/subjects/templates/subjects/subject_confirm_delete.html b/castellum/subjects/templates/subjects/subject_confirm_delete.html index a8a8daecb..6dd4f2ec2 100644 --- a/castellum/subjects/templates/subjects/subject_confirm_delete.html +++ b/castellum/subjects/templates/subjects/subject_confirm_delete.html @@ -9,7 +9,7 @@ {% if is_last_guardian %}

- {% translate "This person is the only legal representative of another subject. Deletion means that this subject becomes unreachable!" %} + {% translate "This person is the only legal representative of another subject. Deletion means that the subject represented by this person becomes unreachable!" %}

{% endif %} -- GitLab