Newer
Older
dmpopidor / app / views / branded / paginable / templates / _history.html.erb
<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 sorter-false"><%= _('Download') %></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">
            <%= link_to template_export_org_admin_template_url(template, format: :docx),
                        target: '_blank',
                        title: _("Opens in new window") do %>
               <i class="fa fa-file-word-o" aria-hidden="true"></i>
               <em class="sr-only"><%= _('(new window)') %></em>
            <% end %>
            <%= link_to template_export_org_admin_template_url(template, format: :pdf),
                        target: '_blank',
                        title: _("Opens in new window") do %>
               <i class="fa fa-file-pdf-o" aria-hidden="true"></i>
               <em class="sr-only"><%= _('(new window)') %></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>