The operator found "Today 08:03" in place of a date odd on the audit log,
and asked for the recency groups as dividers instead. |when now always
writes the date ("Thu 8 Oct 08:03"); mark_day_groups gives each entry its
group in the reader's zone, and a divider row opens each group. A scrolled
page carries the group the last one ended in, so it is not opened twice.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
32 lines
1.6 KiB
HTML
32 lines
1.6 KiB
HTML
{# audit/_rows.html — one page of the audit log's rows, then the sentinel that
|
|
loads the next page as the reader nears it (core.paging, pref 172). A
|
|
divider row opens each recency group: Today, Yesterday, Last 7 days, Older. #}
|
|
{% from "_macros.html" import scroll_more, scroll_end %}
|
|
{% for item in events %}
|
|
{% set e = item.event %}
|
|
{% if item.opens_group %}<tr class="table-divider"><th colspan="5" scope="rowgroup">{{ item.group }}</th></tr>{% endif %}
|
|
<tr>
|
|
<td class="nowrap">{{ e.timestamp|when }}</td>
|
|
<td class="nowrap">{{ e.username }}</td>
|
|
<td title="{{ e.action }}">{{ item.action or e.action }}</td>
|
|
<td>
|
|
{% if item.entity %}
|
|
<span class="field-hint">{{ e.entity_type|replace('_', ' ') }}</span>
|
|
{% if item.entity.url %}<a href="{{ item.entity.url }}">{{ item.entity.label }}</a>{% else %}{{ item.entity.label }}{% endif %}
|
|
{% if item.entity.gone %}<span class="field-hint">(deleted)</span>{% endif %}
|
|
{% elif e.entity_type %}<span class="field-hint">{{ e.entity_type|replace('_', ' ') }}</span>{% endif %}
|
|
</td>
|
|
<td class="audit-facts">
|
|
{% for f in item.facts %}
|
|
<div><span class="tone-dim">{{ f.label }}</span> {% if f.url %}<a href="{{ f.url }}">{{ f.text }}</a>{% else %}{{ f.text }}{% endif %}</div>
|
|
{% endfor %}
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
{% if after %}
|
|
{{ scroll_more("/audit/?before=" ~ (after|urlencode) ~ (("&action=" ~ (action_filter|urlencode)) if action_filter else "")
|
|
~ "&group=" ~ (last_group|urlencode), cols=5) }}
|
|
{% else %}
|
|
{{ scroll_end(cols=5) }}
|
|
{% endif %}
|