{% load i18n %}
<section id="changelog-{{ section.slug }}" class="changelog-section changelog-section--{{ variant|default:'default' }}{% if section.is_unreleased %} changelog-section--unreleased{% endif %}">
  <header class="changelog-section__header">
    <h3 class="changelog-section__title">{{ section.title }}</h3>
    {% if section.released_on %}
      <p class="changelog-section__meta">
        {% blocktrans with release_date=section.released_on %}Released on {{ release_date|date:"DATE_FORMAT" }}{% endblocktrans %}
      </p>
    {% elif section.is_unreleased %}
      <p class="changelog-section__meta changelog-section__meta--unreleased">{% trans "Work in progress" %}</p>
    {% endif %}
  </header>
  <ul class="changelog-entries">
    {% for commit in section.commits %}
      <li class="changelog-entry">
        <div class="changelog-entry__summary">{{ commit.summary|default_if_none:"" }}</div>
        <div class="changelog-entry__meta">
          <span class="changelog-entry__sha"><code>{{ commit.short_sha }}</code></span>
          {% if commit.author %}
            <span class="changelog-entry__author">{{ commit.author }}</span>
          {% endif %}
          <time datetime="{{ commit.authored_at|date:'c' }}" class="changelog-entry__time">{{ commit.authored_at|date:"DATETIME_FORMAT" }}</time>
          {% if commit.commit_url %}
            <a class="changelog-entry__link" href="{{ commit.commit_url }}" target="_blank" rel="noreferrer noopener">
              {% trans "View commit" %}
            </a>
          {% endif %}
        </div>
      </li>
    {% empty %}
      <li class="changelog-entry changelog-entry--empty">{% trans "No commits recorded for this release." %}</li>
    {% endfor %}
  </ul>
</section>
