diff --git a/app/views/guidances/admin_index.html.erb b/app/views/guidances/admin_index.html.erb index 3f1ae3b..a740ba9 100644 --- a/app/views/guidances/admin_index.html.erb +++ b/app/views/guidances/admin_index.html.erb @@ -2,7 +2,7 @@

<%= _('Guidance') %>

-

+

<%= _("First create a guidance group. This could be institution wide or a subset e.g. a particular College / School, Institute or department. When you create guidance you'll be asked to assign it to a guidance group.") %>

@@ -14,89 +14,96 @@ <% if @guidance_groups.length > 0 then%> - +
+
- - - - - + + + + <% !@guidance_groups.each do |guidance_gr| %> - + - - - - - <% end %>
<%= _('Name') %><%= _('Published') %><%= _('Optional subset') %><%= _('Last updated') %><%= _('Actions') %> + <%= _('Name') %><%= _('Published') %><%= _('Optional subset') %><%= _('Last updated') %>
<%= guidance_gr.name %> + <% if guidance_gr.published.nil? || guidance_gr.published == false then%> <%= _('No')%> <% else %> <%= _('Yes')%> <% end %> + <% if guidance_gr.optional_subset.nil? || guidance_gr.optional_subset == false then%> <%= _('No')%> <% else %> <%= _('Yes')%> <% end %> + <%= l guidance_gr.updated_at.to_date, formats: :short %> - <%= link_to _('Edit'), admin_edit_guidance_group_path(guidance_gr), class: "dmp_table_link"%>
- <%= link_to _('Delete'), admin_destroy_guidance_group_path(guidance_gr), data: {confirm: _("You are about to delete '%{guidance_group_name}'. This will affect guidance. Are you sure?") % { :guidance_group_name => guidance_gr.name }}, method: :delete, class: "dmp_table_link"%> +
+
+ <%end%>
- <%= _('Create a guidance group') %> + <%= _('Create a guidance group') %>
-

<%= _('Guidance list') %>

-

+

<%= _('You can write pieces of guidance to be displayed by theme (e.g. generic guidance on storage and backup that should present across the board). Writing generic guidance by theme saves you time and effort as your advice will be automatically displayed across all templates rather than having to write guidance to accompany each.') %>

-

+

<%= _('If you do have a need to provide guidance for specific funders that would not be useful to a wider audience (e.g. if you have specific instructions for applicants to BBSRC for example), you can do so by adding guidance to a specific question when you edit your template.') %>

<% if @guidances.length > 0 then%> - +
+
<% if @guidances.length > TABLE_FILTER_MIN_ROWS %> - + <%= render(partial: "shared/table_filter", locals: {path: admin_index_guidance_path, placeholder: _('Filter guidance')}) %> <% end %> - - - - - + + + + <% @guidances.each do |guidance| %> <% if guidance.in_group_belonging_to?(current_user.org_id) then %> - + @@ -106,37 +113,49 @@ <%= th.title %> <% end %> - <% else %> - - <% end %> - <% if guidance.guidance_group.present? then %> - - <% else %> - - <% end %> + <% end %> + <% if guidance.guidance_group.present? then %> + + <% else %> + + <% end %> <% end %> <% end %>
- <%= render(partial: "shared/table_filter", - locals: {path: admin_index_guidance_path, - placeholder: _('Filter guidance')}) %> -
<%= _('Text') %><%= _('Themes') %><%= _('Guidance group') %><%= _('Last updated') %><%= _('Actions') %> + <%= _('Text') %><%= _('Themes') %><%= _('Guidance group') %><%= _('Last updated') %>
<%= guidance.text.html_safe%> - - + <% else %> + + - - <%= guidance.guidance_group.name %> - - - - + <%= guidance.guidance_group.name %> + + - + <%= l guidance.updated_at.to_date, formats: :short %> - <%= link_to _('Edit'), admin_edit_guidance_path(guidance), class: "dmp_table_link"%>
- <%= link_to _('Delete'), admin_destroy_guidance_path(guidance), - data: {confirm: _("You are about to delete '%{guidance_summary}'. Are you sure?") % { :guidance_summary => truncate(sanitize(guidance.text,tags: %w(br a)), length: 20 , omission: _('... (continued)'))} }, method: :delete, class: "dmp_table_link"%> +
+ <% end %>
- <%= _('Create guidance') %> + <%= _('Create guidance') %>
diff --git a/app/views/plans/index.html.erb b/app/views/plans/index.html.erb index 4093ba5..390e03d 100644 --- a/app/views/plans/index.html.erb +++ b/app/views/plans/index.html.erb @@ -69,7 +69,7 @@ + <% end %> diff --git a/app/views/templates/admin_index.html.erb b/app/views/templates/admin_index.html.erb index 520cafb..2eec2dd 100644 --- a/app/views/templates/admin_index.html.erb +++ b/app/views/templates/admin_index.html.erb @@ -18,14 +18,14 @@ <% if @org_templates.length > 0 then %>
- +
- + @@ -53,19 +53,26 @@ <%= l last_temp_updated.to_date, formats: :short %> + <% end %> @@ -73,7 +80,7 @@ <% end %> - + <%= _('Create a template') %> @@ -84,14 +91,14 @@ <% if @funder_templates.length > 0 then %>
-
<%= _('Title') %> <%= _('Description') %> <%= _('Status') %> <%= _('Last updated') %><%= _('Actions') %>
-
    -
  • <%= link_to _('Edit'), admin_template_template_path(id: hash[:current].id) %>
  • -
  • <%= link_to _('History'), admin_template_history_template_path(id: hash[:current].id) %>
  • - <% if hash[:live].nil? %> -
  • <%= link_to _('Publish'), admin_publish_template_path(hash[:current]), method: :put %>
  • - <% elsif hash[:current].dirty? %> -
  • <%= link_to _('Publish changes'), admin_publish_template_path(hash[:current]), method: :put %>
  • - <% else %> -
  • <%= link_to _('Unpublish'), admin_unpublish_template_path(hash[:current]), method: :put %>
  • - <% end %> -
  • <%= link_to _('Copy'), admin_copy_template_path(id: hash[:current].id), method: :put %>
  • -
