Newer
Older
dmpopidor / app / views / paginable / templates / _history.html.erb
<%# locals: { controller, action, paginable, scope, current } %>
<div class="table-responsive">
  <table class="table table-hover tablesorter">
    <thead>
      <tr>
        <th><%= _('Title') %>&nbsp;<%= paginable_sort_link('title') %></th>
        <th class="text-center"><%= _('Version') %>&nbsp;<%= paginable_sort_link('version') %></th>
        <th class="text-center"><%= _('Published') %>&nbsp;<%= paginable_sort_link('published') %></th>
        <th><%= _('Last updated') %>&nbsp;<%= paginable_sort_link('updated_at') %></th>
        <th class="text-center sorter-false"><%= _('Actions') %></th>
      </tr>
    </thead>
    <tbody>
      <% scope.each do |org_template| %>
        <tr>
          <td>
            <%= org_template.title%>
            <% if org_template == current && !org_template.published%>
              &nbsp;&nbsp;<i class="fa fa-pencil-square-o" aria-hidden="true"></i>&nbsp;&nbsp;<em><%=_('Draft')%></em>
            <% end %>
          </td>
          <td class="text-center">
            <%= org_template.version %>
          </td>
          <td class="text-center">
            <%= (org_template.published? ? _('Yes') : _('No')) %>
          </td>
          <td>
            <%= l org_template.updated_at.to_date, formats: :short %>
          </td>
          <td class="text-center">
            <%= link_to (org_template == current ? _('Edit') : _('View')), edit_org_admin_template_path(id: org_template), class: "dmp_table_link"%>
          </td>
        </tr>
      <% end %>
    </tbody>
  </table>
</div>