{% load i18n wise_icons %} {% comment %} A record's activity: who created, changed or deleted what, and when, newest first - one card per change, a Field / Before / After table for an edit. It renders what it is handed and knows nothing about where the log lives (django-simple-history, an audit table, your own model), so the same feed serves them all. Pass `entries`, a list of dicts: {'action': 'Updated', # the badge's text 'badge': 'orange', # badge colour: green (created), orange (updated), red (deleted), grey 'actor': 'Sami', # who (optional) 'at': datetime, # when 'subject': 'Sale line', # optional: what the change touched, when it is not the record itself 'detail': '2 × Paracetamol', # optional: and which one 'updated': True, # an edit: Before and After columns instead of a single Value one 'changes': [{'label': 'Quantity', 'old': '1', 'new': '2'}]} # optional Beside it, the usual `_pagination.html` for a long log. With no entries it shows an empty state, `empty_title` / `empty_text` overriding its words. The change table keeps its columns on a phone (`data-table-scroll`) so each entry stays one card rather than splitting into a card per field. {% endcomment %}
| {% trans "Field" %} | {% if entry.updated %}{% trans "Before" %} | {% trans "After" %} | {% else %}{% trans "Value" %} | {% endif %}
|---|---|---|---|
| {{ change.label|capfirst }} | {% if entry.updated %}{{ change.old|default:"—"|linebreaksbr }} | {% endif %}{{ change.new|default:"—"|linebreaksbr }} |