mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-06-08 23:40:44 -04:00
We’ve moved from three to four permissions. Four permissions don’t fit in the exiting horizontal layout. This commit makes the permissions stack vertically instead. This approach has some downsides: - makes the permissions less easy to scan vertically - makes them take up a lot more space (and at lives services, most of them have somewhere around 15 team members) But I think for now it’s better than any horizontal alternative that I tried.
122 lines
4.1 KiB
HTML
122 lines
4.1 KiB
HTML
{% extends "withnav_template.html" %}
|
|
{% from "components/table.html" import list_table, row, field, hidden_field_heading %}
|
|
{% from "components/page-footer.html" import page_footer %}
|
|
{% from "components/tick-cross.html" import tick_cross %}
|
|
|
|
{% set table_options = {
|
|
'field_headings': [
|
|
'Name', 'Send messages', 'Modify service', 'Access API keys', hidden_field_heading('Link to change')
|
|
],
|
|
'field_headings_visible': True,
|
|
'caption_visible': True
|
|
} %}
|
|
|
|
{% block service_page_title %}
|
|
Team members
|
|
{% endblock %}
|
|
|
|
{% block maincolumn_content %}
|
|
|
|
<div class="grid-row bottom-gutter">
|
|
<div class="column-two-thirds">
|
|
<h1 class="heading-large">
|
|
Team members
|
|
</h1>
|
|
</div>
|
|
{% if current_user.has_permissions(['manage_users'], admin_override=True) %}
|
|
<div class="column-one-third">
|
|
<a href="{{ url_for('.invite_user', service_id=current_service.id) }}" class="button align-with-heading">Invite team member</a>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<h2 class="visually-hidden">
|
|
Active
|
|
</h2>
|
|
<div class="user-list">
|
|
{% for user in users %}
|
|
<div class="user-list-item">
|
|
<h3>
|
|
<span class="heading-small">{{ user.name }}</span> <span class="hint">
|
|
{%- if user.email_address == current_user.email_address -%}
|
|
(you)
|
|
{% else %}
|
|
{{ user.email_address }}
|
|
{% endif %}
|
|
</span>
|
|
</h3>
|
|
<ul class="tick-cross-list">
|
|
<div class="tick-cross-list-permissions">
|
|
{{ tick_cross(
|
|
user.has_permissions(permissions=['send_texts', 'send_emails', 'send_letters']),
|
|
'Send messages'
|
|
) }}
|
|
{{ tick_cross(
|
|
user.has_permissions(permissions=['manage_templates']),
|
|
'Manage templates'
|
|
) }}
|
|
{{ tick_cross(
|
|
user.has_permissions(permissions=['manage_users', 'manage_settings']),
|
|
'Manage service'
|
|
) }}
|
|
{{ tick_cross(
|
|
user.has_permissions(permissions=['manage_api_keys']),
|
|
'Access API keys'
|
|
) }}
|
|
</div>
|
|
{% if current_user.has_permissions(['manage_users'], admin_override=True) %}
|
|
{% if current_user.id != user.id %}
|
|
<li class="tick-cross-list-edit-link">
|
|
<a href="{{ url_for('.edit_user_permissions', service_id=current_service.id, user_id=user.id)}}">Edit permissions</a>
|
|
</li>
|
|
{% endif %}
|
|
{% endif %}
|
|
</ul>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
|
|
{% if invited_users %}
|
|
<h2 class="heading-medium">
|
|
Invited
|
|
</h2>
|
|
<div class="user-list">
|
|
{% for user in invited_users %}
|
|
<div class="user-list-item">
|
|
<h3>
|
|
<span style="font-weight: bold">{{ user.email_address }}</span>
|
|
</h3>
|
|
<ul class="tick-cross-list">
|
|
<div class="tick-cross-list-permissions">
|
|
{{ tick_cross(
|
|
user.has_permissions(permissions=['send_texts', 'send_emails', 'send_letters']),
|
|
'Send messages'
|
|
) }}
|
|
{{ tick_cross(
|
|
user.has_permissions(permissions=['manage_templates']),
|
|
'Edit templates'
|
|
) }}
|
|
{{ tick_cross(
|
|
user.has_permissions(permissions=['manage_users', 'manage_settings']),
|
|
'Manage service'
|
|
) }}
|
|
{{ tick_cross(
|
|
user.has_permissions(permissions=['manage_api_keys']),
|
|
'Access API keys'
|
|
) }}
|
|
</div>
|
|
<li class="tick-cross-list-edit-link">
|
|
{% if user.status == 'pending' and current_user.has_permissions(['manage_users']) %}
|
|
<a href="{{ url_for('.cancel_invited_user', service_id=current_service.id, invited_user_id=user.id)}}">Cancel invitation</a>
|
|
{% else %}
|
|
{{ user.status|title }}
|
|
{% endif %}
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% endblock %}
|