

{% for hour, sites in record.get_short_history() %}
  {% for site, actions in sites %}
    {% for action, users in actions %}
      {% for done in users %}

      <div style="margin:3px 0">

       {% set appbox = '' %}
       <div class="history-{{action}}">
        {% if action == 'push' %}
          {% set n_user = done['final']|length %}
          {% set appbox = '<span class="provenance">' ~ site %}
          {% set appbox = appbox ~ '</span>' %}
          {% trans with {'%n_user%' : n_user, '%appbox%' : appbox} %}report::Push vers %n_user% utilisateurs depuis lapplication box %appbox%{% endtrans %}
        {% elseif action == 'validate' %}
          {% set n_user = done['final']|length %}
          {% set appbox = '<span class="provenance">' ~ site %}
          {% set appbox = appbox ~ '</span>' %}
          {% trans with {'%n_user%' : n_user, '%appbox%' : appbox} %}report::Demande de validation vers %n_user% utilisateurs depuis lapplication box %appbox%{% endtrans %}
        {% elseif action == 'edit' %}
          {{ 'report::Edition des meta-donnees' | trans }}
        {% elseif action == 'collection' %}
          {% set dest = done['final']|join(', ') %}
          {% set coll_name = dest|bas_labels(app) %}
          {% trans with {'%coll_name%' : coll_name} %}report::Changement de collection vers : %coll_name%{% endtrans %}
        {% elseif action == 'status' %}
          {{ 'report::Edition des status' | trans }}
        {% elseif action == 'print' %}
          {% set format = done['final']|join(', ') %}
          {% trans with {'%format%' : format} %}report::Impression des formats : %format%{% endtrans %}
        {% elseif action == 'substit' %}
          {% set dest = done['final']|join(', ') %}
          {% trans with {'%dest%' : dest} %}report::Substitution de %dest%{% endtrans %}
        {% elseif action == 'publish' %}
          {% set dest = done['final']|join(', ') %}
          {% trans with {'%dest%' : dest} %}report::Publication de %dest%{% endtrans %}
        {% elseif action == 'download' %}
          {% set dest = done['final']|join(', ') %}
          {% trans with {'%dest%' : dest} %}report::Telechargement de %dest%{% endtrans %}
        {% elseif action == 'mail' %}
          {% set dest = done['comment']|join(', ') %}
          {% set content = done['final']|join(', ') %}
          {% trans with {'%dest%' : dest, '%content%' : content} %}Envoi par mail a %dest% de %content%{% endtrans %}
        {% elseif action == 'ftp' %}
          {% set dest = done['comment']|join(', ') %}
          {% set content = done['final']|join(', ') %}
          {% trans with {'%dest%' : dest, '%content%' : content} %}Envoi par ftp a %dest% de %content%{% endtrans %}
        {% elseif action == 'delete' %}
          {{ 'report::supression du document' | trans }}
        {% elseif action == 'add' %}
          {{ 'report::ajout du documentt' | trans }}
        {% else %}
          {{ 'report::Modification du document -- je ne me souviens plus de quoi...' | trans }}
        {% endif %}
          <span class="actor">
          {% if app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(record.get_base_id(), constant('\\ACL::CANREPORT')) %}
            {% if done['user'] and done['user'].getId() != app.getAuthenticatedUser().getId() %}
              {% set user_infos = done['user'].getDisplayName() %}
              {% trans with {'%user_infos%' : user_infos} %}report:: par %user_infos%{% endtrans %}
            {% endif %}
          {% endif %}

          </span>
       </div>

       <div style="font-size:10px;text-decoration:italic;">{{hour}}</div>


      {% endfor %}
    {% endfor %}
  {% endfor %}
{% endfor %}
