Newer
Older
dmpopidor / app / views / public_pages / template_index.html.erb
<div class="row">
  <div class="col-md-12">
    <h1><%= raw _('DMP Templates') %></h1>
  </div>
</div>

<div class="row">
  <div class="col-md-12">
    <% if @templates.count > 0 %>
      <p class="left-indent"><%= _('Templates are provided by a funder, an institution, or a trusted party.') %></p>
    <% else %>
      <p class="left-indent"><%= _('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 > TABLE_FILTER_MIN_ROWS %>
            <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 %>
  </div>
</div>