<div class="table-responsive">
  <table class="table table-hover tablesorter">
    <thead>
      <tr>
        <th scope="col"><%= _('Title') %>&nbsp;<%= paginable_sort_link('templates.title') %></th>
        <th scope="col" class="text-center"><%= _('Version') %>&nbsp;<%= paginable_sort_link('templates.version') %></th>
        <th scope="col" class="text-center"><%= _('Published') %>&nbsp;<%= paginable_sort_link('templates.published') %></th>
        <th scope="col" class="date-column"><%= _('Last updated') %>&nbsp;<%= paginable_sort_link('templates.updated_at') %></th>
        <th scope="col" class="text-center sorter-false"><%= _('Actions') %></th>
      </tr>
    </thead>
    <tbody>
      <% scope.each do |template| %>
        <tr>
          <td>
            <%= template.title%>
            <% if template.draft? && template.latest? %>
              &nbsp;&nbsp;<i class="fa fa-pencil-square-o" aria-hidden="true"></i>&nbsp;&nbsp;<em><%=_('Draft')%></em>
            <% end %>
          </td>
          <td class="text-center">
            <%= template.version %>
          </td>
          <td class="text-center">
            <%= (template.published? ? _('Yes') : _('No')) %>
          </td>
          <td>
            <%= l template.updated_at.to_date, formats: :short %>
          </td>
          <td class="text-center">
            <% if template.customization_of.present? %>
              <% if template.latest? %>
                <%= link_to  _('Edit customizations'), org_admin_template_path(id: template.id), class: "dmp_table_link" %>
              <% else %>
                <%= link_to  _('View customizations'), org_admin_template_path(id: template.id), class: "dmp_table_link" %>
              <% end %>
            <% else %>
              <% if template.latest? %>
                <%= link_to _('Edit'), edit_org_admin_template_path(id: template.id), class: "dmp_table_link" %>
              <% else %>
                <%= link_to  _('View'), org_admin_template_path(id: template.id), class: "dmp_table_link" %>
              <% end %>
            <% end %>
          </td>
        </tr>
      <% end %>
    </tbody>
  </table>
</div>