diff --git a/src/registrar/templates/includes/summary_item.html b/src/registrar/templates/includes/summary_item.html index 057423488..7819d95c1 100644 --- a/src/registrar/templates/includes/summary_item.html +++ b/src/registrar/templates/includes/summary_item.html @@ -1,7 +1,9 @@ {% load static url_helpers %} -{% if portfolio_first_section %}
-{% else %}
+{% if portfolio_first_section %} +
+{% else %} +
{% endif %}
@@ -20,120 +22,137 @@ {% else %} {% endif %} - {% if sub_header_text %} -

{{ sub_header_text }}

+ + {# To display default styling for sub-header text and organization information in organization overview #} + {% if sub_header_text %} +

{{ sub_header_text }}

+ {% if sub_header_text == "Organization Admins" %} +
    + {% for admin in portfolio_admins %} +
  • {{ admin.get_full_name|default:admin.username }}
  • + {% empty %} +
  • No admins assigned.
  • + {% endfor %} +
+

Organization Name and Address

{% endif %} - {% if permissions %} - {% include "includes/member_permissions_summary.html" with permissions=value %} - {% elif domain_mgmt %} - {% include "includes/member_domain_management.html" with domain_count=value %} - {% elif address %} - {% include "includes/organization_address.html" with organization=value %} - {% elif contact %} - {% if list %} - {% if value|length == 1 %} - {% include "includes/contact.html" with contact=value|first %} + {% endif %} + + {% if permissions %} + {% include "includes/member_permissions_summary.html" with permissions=value %} + + {% elif domain_mgmt %} + {% include "includes/member_domain_management.html" with domain_count=value %} + + {% elif address %} + {% include "includes/organization_address.html" with organization=value %} + + {% elif contact %} + {% if list %} + {% if value|length == 1 %} + {% include "includes/contact.html" with contact=value|first %} + {% else %} + {% if value %} +
+ {% for item in value %} +
+

+ Contact {{forloop.counter}} +

+
+
+ {% include "includes/contact.html" with contact=item %} +
+ {% endfor %} +
+ {% elif custom_text_for_value_none %} +

+ {{ custom_text_for_value_none }} +

{% else %} - {% if value %} -
- {% for item in value %} -
- -

- Contact {{forloop.counter}} -

-
-
- {% include "includes/contact.html" with contact=item %} -
- {% endfor %} -
- {% elif custom_text_for_value_none %} -

- {{ custom_text_for_value_none }} -

- {% else %} -

- None -

- {% endif %} +

+ None +

+ {% endif %} + {% endif %} + {% else %} + {% include "includes/contact.html" with contact=value %} + {% endif %} + + {% elif list %} + {% if value|length == 1 %} + {% if users %} +

{{ value.0.user.email }}

+ {% elif domains %} + {{ value.0.0 }} + {% if value.0.1 %} + ({% spaceless %} + {% for addr in value.0.1 %} + {{addr}}{% if not forloop.last %}, {% endif %} + {% endfor %} + {% endspaceless %}) {% endif %} {% else %} - {% include "includes/contact.html" with contact=value %} +

{{ value | first }}

{% endif %} - {% elif list %} - {% if value|length == 1 %} - {% if users %} -

{{ value.0.user.email }}

- {% elif domains %} - {{ value.0.0 }} - {% if value.0.1 %} + {% else %} +
    + {% for item in value %} + {% if users %} +
  • {{ item.user.email }}
  • + {% elif domains %} +
  • + {{ item.0 }} + {% if item.1 %} ({% spaceless %} - {% for addr in value.0.1 %} + {% for addr in item.1 %} {{addr}}{% if not forloop.last %}, {% endif %} {% endfor %} {% endspaceless %}) {% endif %} - {% else %} -

    {{ value | first }}

    - {% endif %} +
  • + {% else %} +
  • {{ item }}
  • + {% endif %} + {% empty %} +
  • None
  • + {% endfor %} +
+ {% endif %} + + {% elif domain_permissions %} + {% if value.permissions.all %} + {% if value.permissions|length == 1 %} +

{{ value.permissions.0.user.email }}

{% else %}
    - {% for item in value %} - {% if users %} -
  • {{ item.user.email }}
  • - {% elif domains %} -
  • - {{ item.0 }} - {% if item.1 %} - ({% spaceless %} - {% for addr in item.1 %} - {{addr}}{% if not forloop.last %}, {% endif %} - {% endfor %} - {% endspaceless %}) - {% endif %} -
  • - {% else %} -
  • {{ item }}
  • - {% endif %} - {% empty %} -
  • None
  • - {% endfor %} -
- {% endif %} - {% elif domain_permissions %} - {% if value.permissions.all %} - {% if value.permissions|length == 1 %} -

{{ value.permissions.0.user.email }}

- {% else %} -
    - {% for item in value.permissions.all %} -
  • {{ item.user.email }}
  • - {% endfor %} -
- {% endif %} - {% endif %} - {% if value.active_invitations.all %} -

Invited domain managers

-
    - {% for item in value.active_invitations.all %} -
  • {{ item.email }}
  • + {% for item in value.permissions.all %} +
  • {{ item.user.email }}
  • {% endfor %}
{% endif %} - {% else %} - {% if custom_text_for_value_none %} -

{{ custom_text_for_value_none }}

- {% endif %} - {% if value %} - {{ value }} - {% endif %} - {% if not value %} - None - {% endif %} {% endif %} + + {% if value.active_invitations.all %} +

Invited domain managers

+
    + {% for item in value.active_invitations.all %} +
  • {{ item.email }}
  • + {% endfor %} +
+ {% endif %} + + {% else %} + {% if custom_text_for_value_none %} +

{{ custom_text_for_value_none }}

+ {% endif %} + {% if value %} + {{ value }} + {% endif %} + {% if not value %} + None + {% endif %} + {% endif %}
{% comment %}We have conditions where an edit_link is set but editable can be true or false{% endcomment %} @@ -159,6 +178,5 @@ {% endif %} {% endif %} - - +
diff --git a/src/registrar/templates/portfolio_organization.html b/src/registrar/templates/portfolio_organization.html index eaca5767e..fccb4836b 100644 --- a/src/registrar/templates/portfolio_organization.html +++ b/src/registrar/templates/portfolio_organization.html @@ -20,8 +20,8 @@

{{ portfolio }}

{% url 'organization-info' as url %} - {% include "includes/summary_item.html" with title='Organization' value=portfolio address='true' edit_link=url editable=has_edit_portfolio_permission view_button='true' portfolio_first_section='true'%} - + {% include "includes/summary_item.html" with title='Organization' value=portfolio address='true' sub_header_text='Organization Admins' edit_link=url editable=has_edit_portfolio_permission view_button='true' portfolio_first_section='true' %} + {% url 'organization-senior-official' as url %} {% include "includes/summary_item.html" with title='Senior official' value=portfolio.senior_official contact='true' edit_link=url view_button='true' %}
diff --git a/src/registrar/tests/test_views_portfolio.py b/src/registrar/tests/test_views_portfolio.py index 08e14bdfd..7bd225f76 100644 --- a/src/registrar/tests/test_views_portfolio.py +++ b/src/registrar/tests/test_views_portfolio.py @@ -212,6 +212,13 @@ class TestPortfolio(WebTest): first_name="Saturn", last_name="Enceladus", title="Planet/Moon", email="spacedivision@igorville.com" ) + portfolio_admin = User.objects.create_user( + username="adminuser", first_name="Galileo", last_name="Galilei", email="admin@example.com" + ) + UserPortfolioPermission.objects.create( + user=portfolio_admin, portfolio=self.portfolio, roles=[UserPortfolioRoleChoices.ORGANIZATION_ADMIN] + ) + self.portfolio.senior_official = so self.portfolio.organization_name = "Hotel California" self.portfolio.city = "Los Angeles" @@ -227,6 +234,8 @@ class TestPortfolio(WebTest): # Organization overview page includes organization info and senior official details self.assertContains(response, "Los Angeles") self.assertContains(response, "spacedivision@igorville.com") + # Organization overview page includes portfolio admin + self.assertContains(response, "Galileo") @less_console_noise_decorator def test_portfolio_organization_page_directs_to_org_detail_forms(self): diff --git a/src/registrar/views/portfolios.py b/src/registrar/views/portfolios.py index 9c22853e2..e028ee199 100644 --- a/src/registrar/views/portfolios.py +++ b/src/registrar/views/portfolios.py @@ -904,6 +904,7 @@ class PortfolioOrganizationView(DetailView): context = super().get_context_data(**kwargs) portfolio = self.request.session.get("portfolio") context["has_edit_portfolio_permission"] = self.request.user.has_edit_portfolio_permission(portfolio) + context["portfolio_admins"] = portfolio.portfolio_admin_users return context def get_object(self, queryset=None):