Styling user management with a table?

This commit is contained in:
Neil Martinsen-Burrell 2023-03-21 10:17:56 -05:00
parent 96b95bae8a
commit 7c852de743
No known key found for this signature in database
GPG key ID: 6A3C818CC10D0184
4 changed files with 35 additions and 9 deletions

View file

@ -222,7 +222,9 @@ section.dashboard {
p {
margin-bottom: 0;
}
}
.dotgov-table {
.usa-table {
width: 100%;

View file

@ -1,4 +1,4 @@
{% extends "dashboard_base.html" %}
{% extends "base.html" %}
{% block title %}Domain {{ domain.name }}{% endblock %}
@ -12,9 +12,9 @@
<div class="grid-col-9">
<main id="main-content" class="grid-container">
{% block domain_content %}
<h1>Domain {{ domain.name }}</h1>
{% block domain_content %}
{% endblock %} {# domain_content #}
</main>

View file

@ -1,5 +1,6 @@
{% extends "domain_base.html" %}
{% block domain_content %}
<p>Active: {% if domain.is_active %}Yes{% else %}No{% endif %}</p>
{{ block.super }}
<p>Active: {% if domain.is_active %}Yes{% else %}No{% endif %}</p>
{% endblock %} {# domain_content #}

View file

@ -1,10 +1,33 @@
{% extends "domain_base.html" %}
{% block title %}User management{% endblock %}
{% block domain_content %}
<h2>Users</h2>
<ul>
{% for user in domain.users.all %}
<li>{{ user }} &lt;{{ user.email }}&gt;</li>
{% endfor %}
</ul>
<h1>User management</h1>
{% if domain.permissions %}
<table class="dotgov-table usa-table usa-table--borderless usa-table--stacked">
<caption class="sr-only">Domain users</caption>
<thead>
<tr>
<th data-sortable scope="col" role="columnheader">Email</th>
<th data-sortable scope="col" role="columnheader">Role</th>
</tr>
</thead>
<tbody>
{% for permission in domain.permissions.all %}
<tr>
<th scope="row" role="rowheader" data-sort-value="{{ user.email }}" data-label="Domain name">
{{ permission.user.email }}
</th>
<td data-label="Role">{{ permission.role|title }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<div
class="usa-sr-only usa-table__announcement-region"
aria-live="polite"
></div>
{% endif %}
{% endblock %} {# domain_content #}