Newer
Older
dmpopidor / app / views / public_pages / template_index.html.erb
<%- model_class = Template -%>

<h1>
  <%= raw _('DMP Templates') %>
</h1>


<% if @templates.count > 0 %>
  <p><%= _('Templates are provided by a funder, an institution, or a trusted party.') %></p>
<% else %>
  <p><%= _('There are currently no public Templates.')%></p>
<% end %>

<% if @templates.count > 0 %>
  <div class="content">
  <table id="dmp_table" class="dmp_table tablesorter">
    <thead>
      <% if @templates.count > 10 %>
        <tr>
          <td colspan="5" class="td-as-th">
            <%= render(partial: "shared/table_filter",
                      locals: {path: public_templates_path, placeholder: _('Filter templates')}) %>
          </td>
        </tr>
      <% end %>
      <tr>
        <th class="col-large"><%= _('Template Name') %></th>
        <th class="col-large"><%= _('Organisation Name') %></th>
        <th class="col-small sorter-false centered"><%= _('Download') %></th>
      </tr>
    </thead>
    <tbody>
      <% @templates.each do |template| %>
        <tr class="table-data">
          <td><%= template.title %></td>
          <td><%= template.org.name %></td>
          <td class="dmp_td_small centered">
            <%= link_to _('DOCX'), template_export_path(template.dmptemplate_id, format: :docx) %>
            <%= link_to _('PDF'), template_export_path(template.dmptemplate_id, format: :pdf) %>
          </td>
        </tr>
      <% end %>
  </table>
  </div>
<% end %>