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

- static/rb/js/diffviewer/views/diffCommitListView.es6.js

so that they render items identically.
{% endcomment %}
<div class="rb-c-review-request-field-tabular rb-c-commit-list">
 <table class="rb-c-review-request-field-tabular__data">
  <thead>
   <tr>
{% if show_commits_diff %}
    <th class="rb-c-commit-list__column-op"></th>
{% endif %}
    <th class="rb-c-commit-list__column-summary">{% trans "Summary" %}</th>
    <th class="rb-c-commit-list__column-id">{% trans "ID" %}</th>
{% if include_author_name %}
    <th class="rb-c-commit-list__column-author">{% trans "Author" %}</th>
{% endif %}
   </tr>
  </thead>
  <tbody>
{% for commit in commits %}
   <tr class="rb-c-commit-list__commit{% if show_commits_diff %} -is-removed{% endif %}">
{%  if show_commits_diff %}
    <td class="rb-c-commit-list__op"
        aria-label="{% trans 'Removed commit' %}"></td>
{%  endif %}
    <td class="rb-c-commit-list__message">
{%   if commit.commit_message_body %}
     <details>
      <summary class="rb-c-commit-list__message-summary">{{commit.summary}}</summary>
      <div class="rb-c-commit-list__message-body">{{commit.commit_message_body}}</div>
     </details>
{%   else %}
     <div class="rb-c-commit-list__message-summary">{{commit.summary}}</div>
{%   endif %}
    </td>
    <td class="rb-c-commit-list__id"
        title="{{commit.commit_id}}">{{commit.commit_id}}</td>
{%  if include_author_name %}
    <td class="rb-c-commit-list__author">{{commit.author_name}}</td>
{%  endif %}
   </tr>
{% endfor %}
{% if show_commits_diff %}
{%  for commit in new_commits %}
   <tr class="rb-c-commit-list__commit{% if show_commits_diff %} -is-added{% endif %}">
{%   if show_commits_diff %}
    <td class="rb-c-commit-list__op"
        aria-label="{% trans 'Added commit' %}"></td>
{%   endif %}
    <td class="rb-c-commit-list__message">
{%   if commit.commit_message_body %}
     <details>
      <summary class="rb-c-commit-list__message-summary">{{commit.summary}}</summary>
      <div class="rb-c-commit-list__message-body">{{commit.commit_message_body}}</div>
     </details>
{%   else %}
     <div class="rb-c-commit-list__message-summary">{{commit.summary}}</div>
{%   endif %}
    </td>
    <td class="rb-c-commit-list__id"
        title="{{commit.commit_id}}">{{commit.commit_id}}</td>
{%   if include_author_name %}
    <td class="rb-c-commit-list__author">{{commit.author_name}}</td>
{%   endif %}
   </tr>
{%  endfor %}
{% endif %}
  </tbody>
 </table>
</div>
