From 16808f7ccb084f847d7f61c730f29152feaa0229 Mon Sep 17 00:00:00 2001 From: Cameron Lamb Date: Thu, 12 Dec 2024 09:53:32 +0000 Subject: [PATCH] INTR-481 Show profile tabs even when there is no data to show (#841) --- .../templates/peoplefinder/profile.html | 43 +++++++++---------- src/peoplefinder/views/profile.py | 1 - 2 files changed, 21 insertions(+), 23 deletions(-) diff --git a/src/peoplefinder/templates/peoplefinder/profile.html b/src/peoplefinder/templates/peoplefinder/profile.html index da2443d26..3c09d64f7 100644 --- a/src/peoplefinder/templates/peoplefinder/profile.html +++ b/src/peoplefinder/templates/peoplefinder/profile.html @@ -144,28 +144,27 @@

{{ profile.full_name }}

- {% if is_users_profile or current_tab.values %} -
- {% for profile_section_dict in profile_section_dicts %} - {{ profile_section_dict.title }} - {% endfor %} -
- -
-

{{ current_tab.title }}

- {% if current_tab.values %} -
- {% for value in current_tab.values %} -
{{ value.1 }}
-
- {{ value.2 }} -
- {% endfor %} -
- {% endif %} -
- {% endif %} +
+ {% for profile_section_dict in profile_section_dicts %} + {{ profile_section_dict.title }} + {% endfor %} +
+
+

{{ current_tab.title }}

+ {% if current_tab.values %} +
+ {% for value in current_tab.values %} +
{{ value.1 }}
+
+ {{ value.2 }} +
+ {% endfor %} +
+ {% else %} +

{{ profile.first_name }} hasn't listed any {{ current_tab.title|lower }}.

+ {% endif %} +
diff --git a/src/peoplefinder/views/profile.py b/src/peoplefinder/views/profile.py index 6a55124b3..132f3c5c2 100644 --- a/src/peoplefinder/views/profile.py +++ b/src/peoplefinder/views/profile.py @@ -117,7 +117,6 @@ def get_context_data(self, **kwargs: dict) -> dict: profile = context["profile"] roles = profile.roles.select_related("team").all() - context["is_users_profile"] = bool(self.request.user == profile.user) context["roles"] = roles context["title"] = profile.full_name