mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-06 03:13:42 -05:00
Copying what they’ve done on GOV.UK Pay, we should let users: - generate as many keys as they want - only see the key at time of creation - give keys a name - revoke any key at any time (this should be a one way operation) And based on discussions with @minglis and @servingUpAces, the keys should be used in conjunction with some kind of service ID, which gets encrypted with the key. In other words the secret itself never gets sent over the wire. This commit adds the UI (but not the underlying API integration) for doing the above.
62 lines
1.9 KiB
HTML
62 lines
1.9 KiB
HTML
{% macro mapping_table(caption='', field_headings=[], field_headings_visible=True, caption_visible=True) -%}
|
|
<table class="table">
|
|
<caption class="heading-medium table-heading{{ ' visuallyhidden' if not caption_visible}}">
|
|
{{ caption }}
|
|
</caption>
|
|
<thead class="table-field-headings{% if field_headings_visible %}-visible{% endif %}">
|
|
<tr>
|
|
{% for field_heading in field_headings %}
|
|
<th scope="col" class="table-field-heading{% if loop.first %}-first{% endif %}">
|
|
{% if field_headings_visible %}
|
|
{{ field_heading }}
|
|
{% else %}
|
|
<span class="visuallyhidden">{{ field_heading }}</span>
|
|
{% endif %}
|
|
</th>
|
|
{% endfor %}
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{{ caller() }}
|
|
</tbody>
|
|
</table>
|
|
{%- endmacro %}
|
|
|
|
{% macro list_table(items, caption='', empty_message='', field_headings=[], field_headings_visible=True, caption_visible=True) -%}
|
|
|
|
{% set parent_caller = caller %}
|
|
{% call mapping_table(caption, field_headings, field_headings_visible, caption_visible) %}
|
|
{% for item in items %}
|
|
{% call row() %}
|
|
{{ parent_caller(item) }}
|
|
{% endcall %}
|
|
{% endfor %}
|
|
{%- endcall %}
|
|
{% if not items %}
|
|
<p class="table-empty-message">
|
|
{{ empty_message }}
|
|
</p>
|
|
{% endif %}
|
|
|
|
{%- endmacro %}
|
|
|
|
{% macro row() -%}
|
|
<tr class="table-row">
|
|
{{ caller() }}
|
|
</tr>
|
|
{%- endmacro %}
|
|
|
|
{% macro field(align='left', status='') -%}
|
|
<td class="table-field{% if align == 'right' %}-right-aligned{% endif %}">
|
|
<span class="{{ 'table-field-status-' + status if status }}">{{ caller() }}</span>
|
|
</td>
|
|
{%- endmacro %}
|
|
|
|
{% macro right_aligned_field_heading(text) %}
|
|
<span class="table-field-heading-right-aligned">{{ text }}</span>
|
|
{%- endmacro %}
|
|
|
|
{% macro hidden_field_heading(text) %}
|
|
<span class="visuallyhidden">{{ text }}</span>
|
|
{%- endmacro %}
|