{% load i18n locale profile_tags store_tags %}
<div id="timeline-results">
  <div class="extra-item-title">{% trans 'Timeline' %}</div>
  {% for entry_group in entries_group %}
  <div class="extra-item-block">
    <div class="extra-item-content">
      {% if entry_group.submitter %}
      <div class="extra-item-gravatar">
        <a href="{{ entry_group.submitter.get_absolute_url }}"><img src="{{ entry_group.submitter|gravatar:24 }}" alt="{{ entry_group.submitter.user.username }}" width="24" height="24" title="{{ entry_group.submitter }}" /></a>
      </div>
      {% endif %}
      <div class="extra-item">
        <div class="timeline-entry">
          {% for entry in entry_group.entries %}
          <div class="timeline-field-{{ entry.field }}
            {% if entry.field == 2 %} js-editor-copytext{% endif %}"
            {% if entry.field == 2 %}data-action="overwrite"{% endif %}>{% if entry.field != 2 and entry.field != 0 %}<span class="sidetitle">{{ entry.field_name }}:</span> {% endif %}{% if entry.field != 3 and entry.field != 0 %}<span class="timeline-field-body" lang="{{ language.code }}">{{ entry.new_value }}</span>{% elif entry.field == 0 %}{{ entry.action }} <a href="{{ entry.checks_url }}#{{ entry.check_name}}">{{ entry.check_display_name}}</a> {% trans "check" %}{% else %}{{ entry.old_value }} <span class="timeline-arrow"></span> {{ entry.new_value }}{% endif %}</div>
          {% endfor %}
        </div>
      </div>
      <time class="extra-item-meta js-relative-date"
        title="{{ entry_group.datetime|dateformat }}"
        datetime="{{ entry_group.datetime.isoformat }}">&nbsp;</time>
    </div>
  </div>
  {% endfor %}
  <div class="extra-item-block">
    <div class="extra-item-content">
      <div class="extra-item-gravatar">
        <a href="{{ system.get_absolute_url }}"><img src="{{ system|gravatar:24 }}" alt="{{ system.username }}" width="24" height="24" title="{{ system }}" /></a>
      </div>
      <div class="extra-item">
        <div class="timeline-field-3">
          <span class="sidetitle">{% trans "State" %}:</span>
          <span class="timeline-field-body" lang="{{ language.code }}">{% trans "String created" %}</span>
        </div>
      </div>
    </div>
    {% if created %}
    <time class="extra-item-meta js-relative-date"
      title="{{ created.datetime|dateformat }}"
      datetime="{{ created.datetime.isoformat }}">&nbsp;</time>
    {% endif %}
  </div>
  </div>
</div>
