diff --git a/app/views/templates/admin_index.html.erb b/app/views/templates/admin_index.html.erb index 2c4a579..91f7793 100644 --- a/app/views/templates/admin_index.html.erb +++ b/app/views/templates/admin_index.html.erb @@ -1,11 +1,10 @@

<%= _('Templates') %>

- -

+

<%= _("If you wish to add an institutional template for a Data Management Plan, use the 'create template' button. You can create more than one template if desired e.g. one for researchers and one for PhD students.") %>

-

+

<%= _("Your template will be presented to users within your institution when no funder templates apply. If you want to add questions to funder templates use the 'customise template' options below.") %>

@@ -13,151 +12,164 @@
-

- <%= _('Own templates') %> -

- - - <% if @org_templates.length > 0 then %> - +

<%= _('Own templates') %>

+ +
+ + <% if @org_templates.length > 0 then %> +
- - - - - + + + <% @org_templates.each do |hash| %> - + + - - - + + + + + + - - +
  • <%= link_to _('Copy'), admin_copy_template_path(id: hash[:current].id), method: :put %>
  • + + + + <% end %>
    <%= _('Title') %><%= _('Description') %><%= _('Status') %><%= _('Last updated') %><%= _('Actions') %> + <%= _('Title') %><%= _('Description') %><%= _('Status') %><%= _('Last updated') %>
    <%= hash[:current].title %> - <%= raw hash[:current].description.truncate(90, omission: _('... (continued)')) unless hash[:current].description.nil? %> - - <% if hash[:live].nil? %> - <%= _('Unpublished') %> - - <% elsif hash[:current].dirty? %> - <%= _('Unpublished changes') %> - - <% else %> - <%= _('Published') %> - <% end %> - - <% last_temp_updated = hash[:current].updated_at %> - <%= l last_temp_updated.to_date, formats: :short %> - + <%= raw hash[:current].description.truncate(90, omission: _('... (continued)')) unless hash[:current].description.nil? %> + + <% if hash[:live].nil? %> + <%= _('Unpublished') %> + + <% elsif hash[:current].dirty? %> + <%= _('Unpublished changes') %> + + <% else %> + <%= _('Published') %> + <% end %> + + <% last_temp_updated = hash[:current].updated_at %> + <%= l last_temp_updated.to_date, formats: :short %> + - <%= link_to _('Edit'), admin_template_template_path(id: hash[:current].id, edit: "true"), class: "dmp_table_link" %> - <%= link_to _('History'), admin_template_history_template_path(id: hash[:current].id), class: "dmp_table_link" %> + +
    - - <% end %> + <% end %> +
    - <%= _('Create a template') %> + <%= _('Create a template') %>

    - <% if !current_user.org.funder? then %> -

    - <%= _('Funders templates') %> -

    +

    <%= _('Funders templates') %>

    <% if @funder_templates.length > 0 then %> - +
    - - - - - + + + <% @funder_templates.each do |hash| %> - - - - - - + - <% if !hash[:current].customization_of.nil? && !hash[:stale] %> - <% if hash[:live].nil? || hash[:current].dirty? %> - <%= link_to _('Publish'), admin_publish_template_path(hash[:current]), method: :put, class: "dmp_table_link" %> - <% end %> - <% if hash[:live].present? %> - <%= link_to _('Unpublish'), admin_unpublish_template_path(hash[:current]), method: :put, class: "dmp_table_link" %> - <% end %> + + + - + <% end %> + + + + + + <% end %>
    <%= _('Title') %><%= _('Description') %><%= _('Status') %><%= _('Last updated') %><%= _('Actions') %> + <%= _('Title') %><%= _('Description') %><%= _('Status') %><%= _('Last updated') %>
    - <%= hash[:current].title%> - - <%= raw hash[:current].description.truncate(90, omission: _('... (continued)')) %> - - - <% if hash[:current].customization_of.nil? %> - - <% else %> - - <% if hash[:stale] %> - <%= _('Original funder template has changed!')%> - <% elsif hash[:live].nil? %> - - <%= b_label = _('Un-published') %> - <% elsif hash[:current].dirty? %> - <%= _('You have un-published changes') %> - <% else %> - <%= _('Published') %> - <% end %> - <% end %> - - <% last_updated = hash[:current].updated_at %> - <%= l last_updated.to_date, formats: :short %> - - <% if hash[:current].customization_of.nil? %> - <% b_label = _('Customise') %> - <%= link_to b_label, admin_customize_template_path(hash[:current]), method: :get, class: "dmp_table_link" %> - <% else %> - <% if hash[:stale] %> - <% b_label = _('Transfer customisation') %> - <%= link_to b_label, admin_transfer_customization_template_path(hash[:funder_live]), class: "dmp_table_link" %> - <% else %> - <% b_label = _('Edit customisation') %> - <%= link_to b_label, admin_template_template_path(hash[:current]), class: "dmp_table_link" %> - <% end %> - - <% end %> +
    + <%= hash[:current].title%> + + <%= raw hash[:current].description.truncate(90, omission: _('... (continued)')) %> + + + <% if hash[:current].customization_of.nil? %> + + <% else %> + + <% if hash[:stale] %> + <%= _('Original funder template has changed!')%> + <% elsif hash[:live].nil? %> + + <%= b_label = _('Un-published') %> + <% elsif hash[:current].dirty? %> + <%= _('You have un-published changes') %> + <% else %> + <%= _('Published') %> <% end %> -
    + <% last_updated = hash[:current].updated_at %> + <%= l last_updated.to_date, formats: :short %> + + <% if hash[:current].customization_of.nil? %> + <% b_label = _('Customise') %> + <%= link_to b_label, admin_customize_template_path(hash[:current]), method: :get, class: "dmp_table_link" %> + <% else %> + + <% if hash[:stale] %> + <% b_label = _('Transfer customisation') %> + <%= link_to b_label, admin_transfer_customization_template_path(hash[:funder_live]), class: "dmp_table_link" %> + <% else %> + <% b_label = _('Edit customisation') %> + <%= link_to b_label, admin_template_template_path(hash[:current]), class: "dmp_table_link" %> + <% end %> + + <% end %> + + <% if !hash[:current].customization_of.nil? && !hash[:stale] %> + <% if hash[:live].nil? || hash[:current].dirty? %> + <%= link_to _('Publish'), admin_publish_template_path(hash[:current]), method: :put, class: "dmp_table_link" %> + <% end %> + <% if hash[:live].present? %> + <%= link_to _('Unpublish'), admin_unpublish_template_path(hash[:current]), method: :put, class: "dmp_table_link" %> + <% end %> + <% end %> +
    <% end %> <% end %> +