diff --git a/app/views/plans/index.html.erb b/app/views/plans/index.html.erb index fd7fef5..9506630 100644 --- a/app/views/plans/index.html.erb +++ b/app/views/plans/index.html.erb @@ -1,104 +1,105 @@ -<% javascript "views/plans/index.js" %> -

<%= _('My Dashboard') %>

+
+
+

<%= _('My Dashboard') %>

- -

-<% if @plans.count > 0 %> - - <%= _('The table below lists the plans that you have created, and any that have been shared with you by others.') %>
- <%= _('These can be edited, shared, exported or deleted at anytime.')%> -<% else %> - <%= _("Welcome.") %>
- <%= _("You are now ready to create your first DMP.") %>
- <%= _("Click the 'Create plan' button below to begin.")%> -<% end %> -

+ +

+ <% if @plans.count > 0 %> + <%= _('The table below lists the plans that you have created, and any that have been shared with you by others.') %>
+ <%= _('These can be edited, shared, exported or deleted at anytime.')%> + <% else %> + <%= _("Welcome.") %>
+ <%= _("You are now ready to create your first DMP.") %>
+ <%= _("Click the 'Create plan' button below to begin.")%> + <% end %> +

+
+
<% if @plans.length > 0 %> - - - <% if @plans.length > 10 %> +
+
+ + <% if @plans.length > 10 %> + + + + <% end %> - + + + + + + + - <% end %> - - - - - - - - - - - - <% @plans.each do |plan| %> - - - - - - - - + <% @plans.each do |plan| %> + + + + + + - - <% end %> - -
+ <%= render(partial: "shared/table_filter", + locals: {path: plans_path, placeholder: _('Filter plans')}) %> +
- <%= render(partial: "shared/table_filter", - locals: {path: plans_path, placeholder: _('Filter plans')}) %> - <%= _('Project Title') %><%= _('Template') %><%= _('Edited') %><%= _('Role') %><%= _('Test') %><%= _('Visibility') %> + <%= _('Actions') %> +
<%= _('Project Title') %><%= _('Template') %><%= _('Edited') %><%= _('Role') %><%= _('Test') %><%= _('Visibility') %> - <%= _('Actions') %> -
- <%= link_to "#{plan.title.length > 60 ? "#{plan.title[0..59]} ..." : plan.title}", - plan_path(plan) %> - <%= plan.template.title %><%= l(plan.latest_update.to_date, formats: :short) %><%= display_role(plan.roles.find_by(user: current_user)) %> - <% if plan.administerable_by?(current_user.id) then %> - <%= plan.administerable_by?(current_user.id) ? '' : 'disabled="true"' %> /> - <% else %> - <%= plan.visibility === 'is_test' ? _('Yes') : _('No') %> - <% end %> - <%= raw display_visibility(plan.visibility) %> - - <%= _('Actions') %> - -
+ <%= link_to "#{plan.title.length > 60 ? "#{plan.title[0..59]} ..." : plan.title}", + plan_path(plan) %> + <%= plan.template.title %><%= l(plan.latest_update.to_date, formats: :short) %><%= display_role(plan.roles.find_by(user: current_user)) %> + <% if plan.administerable_by?(current_user.id) then %> + <%= plan.administerable_by?(current_user.id) ? '' : 'disabled="true"' %> /> <% else %> -
  • <%= link_to _('View'), - plan_path(plan) %>
  • - -
  • <%= link_to _('Download'), - show_export_plan_path(plan) %>
  • + <%= plan.visibility === 'is_test' ? _('Yes') : _('No') %> <% end %> - <% role = plan.roles.where(user_id: current_user.id).first %> - <% conf = (role.creator? && plan.publicly_visible?) ? _("Are you sure you wish to remove this public plan? This will remove it from the Public DMPs page but any collaborators will still be able to access it.") : _("Are you sure you wish to remove this plan? Any collaborators will still be able to access it.") %> -
  • <%= link_to _('Remove'), - deactivate_role_path(role), - method: :put, - data: {confirm: conf} %>
  • - -
    + + <%= raw display_visibility(plan.visibility) %> + + <% end %>
    - <%= _('Create plan') %> + <%= link_to _('Create plan'), new_plan_path, class: 'btn btn-primary' %>
    diff --git a/lib/assets/javascripts/application.js b/lib/assets/javascripts/application.js index 8ba5321..37aa046 100644 --- a/lib/assets/javascripts/application.js +++ b/lib/assets/javascripts/application.js @@ -38,6 +38,8 @@ //= require utils/tinymce.js //= require utils/validate.js //= require utils/ariatiseForm.js +//= require utils/filteriseTable.js +//= require utils/collateTable.js // views JS files //= require views/notes/add.js @@ -45,6 +47,7 @@ //= require views/notes/edit.js //= require views/notes/archive.js //= require views/contacts/new.js +//= require views/plans/index.js // Rest of JS files //= require dmproadmap/accordions.js