Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#1763] Change texts and table for profile page #790

Merged
merged 1 commit into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/open_inwoner/accounts/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ def get_all_files(self):

def get_interests(self) -> str:
if not self.selected_categories.exists():
return _("U heeft geen interessegebieden aangegeven.")
return _("U heeft geen interesses gekozen.")

return ", ".join(list(self.selected_categories.values_list("name", flat=True)))

Expand Down
25 changes: 4 additions & 21 deletions src/open_inwoner/accounts/tests/test_profile_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def test_get_empty_profile_page(self):
response = self.app.get(self.url, user=self.user)

self.assertEquals(response.status_code, 200)
self.assertContains(response, _("U heeft geen interessegebieden aangegeven."))
self.assertContains(response, _("U heeft geen interesses gekozen."))
self.assertContains(response, _("U heeft nog geen contacten."))
self.assertContains(response, "0 acties staan open.")
self.assertNotContains(response, reverse("products:questionnaire_list"))
Expand Down Expand Up @@ -99,23 +99,6 @@ def test_only_open_actions(self):
self.assertEquals(response.status_code, 200)
self.assertContains(response, "0 acties staan open.")

def test_get_documents_sorted(self):
"""
check that the new document is shown first
"""
doc_old = DocumentFactory.create(name="some-old", owner=self.user)
doc_new = DocumentFactory.create(name="some-new", owner=self.user)

response = self.app.get(self.url, user=self.user)
self.assertEquals(response.status_code, 200)

file_tags = response.html.find(class_="file-list").find_all(
class_="file-list__list-item"
)
self.assertEquals(len(file_tags), 2)
self.assertTrue(doc_new.name in file_tags[0].prettify())
self.assertTrue(doc_old.name in file_tags[1].prettify())

def test_mydata_shown_with_digid_and_brp(self):
user = UserFactory(
bsn="999993847",
Expand All @@ -125,7 +108,7 @@ def test_mydata_shown_with_digid_and_brp(self):
login_type=LoginTypeChoices.digid,
)
response = self.app.get(self.url, user=user)
self.assertContains(response, _("Mijn gegevens"))
self.assertContains(response, _("My details"))

def test_mydata_not_shown_with_digid_and_no_brp(self):
user = UserFactory(
Expand All @@ -136,11 +119,11 @@ def test_mydata_not_shown_with_digid_and_no_brp(self):
login_type=LoginTypeChoices.digid,
)
response = self.app.get(self.url, user=user)
self.assertNotContains(response, _("Mijn gegevens"))
self.assertNotContains(response, _("My details"))

def test_mydata_not_shown_without_digid(self):
response = self.app.get(self.url, user=self.user)
self.assertNotContains(response, _("Mijn gegevens"))
self.assertNotContains(response, _("My details"))

def test_active_user_notifications_are_shown(self):
response = self.app.get(self.url, user=self.user)
Expand Down
4 changes: 1 addition & 3 deletions src/open_inwoner/accounts/views/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ def get_context_data(self, **kwargs):
]

user_files = user.get_all_files()
if user_files:
context["anchors"].append(("#files", _("Bestanden")))

# List of names of 'mentor' users that are a contact of me
mentor_contacts = [
Expand Down Expand Up @@ -256,7 +254,7 @@ class MyNotificationsView(
def crumbs(self):
return [
(_("Mijn profiel"), reverse("profile:detail")),
(_("Communicatievoorkeuren"), reverse("profile:notifications")),
(_("Ontvang berichten over"), reverse("profile:notifications")),
]

def get_object(self):
Expand Down
4 changes: 2 additions & 2 deletions src/open_inwoner/cms/profile/cms_appconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ProfileConfig(AppHookConfig):
),
)
selected_categories = models.BooleanField(
verbose_name=_("Interessegebieden"),
verbose_name=_("Gekozen onderwerpen"),
default=True,
help_text=_(
"Designates whether 'selected categories' section is rendered or not."
Expand Down Expand Up @@ -43,7 +43,7 @@ class ProfileConfig(AppHookConfig):
),
)
notifications = models.BooleanField(
verbose_name=_("Communicatievoorkeuren"),
verbose_name=_("Mijn meldingen"),
default=True,
help_text=_("Designates whether 'notifications' section is rendered or not."),
)
Expand Down
31 changes: 31 additions & 0 deletions src/open_inwoner/cms/profile/migrations/0004_profile_texts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Generated by Django 3.2.20 on 2023-10-02 13:15

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("profile", "0003_profileconfig_ssd"),
]

