{% macro format(feed, entry)%}
  {% import 'prod/results/record.html.twig' as record_format %}

  <div class="entry ui-corner-all" id="entry_{{ entry.get_id() }}">
    <table class="head">
      <tr>
        <td>
          <h1 class="title">
            {% if feed.is_aggregated() %}
              <img style="height:16px;" src="{{ entry.get_feed().get_icon_url() }}" />
            {% endif %}
            {{ entry.get_title() }}
            {% set author = entry.get_author_name() %}
            <span class="author">{% trans %}Par {{ author }}{% endtrans %}</span>
          </h1>
        </td>
        <td style="width:60px;text-align:right;">
          {% if entry.get_feed().is_owner(app['authentication'].getUser()) or entry.is_publisher(app['authentication'].getUser()) %}
          <a class="tools options feed_edit" href="{{ path('feed_entry_edit', { 'id' : entry.get_id() }) }}">
            <img src="/skins/icons/file-edit.png" title="{% trans 'boutton::editer' %}"/>
          </a>
          <a class="tools feed_delete" href="{{ path('feed_entry_delete', { 'id' : entry.get_id() }) }}">
            <img src="/skins/icons/delete.png" title="{% trans 'boutton::supprimer' %}"/>
          </a>
          {% endif %}
        </td>
      </tr>
    </table>
    <div class="post_date">
      {% set updated_on = app['date-formatter'].getPrettyString(entry.get_updated_on()) %}
      {% set created_on = app['date-formatter'].getPrettyString(entry.get_created_on()) %}
      <span class="created_on">
          {{ created_on }}
      </span>
      {% if created_on != updated_on %}
      <span class="updated_on">
        (
        {% trans %}
          Derniere mise a jour le {{ updated_on }}
        {% endtrans %}
        )
      </span>
      {% endif %}
      {% if feed.is_aggregated() %}
        <a class="ajax_answers" href="{{ path('prod_feeds_feed', { 'id' : entry.get_feed().get_id() }) }}">
        {% set feed_name = entry.get_feed().get_title() %}
        {% trans %}
          dans {{feed_name}}
        {% endtrans %}
        <img style="height:16px;" src="{{ entry.get_feed().get_icon_url() }}" />
        </a>
      {% endif %}
    </div>
    <p>{{ entry.get_subtitle()|nl2br|raw }}</p>
    <div class="contents selectable">
    {% for item in entry.get_content() %}
      {% set record = item.get_record() %}
      {% set prefix = 'PUBLI_' ~ item.get_id() %}
      {{record_format.block(record, false, null, prefix, entry.get_id())}}
    {% endfor %}
    </div>
  </div>
{% endmacro %}