Newer
Older
dmpopidor / app / views / paginable / templates / _index.html.erb
@briley briley on 23 May 2018 1 KB Template Versioning
<% # locals: templates %>
<div class="table-responsive">
  <table class="table table-hover table-bordered">
    <thead>
      <tr>
        <th><%= _('Template Name') %>&nbsp;<%= paginable_sort_link('templates.title') %></th>
        <th><%= _('Organisation') %>&nbsp;<%= paginable_sort_link('orgs.name') %></th>
        <th><%= _('Status') %></th>
        <th><%= _('Edited Date') %>&nbsp;<%= paginable_sort_link('templates.updated_at') %></th>
      </tr>
    </thead>
    <tbody>
    <% scope.each do |template| %>
      <tr>
        <td>
          <%= "#{template.is_default? ? '* ' : ''}#{template.title}" %>
        </td>
          <td>
            <%= template.org.name %>
          </td>
          <td>
            <% if template.published? %>
              <%= _('Published') %>
            <% elsif template.draft? %>
              <% tooltip = _('This template is published changes but has unpublished changes!') %>
              <%= _('Published') %> <em class="sr-only"><%= tooltip %></em>
              &nbsp;&nbsp;<i class="fa fa-pencil-square-o" aria-hidden="true" data-toggle="tooltip" title="<%= tooltip %>"></i>
            <% else %>
              <%= _('Unpublished') %>
            <% end %>
          </td>
          <td>
            <% last_temp_updated = template.updated_at %>
            <%= l last_temp_updated.to_date, formats: :short %>
          </td>
       </tr>
      <% end %>
    </tbody>
  </table>
</div>