operations = [
migrations.AlterField(
model_name="profileconfig",
name="notifications",
field=models.BooleanField(
default=True,
help_text="Designates whether 'notifications' section is rendered or not.",
verbose_name="Mijn meldingen",
),
),
migrations.AlterField(
model_name="profileconfig",
name="selected_categories",
field=models.BooleanField(
default=True,
help_text="Designates whether 'selected categories' section is rendered or not.",
verbose_name="Gekozen onderwerpen",
),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.personal-overview {
h2,
.h2 {
margin: var(--row-height) 0 0 0;
}
}
1 change: 1 addition & 0 deletions src/open_inwoner/scss/components/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,6 @@
@import './modal/modal';
@import './Emoji/Emoji.scss';
@import './Profile/personal-information';
@import './Profile/personal-overview';
@import './Profile/edit.scss';
@import './WarningHeader/WarningHeader.scss';
4 changes: 2 additions & 2 deletions src/open_inwoner/templates/export/profile/profile_export.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ <h1 class="h1">{{ object.get_full_name }}</h1>
{% endif %}

<tr>
<th class="table__header">{% trans "Interessegebieden" %}</th>
<th class="table__header">{% trans "Mijn onderwerpen" %}</th>
<td class="table__item">{{ object.get_interests }}</td>
</tr>
<tr>
<th class="table__header">{% trans "Communicatievoorkeuren" %}</th>
<th class="table__header">{% trans "Ontvang berichten over" %}</th>
<td class="table__item">{{ object.get_active_notifications }}</td>
</tr>
</table>
Expand Down
2 changes: 1 addition & 1 deletion src/open_inwoner/templates/pages/profile/categories.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ <h1 class="h1" id="title">
{% trans "Mijn Onderwerpen" %}
</h1>
<p class="p">
{% trans "Selecteer hier uw interessegebieden om op maat gemaakte content voorgeschoteld te krijgen en nog beter te kunnen zoeken en vinden" %}
{% trans "Selecteer hier welke onderwerpen u interesseren, om op maat gemaakte inhoud voorgeschoteld te krijgen en nog beter te kunnen zoeken en vinden" %}
</p>

{% form form_object=form method="POST" id="change-categories" submit_text=_("Opslaan") secondary_href='profile:contact_list' secondary_text=_('Terug') secondary_icon='arrow_backward' secondary_icon_position="before" extra_classes="select-grid" %}
Expand Down
32 changes: 17 additions & 15 deletions src/open_inwoner/templates/pages/profile/me.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,28 +49,34 @@ <h1 class="h1" id="title">
</div>
</div>

<h1 class="h1" id="overview">{% trans "Persoonlijk overzicht" %}</h1>

<div class="tabled tabled--flexible personal-overview">
<h2 class="h2" id="overview">{% trans "Overzicht" %}</h2>
{% if request.user.is_digid_and_brp and view.config.my_data %}
<div class="tabled__row">
<div class="tabled__item tabled__item--bold">{% trans "Mijn gegevens" %}</div>
<div class="tabled__item tabled__item--bold">{% link href="profile:categories" text=_('My details') %}</div>
<div class="tabled__item">{{request.user.get_full_name}}{% if request.user.get_address %}, {{ request.user.get_address }}{% endif %}</div>
<div class="tabled__item tabled__item--force-right tabled__item--mobile-big">{% link href="profile:data" text="Bekijken" icon="arrow_forward" icon_position="after" primary=True %}</div>
</div>
{% endif %}

{% if view.config.selected_categories %}
<div class="tabled__row">
<div class="tabled__item tabled__item--bold">{% trans "Interessegebieden" %}</div>
<div class="tabled__item tabled__item--bold">{% link href="profile:categories" text=_('My categories') %}</div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why English? Most of the texts in this template are in Dutch.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking: if I have to change some text per request from one of the municipalities, or add completely new text, the default should be in English - this could be a gradual way to change all code-text into English. I can update this me.html template to be completely English.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to know. Feel free to get started with this, but no pressure.

<div class="tabled__item">{{ category_text }}</div>
<div class="tabled__item tabled__item--force-right tabled__item--mobile-big">{% link href="profile:categories" text="Aanpassen" icon="arrow_forward" icon_position="after" secondary=True %}</div>
</div>
{% endif %}

{% if view.config.mentors %}
<div class="tabled__row">
<div class="tabled__item tabled__item--bold">{% trans "Begeleider(s)" %}</div>
<div class="tabled__item tabled__item--bold">
{% if mentor_contacts %}
{% url 'profile:contact_list' as mentor_url %}
{% link href=mentor_url|add:"?type=begeleider" text=_('My mentor(s)') %}
{% else %}
{% trans "Begeleider(s)" %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'My mentor(s)' for both?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do.

{% endif %}
</div>
{% if mentor_contacts %}
<div class="tabled__item">{{ mentor_contacts|join:", " }}</div>
{% url 'profile:contact_list' as mentor_url %}
Expand All @@ -86,45 +92,45 @@ <h1 class="h1" id="overview">{% trans "Persoonlijk overzicht" %}</h1>

{% if view.config.my_contacts %}
<div class="tabled__row">
<div class="tabled__item tabled__item--bold">{% trans "Mijn netwerkcontacten" %}</div>
<div class="tabled__item tabled__item--bold">{% link href="profile:contact_list" text=_('My contacts') %}</div>
<div class="tabled__item">{{ contact_text }}</div>
<div class="tabled__item tabled__item--force-right tabled__item--mobile-big">{% link href="profile:contact_list" text=_("Beheer contacten") icon="arrow_forward" icon_position="after" secondary=True %}</div>
</div>
{% endif %}

{% if questionnaire_exists and view.config.selfdiagnose %}
<div class="tabled__row">
<div class="tabled__item tabled__item--bold">{% trans "Zelfdiagnose" %}</div>
<div class="tabled__item tabled__item--bold">{% link href="products:questionnaire_list" text=_('Zelftest') %}</div>
<div class="tabled__item"></div>
<div class="tabled__item tabled__item--force-right tabled__item--mobile-big">{% link href='products:questionnaire_list' text=_('Start zelfdiagnose') icon="arrow_forward" icon_position="after" secondary=True %}</div>
</div>
{% endif %}

{% if view.config.actions %}
<div class="personal-overview__actions tabled__row">
<div class="tabled__item tabled__item--bold">{% trans "Acties" %}</div>
<div class="tabled__item tabled__item--bold">{% link href="profile:action_list" text=_('Actions') %}</div>
<div class="tabled__item">{{ action_text }}</div>
<div class="tabled__item tabled__item--force-right tabled__item--mobile-big">{% link href="profile:action_list" text="Aanpassen" icon="arrow_forward" icon_position="after" secondary=True %}</div>
</div>
{% endif %}

{% if view.config.notifications %}
<div class="tabled__row">
<div class="tabled__item tabled__item--bold">{% trans "Communicatievoorkeuren" %}</div>
<div class="tabled__item tabled__item--bold">{% link href="profile:notifications" text=_('Receive notifications for') %}</div>
<div class="tabled__item">{{ request.user.get_active_notifications }}</div>
<div class="tabled__item tabled__item--force-right tabled__item--mobile-big">{% link href="profile:notifications" text="Aanpassen" icon="arrow_forward" icon_position="after" secondary=True %}</div>
</div>
{% endif %}
{% if view.config.questions %}
<div class="tabled__row">
<div class="tabled__item tabled__item--bold">{% trans "Mijn vragen" %}</div>
<div class="tabled__item tabled__item--bold">{% link href="cases:contactmoment_list" text=_('My questions') %}</div>
<div class="tabled__item"></div>
<div class="tabled__item tabled__item--force-right tabled__item--mobile-big">{% link href="cases:contactmoment_list" text=_('Bekijken') icon="arrow_forward" icon_position="after" secondary=True %}</div>
</div>
{% endif %}
{% if view.config.ssd %}
<div class="tabled__row">
<div class="tabled__item tabled__item--bold">{% trans "Mijn uitkeringen" %}</div>
<div class="tabled__item tabled__item--bold">{% link href="profile:monthly_benefits_index" text=_('My benefits') %}</div>
<div class="tabled__item">Jaaropgaven, Maandspecificaties</div>
<div class="tabled__item tabled__item--force-right tabled__item--mobile-big">{% link href="ssd:monthly_benefits_index" text=_("Bekijken") icon="arrow_forward" icon_position="after" secondary=True %}</div>
</div>
Expand All @@ -146,8 +152,4 @@ <h1 class="h1" id="overview">{% trans "Persoonlijk overzicht" %}</h1>
</div>
{% endrender_form %}

{% if files %}
{% file_list h1=True files=files allow_delete=True title=_("Bestanden") download_view="profile:documents_download" %}
{% endif %}

{% endblock content %}
4 changes: 2 additions & 2 deletions src/open_inwoner/templates/pages/profile/notifications.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

{% block content %}
<h1 class="h1" id="title">
{% trans "Communicatievoorkeuren" %}
{% trans "Ontvang berichten over" %}
</h1>
<p class="p">
{% trans "Kies voor welke categorie je communicatievoorkeuren wil ontvangen" %}
{% trans "Kies voor welk onderwerp je meldingen wilt ontvangen" %}
</p>

{% form form_object=form method="POST" id="change-notifications" submit_text=_("Opslaan") secondary_href='profile:detail' secondary_text=_('Terug') secondary_icon='arrow_backward' secondary_icon_position="before" %}
Expand Down
Loading