Files
notifications-admin/app/templates/views/temp-history.html
Chris Hill-Scott 600e3affc1 Show user names for events without API changes
This commit introduces a slightly hacky way of putting usernames against
events, given that the API only returns user IDs.

It does so without:
- making changes to the API
- making a pages that could potentially fire off dozens of API calls (ie
  one per user)

This comes with the limitation that it can only get names for those team
members who are still in the team. Otherwise it will say ‘Unknown’.

In the future the API should probably return the name and email address
for the user who initiated the event, and whether that user was acting
in a platform admin capacity.
2019-10-23 13:15:41 +01:00

53 lines
1.5 KiB
HTML

{% extends "withnav_template.html" %}
{% from "components/page-header.html" import page_header %}
{% from "components/table.html" import list_table, field %}
{% from "components/pill.html" import pill %}
{% block service_page_title %}
Audit events
{% endblock %}
{% block maincolumn_content %}
{{ page_header("Audit events") }}
{% if show_navigation %}
<div class="bottom-gutter">
{{ pill(
[
('All', None, url_for('main.history', service_id=current_service.id), None),
('Service settings', 'service', url_for('main.history', service_id=current_service.id, selected='service'), None),
('API keys', 'api', url_for('main.history', service_id=current_service.id, selected='api'), None),
],
request.args.get('selected'),
show_count=False
) }}
</div>
{% endif %}
{% for day, events in days %}
<h2 class="heading-small top-gutter">
{{ events[0].time|format_date_human|title }}
</h2>
<ul class="bottom-gutter">
{% for event in events %}
<li class="history-list-item">
<div class="grid-row">
<div class="column-one-third">
<div class="history-list-user">
{{ user_getter(event.user_id) }}
</div>
<div class="history-list-time">
{{ event.time|format_time }}
</div>
</div>
<div class="column-two-thirds">
{{ event }}
</div>
</li>
{% endfor%}
</ul>
{% endfor %}
{% endblock %}