{% load djblets_js i18n %}
{% comment %}
This template should be kept in sync with the templates in:

- templates/reviews/commit_list_field.html
- static/rb/js/diffviewer/views/diffCommitListView.es6.js

so that they render items identically.
{% endcomment %}
<div class="commit-list-container">
 <table class="commit-list changed">
  <colgroup>
    <col>{# Marker column #}
{% if to_expand %}
    <col class="expand-collapse-control">
{% endif %}
    <col>{# Summary column #}
{% if include_author_name %}
    <col>
{% endif %}
  </colgroup>
  <thead>
   <tr>
    <th class="marker"></th>
    <th{% if to_expand %} colspan="2"{% endif %}>{% trans "Summary" %}</th>
{% if include_author_name %}
    <th>{% trans "Author" %}</th>
   </tr>
{% endif %}
  </thead>
  <tbody>
{% for commit in old_commits %}
   <tr class="old-value">
    <td class="marker">-</td>
{%  if to_expand %}
     <td>
{%   if commit.pk in to_expand %}
      <a href="#" class="expand-commit-message" data-commit-id="{{commit.pk}}" aria-role="button">
       <span class="fa fa-plus" title="{% trans "Expand commit message." %}"></span>
      </a>
{%    endif %}
     </td>
{%  endif %}
    <td class="value"><pre>{{commit.summary}}</pre></td>
{%  if include_author_name %}
    <td class="value">{{commit.author_name}}</td>
{%  endif %}
   </tr>
{% endfor %}
{% for commit in new_commits %}
   <tr class="new-value">
    <td class="marker">+</td>
{%  if to_expand %}
     <td>
{%   if commit.pk in to_expand %}
      <a href="#" class="expand-commit-message" data-commit-id="{{commit.pk}}" aria-role="button">
       <span class="fa fa-plus" title="{% trans "Expand commit message." %}"></span>
      </a>
{%    endif %}
     </td>
{%  endif %}
     <td class="value"><pre>{{commit.summary}}</pre></td>
{%  if include_author_name %}
    <td class="value">{{commit.author_name}}</td>
{%  endif %}
   </tr>
{% endfor %}
  </tbody>
 </table>
</div>
