{% load assets combo gnm humanize %}
<div class="current-forms">
{% if forms %}
{% for form in forms|dictsortreversed:"last_update_time" %}
{% if form.status|lower != "transmis à la commune" and form.status|lower != "transmis à la métropole" and not "cartads" in form.keywords %}
{% with producer=form|as_producer %}
<div class="tile producer-{{producer.slug}}">
  <div class="tile-picture" style="background-image: url({{form.url|form_asset_url}}), url({% asset_url "wcs:form:picture:eservices:"|add:form.form_slug "picture:"|add:producer.slug size=size crop="center" %})"></div>
  <div class="tile-head">
    <div class="tile-title">
      <h2><a href="{{form.url}}">{{form.name}}</a></h2>
      <span class="producer" style="background-image: url({% asset_url "logo:"|add:producer.slug %})">{{ producer.label }}</span>
    </div>
  </div>
  <div class="tile-content">
    <p class="form-date">Envoyé le : {{form.datetime|strptime:"%Y-%m-%d %H:%M:%S"|date:"d/m/Y"}}</p>
    {% if form.form_digest %}
    <p class="form-digest">{{form.form_digest}}</p>
    {% endif %}
    <p class="form-status {% if form.form_status_is_endpoint %}open{% endif %}">
      <span class="status-name">{{form.status}}</span><br>
      <span class="update-time">(mise à jour le : {{form.last_update_time|strptime:"%Y-%m-%d %H:%M:%S"|date:"d/m/Y"}})</span>
    </p>
  </div>

  <div class="tile-actions">
    <a class="action-more-info" href="{{form.url}}">Plus d’infos</a>
  </div>
</div>
{% endwith %}
{% endif %}
{% endfor %}
{% endif %}
</div>
