Skip to content

[DRAFT] - #3866 - Add Organization admins to the Organization overview page - [meoward] #3928

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

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
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
76 changes: 76 additions & 0 deletions src/registrar/templates/includes/summary_item_organization.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{% load static url_helpers %}

{% if portfolio_first_section %} <section class="summary-item margin-top-2">
{% else %} <section class="summary-item margin-top-3">
{% endif %}
<hr class="" aria-hidden="true" />
<div class="display-flex flex-justify">
<div>
{% if heading_level %}
<{{ heading_level }}
{% else %}
<h3
{% endif %}
class="margin-top-0 margin-bottom-05
padding-right-1"
>
{{ title }}
{% if heading_level %}
</{{ heading_level }}>
{% else %}
</h3>
{% endif %}

{% if sub_header_text %}
<h4 class="margin-bottom-0">{{ sub_header_text }}</h4>
{% endif %}

<ul class="usa-list">
{% for admin in portfolio_admins %}
<li>{{ admin.get_full_name|default:admin.username }}</li>
{% empty %}
<li>No admins assigned.</li>
{% endfor %}
</ul>
{% if address %}
<h4 class="margin-bottom-2">Organization Name and Address</h4>
{% include "includes/organization_address.html" with organization=value %}
{% else %}
{% if custom_text_for_value_none %}
<p class="margin-top-0 text-base-dark">{{ custom_text_for_value_none }}</p>
{% endif %}
{% if value %}
{{ value }}
{% endif %}
{% if not value %}
None
{% endif %}
{% endif %}
</div>

{% comment %}We have conditions where an edit_link is set but editable can be true or false{% endcomment %}
{% if edit_link %}
{% if manage_button or editable or view_button %}
<div class="text-right">
<a
href="{{ edit_link }}"
class="usa-link usa-link--icon font-sans-sm line-height-sans-4"
>
<svg class="usa-icon" aria-hidden="true" focusable="false" role="img" width="24">
<use xlink:href="{% static 'img/sprite.svg' %}#{% if manage_button %}settings{% elif editable %}edit{% else %}visibility{% endif %}"></use>
</svg>
{% if manage_button %}
Manage
{% elif editable %}
Edit
{% else %}
View
{% endif %}
<span class="sr-only"> {{ title|default:"Page" }}</span>
</a>
</div>
{% endif %}
{% endif %}

</div>
</section>
4 changes: 2 additions & 2 deletions src/registrar/templates/portfolio_organization.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ <h1>Organization overview</h1>
<div class="margin-top-2 tablet:grid-col-10">
<h2 class="string-wrap margin-top-2">{{ portfolio }}</h2>
{% 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_organization.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' %}
</div>
Expand Down
1 change: 1 addition & 0 deletions src/registrar/views/portfolios.py
Original file line number Diff line number Diff line change
Expand Up @@ -904,6 +904,7 @@ def get_context_data(self, **kwargs):
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):
Expand Down