-
+
- @@ -123,35 +130,42 @@ <%= l last_updated.to_date, formats: :short %> <% end %> diff --git a/app/views/users/admin_grant_permissions.html.erb b/app/views/users/admin_grant_permissions.html.erb index 69b5aa5..2dc172e 100644 --- a/app/views/users/admin_grant_permissions.html.erb +++ b/app/views/users/admin_grant_permissions.html.erb @@ -7,53 +7,50 @@
<%= form_tag( admin_update_permissions_user_path(@user), method: :put) do %> -
<%= _('Title') %> <%= _('Description') %> <%= _('Status') %> <%= _('Last updated') %><%= _('Actions') %> +
-
    - <% if hash[:current].customization_of.nil? %> -
  • - <%= link_to _('Customise'), admin_customize_template_path(hash[:current]), method: :get %> -
  • - <% else %> - <% if hash[:stale] %> -
  • - <%= link_to _('Transfer customisation'), admin_transfer_customization_template_path(hash[:funder_live]) %> -
  • - <% else %> -
  • - <%= link_to _('Edit customisation'), admin_template_template_path(hash[:current]) %> -
  • - <% 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 %> -
  • - <% end %> - <% if hash[:live].present? %> -
  • - <%= link_to _('Unpublish'), admin_unpublish_template_path(hash[:current]), method: :put %> -
  • - <% end %> - <% end %> -
+
+
+
- - + + <% @perms.each do |perm| %> <% case perm.name when 'grant_permissions' %> - - <% when 'modify_templates' %> - - <% when 'modify_guidance' %> - - <% when 'use_api' %> - - <% when 'change_org_details' %> - + + <% when 'modify_templates' %> + + <% when 'modify_guidance' %> + + <% when 'use_api' %> + + <% when 'change_org_details' %> + <% end %> <% end %> - + <% @perms.each do |perm| %> - + <% end %>
<%= _('Name') %>
<%= _('Name') %> - <%= _('Grant permissions') %> - - <%= _('Modify templates') %> - - <%= _('Modify guidance') %> - - <%= _('API rights') %> - - <%= _('Change organisation details') %> - + <%= _('Grant permissions') %> + + <%= _('Modify templates') %> + + <%= _('Modify guidance') %> + + <%= _('API rights') %> + + <%= _('Change organisation details') %> +
<%= @user.name(false) %> - <%= check_box_tag "perm_ids[]", perm.id, @user.perms.include?(perm) %> - <%= check_box_tag "perm_ids[]", perm.id, @user.perms.include?(perm) %>
- <%= submit_tag _('Save') %> +
+
+ <%= submit_tag _('Save'), class: 'btn btn-primary' %> +
<% end %> diff --git a/app/views/users/admin_index.html.erb b/app/views/users/admin_index.html.erb index 6648a31..4c49368 100644 --- a/app/views/users/admin_index.html.erb +++ b/app/views/users/admin_index.html.erb @@ -1,7 +1,7 @@

<%= _('List of users') %>

-

+

<%= _('Below is a list of users registered for your organisation. You can sort the data by each field.')%>

@@ -9,57 +9,59 @@
- - - <% if @users.count > TABLE_FILTER_MIN_ROWS %> +
+
+ + <% if @users.count > TABLE_FILTER_MIN_ROWS %> + + + + <% end %> - + + + + + - <% end %> - - - - - - - - - - <% @users.each do |user| %> - <% if !user.nil? then%> - - + <% @users.each do |user| %> + <% if !user.nil? then%> + + + + + + - - - - - - <% end %> - <% end %> - -
+ <%= render(partial: "shared/table_filter", + locals: {path: admin_index_users_path, + placeholder: _('Filter users')}) %> +
- <%= render(partial: "shared/table_filter", - locals: {path: admin_index_users_path, - placeholder: _('Filter users')}) %> - <%= _('Name') %><%= _('Email address') %><%= _('Last logged in') %><%= _('How many plans?') %><%= _('Privileges') %>
<%= _('Name') %><%= _('Email address') %><%= _('Last logged in') %><%= _('How many plans?') %><%= _('Privileges') %>
- <% if !user.name.nil? then%> - <%= user.name(false) %> + +
+ <% if !user.name.nil? then%> + <%= user.name(false) %> + <% end %> + + <%= user.email %> + + <% if !user.last_sign_in_at.nil? then%> + <%= l user.last_sign_in_at.to_date, :formats => :short %> + <% end %> + + <% if !user.roles.nil? then%> + <%= user.roles.length %> + <% end %> + + <% unless current_user == user %> + <% b_label = _('Edit')%> + <%= link_to b_label, admin_grant_permissions_user_path(user)%> <% end %> - - <%= user.email %> - - <% if !user.last_sign_in_at.nil? then%> - <%= l user.last_sign_in_at.to_date, :formats => :short %> - <% end %> - - <% if !user.roles.nil? then%> - <%= user.roles.length %> - <% end %> - - <% unless current_user == user %> - <% b_label = _('Edit')%> - <%= link_to b_label, admin_grant_permissions_user_path(user), :class => "dmp_table_link"%> - <% end %> -
+ + + <% end %> + <% end %> + + +
\ No newline at end of file