{% load zumanji_helpers %}

<div class="row">
  <div class="span6">
    <dl class="dl-horizontal">
      <dt>ID</dt>
      <dd><a href="{% url zumanji:view_build project_label=build.project.label build_id=build.id %}">#{{ build.id }}</a></dd>
      <dt>Project</dt>
      <dd><a href="{% url zumanji:view_project project_label=build.project.label %}">{{ build.project.label }}</a></dd>
      <dt>Duration:</dt>
      <dd>{{ build.total_duration|floatformat:3 }}s</dd>
      <dt>Tests:</dt>
      <dd>{{ build.num_tests }}</dd>
      <dt>Datetime</dt>
      <dd>{{ build.datetime }}</dd>
      {% with build.tags.all as tags %}
        {% if tags %}
          <dt>Tags</dt>
          <dd>
            {% for tag in tags %}
              <a href="{% url zumanji:view_tag project_label=build.project.label, tag_id=tag.id %}">{{ tag.label }}</a>{% if not forloop.last %}, {% endif %}
            {% endfor %}
          </dd>
        {% endif %}
      {% endwith %}
    </dl>
  </div>
  <div class="span6">
    <dl class="dl-horizontal">
      <dt>Revision</dt>
      <dd>{{ build.revision.label }}{% if build.revision.data %} [<a href="{{ build.revision.details_url }}">git</a>]{% endif %}</dd>
      <dt>Author</dt>
      <dd>{{ build.revision.data.commit.author.name }} ({{ build.revision.data.commit.author.email }})</dd>
      <dt>Changes</dt>
      <dd>+{{ build.revision.data.stats.additions }} / -{{ build.revision.data.stats.deletions }} ({{ build.revision.data.files|length }} file{% if build.revision.data.files|length != 1 %}s{% endif %})</dd>
      <dt>Datetime</dt>
      <dd>{{ build.revision.data.commit.author.date|date_from_iso }}</dd>
      <dt>Message</dt>
      <dd>{{ build.revision.data.commit.message|oneline }}</dd>
    </dl>
  </div>
</div>