{% from "macros/audit.html" import m_audit_field_changes %}

{%- macro m_audit_entry(e) %}
  {#- FIXME: use macro for user avatar #}
  <img class="avatar" src="{{ user_photo_url(e.user, size=16) }}" alt="" />
  {{ e.msg }}
  {%- if e.entity_deleted %}<i class="fa fa-trash"></i>{% endif %}
  {%- if e.entry.changes %}
    {{ m_audit_field_changes(e.entry.changes) }}
  {%- endif %}
{% endmacro %}

{% macro m_security_entry(e) %}
    {{ e.msg }}
{% endmacro %}

{#  This one is used, though! #}
{% macro m_stats(stats) %}
  <ul class="stats">
    <li>
      <strong class="logins">{{ stats.active_users }}</strong>
      <span>{{ _("active users") }}</span>
    </li>

    <li>
      <strong class="new_members">{{ stats.new_members }}</strong>
      <span>{{ _("new members") }}</span>
    </li>

    <li>
      <strong class="new_documents">{{ stats.new_documents }}</strong>
      <span>{{ _("new documents") }}</span>
    </li>

    <li>
      <strong class="new_messages">{{ stats.new_messages }}</strong>
      <span>{{ _("new messages") }}</span>
    </li>
  </ul>
{% endmacro %}
