diff --git a/app/views/guidances/admin_edit.html.erb b/app/views/guidances/admin_edit.html.erb index 055334d..5851286 100644 --- a/app/views/guidances/admin_edit.html.erb +++ b/app/views/guidances/admin_edit.html.erb @@ -2,13 +2,13 @@ <% javascript 'admin.js' %>

- <%= t('org_admin.guidance_label') %> + <%= _('Guidance') %>
- <%= link_to t("org_admin.guidance.add_guidance"), + <%= link_to _('Add guidance'), admin_new_guidance_path, class: 'btn btn-primary' %> - <%= link_to t("org_admin.guidance.view_all_guidance"), + <%= link_to _('View all guidance'), admin_index_guidance_path, class: 'btn btn-primary' %>
@@ -23,18 +23,18 @@ - + - + - + - +
<%= t('org_admin.guidance.text_label') %><%= _('Text') %>
<%= text_area_tag("guidance-text", @guidance.text, class: "tinymce") %>
- <%= link_to( image_tag('help_button.png'), '#', class: 'guidance_text_popover', rel: "popover", 'data-html' => "true", 'data-content' => t('org_admin.guidance.text_help_text_html'))%> + <%= link_to( image_tag('help_button.png'), '#', class: 'guidance_text_popover', rel: "popover", 'data-html' => "true", 'data-content' => _('Enter your guidance here. You can include links where needed.'))%>
<%= t('org_admin.guidance.by_theme_or_by_question') %><%= _('Should this guidance apply:') %>
<% if !@guidance.question_id.nil? then %> <% select_op = 2 %> @@ -43,11 +43,11 @@ <% end %> <%= hidden_field 'select_op', value: select_op, id: 'edit_guid_ques_flag' %> - <%= select_tag "g_options", options_for_select({t('org_admin.guidance.by_themes_label') => 1, - t('org_admin.guidance.by_question_label') => 2}, select_op) %> + <%= select_tag "g_options", options_for_select({_('by themes') => 1, + _('by question') => 2}, select_op) %>
- <%= link_to( image_tag('help_button.png'), '#', class: 'guidance_apply_to_popover', rel: "popover", 'data-html' => "true", 'data-content' => t('org_admin.guidance.apply_to_help_text_html'))%> + <%= link_to( image_tag('help_button.png'), '#', class: 'guidance_apply_to_popover', rel: "popover", 'data-html' => "true", 'data-content' => _('Decide whether your guidance should display by themes (default) or if it only pertains to a specific question in one of the funder templates.'))%>
@@ -57,7 +57,7 @@ {prompt: false, include_blank: 'None'}, {multiple: true})%>
- <%= link_to( image_tag('help_button.png'), '#', class: 'guidance_by_themes_popover', rel: "popover", 'data-html' => "true", 'data-content' => t('org_admin.guidance.by_themes_help_text_html'))%> + <%= link_to( image_tag('help_button.png'), '#', class: 'guidance_by_themes_popover', rel: "popover", 'data-html' => "true", 'data-content' => _('Select which theme(s) this guidance relates to.'))%>
@@ -66,21 +66,21 @@
<%= t('org_admin.guidance.published') %><%= _('Published') %>
<%= f.check_box :published , as: :check_boxes%>
<%= t('org_admin.guidance.guidance_group_label') %><%= _('Guidance group') %>
<%= f.collection_select(:guidance_group_id, @guidance_groups, :id, :name, {prompt: false, include_blank: 'None'}, {multiple: false})%>
- <%= link_to( image_tag('help_button.png'), '#', class: 'guidance_group_select_popover', rel: "popover", 'data-html' => "true", 'data-content' => t('org_admin.guidance.guidance_group_select_help_text_html'))%> + <%= link_to( image_tag('help_button.png'), '#', class: 'guidance_group_select_popover', rel: "popover", 'data-html' => "true", 'data-content' => _('Select which group this guidance relates to.'))%>
@@ -92,8 +92,8 @@
- <%= t('helpers.submit.save')%> - <%= link_to t('helpers.submit.cancel'), :back, class: 'btn cancel' %> + <%= _('Save')%> + <%= link_to _('Cancel'), :back, class: 'btn cancel' %>

@@ -106,12 +106,12 @@ diff --git a/app/views/guidances/admin_index.html.erb b/app/views/guidances/admin_index.html.erb index a660213..fd40d01 100644 --- a/app/views/guidances/admin_index.html.erb +++ b/app/views/guidances/admin_index.html.erb @@ -3,15 +3,15 @@

- <%= t("org_admin.guidance_group.guidance_group_list") %> + <%= _('Guidance group list') %>

- <%= raw t("org_admin.guidance_group.guidance_group_text_html")%> + <%= raw _("

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.

")%>
- <%= link_to t("org_admin.guidance_group.add_guidance_group"), admin_new_guidance_group_path(), class: "btn btn-primary" %> + <%= link_to _('Add guidance group'), admin_new_guidance_group_path(), class: "btn btn-primary" %>
@@ -20,11 +20,11 @@ - - - - - + + + + + @@ -35,16 +35,16 @@ @@ -52,9 +52,9 @@ <%= l guidance_gr.updated_at.to_date, formats: :short %> <% end %> @@ -66,16 +66,16 @@

- <%= t("org_admin.guidance.guidance_list") %> + <%= _('Guidance list') %>

- <%= raw t("org_admin.guidance.guidance_text_html")%> + <%= raw _('

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) or you can write guidance for specific questions. 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.

You will usually want your guidance to display on all templates, however there may be cases where you only want it to show for specific funders e.g. if you have specific instructions for applicants to BBSRC for example. This can be set too if needed.

')%>
- <%= link_to t("org_admin.guidance.add_guidance"), + <%= link_to _('Add guidance'), admin_new_guidance_path(), class: "btn btn-primary" %>
@@ -88,12 +88,12 @@
<%= t("org_admin.guidance_group.name_label") %><%= t("org_admin.guidance.published") %><%= t("org_admin.guidance_group.subset") %><%= t("org_admin.guidance.last_updated") %><%= t("org_admin.guidance.actions") %><%= _('Name') %><%= _('Published') %><%= _('Optional subset') %><%= _('Last updated') %><%= _('Actions') %>
<% if guidance_gr.published.nil? || guidance_gr.published == false then%> - <%= t("helpers.no_label")%> + <%= _('No')%> <% else %> - <%= t("helpers.yes_label")%> + <%= _('Yes')%> <% end %> <% if guidance_gr.optional_subset.nil? || guidance_gr.optional_subset == false then%> - <%= t("helpers.no_label")%> + <%= _('No')%> <% else %> - <%= t("helpers.yes_label")%> + <%= _('Yes')%> <% end %> - <%= link_to t("helpers.view"), admin_show_guidance_group_path(guidance_gr), class: "dmp_table_link"%>
- <%= link_to t("helpers.submit.edit"), admin_edit_guidance_group_path(guidance_gr), class: "dmp_table_link"%>
- <%= link_to t("helpers.submit.delete"), admin_destroy_guidance_group_path(guidance_gr), data: {confirm: t("org_admin.guidance_group.delete_message", guidance_group_name: guidance_gr.name )}, method: :delete, class: "dmp_table_link"%> + <%= link_to _('View'), admin_show_guidance_group_path(guidance_gr), class: "dmp_table_link"%>
+ <%= 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"%>
- - - - - - + + + + + + @@ -116,7 +116,7 @@ <% end %> <% if !guidance.question_id.nil? then %> <% else %> <% end %> diff --git a/app/views/guidances/admin_new.html.erb b/app/views/guidances/admin_new.html.erb index 43e620c..cdbb0a0 100644 --- a/app/views/guidances/admin_new.html.erb +++ b/app/views/guidances/admin_new.html.erb @@ -2,10 +2,10 @@ <% javascript 'admin.js' %>

- <%= t('org_admin.guidance.new_label') %> + <%= _('New guidance') %>
- <%= link_to t("org_admin.guidance.view_all_guidance"), + <%= link_to _('View all guidance'), admin_index_guidance_path, class: 'btn btn-primary' %>
@@ -18,24 +18,24 @@ <%= form_for :guidance, url: {action: 'admin_create'}, html: {id: 'new_guidance_form'} do |f| %>

<%= t("org_admin.guidance.text_label") %><%= t("org_admin.guidance.themes_label") %><%= t("org_admin.guidance.question_label") %><%= t("org_admin.guidance.guidance_group_label") %><%= t("org_admin.guidance.last_updated") %><%= t("org_admin.guidance.actions") %><%= _('Text') %><%= _('Themes') %><%= _('Question') %><%= _('Guidance group') %><%= _('Last updated') %><%= _('Actions') %>
- <%= raw guidance.question.text.truncate(70, omission: t('helpers.truncate_continued')) %> + <%= raw guidance.question.text.truncate(70, omission: _('... (continued)')) %> @@ -136,10 +136,10 @@ <%= l guidance.updated_at.to_date, formats: :short %> - <%= link_to t("helpers.view"), admin_show_guidance_path(guidance), class: "dmp_table_link"%>
- <%= link_to t("helpers.submit.edit"), admin_edit_guidance_path(guidance), class: "dmp_table_link"%>
- <%= link_to t("helpers.submit.delete"), admin_destroy_guidance_path(guidance), - data: {confirm: t("org_admin.guidance.delete_message_html", guidance_summary: truncate(sanitize(guidance.text,tags: %w(br a)), length: 20 , omission: t('helpers.truncate_continued')) )}, method: :delete, class: "dmp_table_link"%> + <%= link_to _('View'), admin_show_guidance_path(guidance), class: "dmp_table_link"%>
+ <%= 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"%>
- + - + - + - +
<%= t('org_admin.guidance.text_label') %><%= _('Text') %>
<%= text_area_tag("guidance-text", "", class: "tinymce") %>
- <%= link_to( image_tag('help_button.png'), '#', class: 'guidance_text_popover', rel: "popover", 'data-html' => "true", 'data-content' => t('org_admin.guidance.text_help_text_html'))%> + <%= link_to( image_tag('help_button.png'), '#', class: 'guidance_text_popover', rel: "popover", 'data-html' => "true", 'data-content' => _('Enter your guidance here. You can include links where needed.'))%>
<%= t('org_admin.guidance.by_theme_or_by_question') %><%= _('Should this guidance apply:') %>
- <%= select_tag "g_options", options_for_select([[t('org_admin.guidance.by_themes_label'), 1], - [t('org_admin.guidance.by_question_label'), 2]]) %> + <%= select_tag "g_options", options_for_select([[_('by themes'), 1], + [_('by question'), 2]]) %>
- <%= link_to( image_tag('help_button.png'), '#', class: 'guidance_apply_to_popover', rel: "popover", 'data-html' => "true", 'data-content' => t('org_admin.guidance.apply_to_help_text_html'))%> + <%= link_to( image_tag('help_button.png'), '#', class: 'guidance_apply_to_popover', rel: "popover", 'data-html' => "true", 'data-content' => _('Decide whether your guidance should display by themes (default) or if it only pertains to a specific question in one of the funder templates.'))%>
@@ -45,24 +45,24 @@ :id, :title, {prompt: false, include_blank: 'None'}, {multiple: true})%>
- <%= link_to( image_tag('help_button.png'), '#', class: 'guidance_by_themes_popover', rel: "popover", 'data-html' => "true", 'data-content' => t('org_admin.guidance.by_themes_help_text_html'))%> + <%= link_to( image_tag('help_button.png'), '#', class: 'guidance_by_themes_popover', rel: "popover", 'data-html' => "true", 'data-content' => _('Select which theme(s) this guidance relates to.'))%>
<%= t('org_admin.guidance.published') %><%= _('Published') %>
<%= f.check_box :published , as: :check_boxes%>
- <%= link_to( image_tag('help_button.png'), '#', class: 'guidance_group_subset_popover', rel: "popover", 'data-html' => "true", 'data-content' => t('org_admin.guidance.guidance_group_published_help_text_html'))%> + <%= link_to( image_tag('help_button.png'), '#', class: 'guidance_group_subset_popover', rel: "popover", 'data-html' => "true", 'data-content' => _("Check this box when you are ready for this guidance to appear on user's plans."))%>
<%= t('org_admin.guidance.guidance_group_label') %><%= _('Guidance group') %>
<%= f.collection_select(:guidance_group_id, @guidance_groups, :id, :name, {prompt: false, include_blank: 'None'}, {multiple: false})%>
- <%= link_to( image_tag('help_button.png'), '#', class: 'guidance_group_select_popover', rel: "popover", 'data-html' => "true", 'data-content' => t('org_admin.guidance.guidance_group_select_help_text_html'))%> + <%= link_to( image_tag('help_button.png'), '#', class: 'guidance_group_select_popover', rel: "popover", 'data-html' => "true", 'data-content' => _('Select which group this guidance relates to.'))%>
@@ -97,9 +97,9 @@
- <%= t("helpers.submit.save")%> + <%= _('Save')%> - <%= link_to t('helpers.submit.cancel'), :back, class: 'btn cancel' %> + <%= link_to _('Cancel'), :back, class: 'btn cancel' %>

@@ -112,12 +112,12 @@ \ No newline at end of file diff --git a/app/views/guidances/admin_show.html.erb b/app/views/guidances/admin_show.html.erb index 14356f8..59de8ba 100644 --- a/app/views/guidances/admin_show.html.erb +++ b/app/views/guidances/admin_show.html.erb @@ -1,14 +1,14 @@ <%= stylesheet_link_tag "admin" %>

- <%= t("org_admin.guidance_label") %> + <%= _('Guidance') %>
- <%= link_to t("org_admin.guidance.add_guidance"), + <%= link_to _('Add guidance'), admin_new_guidance_path, class: "btn btn-primary" %> - <%= link_to t("org_admin.guidance.view_all_guidance"), + <%= link_to _('View all guidance'), admin_index_guidance_path, class: "btn btn-primary" %>
@@ -22,12 +22,12 @@ - + <% if @guidance.themes !=[] then %> - + - + <% end %> - + - + - + - +
<%= t("org_admin.guidance.text_label") %><%= _('Text') %> <%= raw @guidance.text %>
<%= t("org_admin.guidance.themes_label") %><%= _('Themes') %> <% @guidance.themes.each do |th|%> <%= th.title %> <% end %> @@ -36,38 +36,38 @@ <% end %> <% if !@guidance.question_id.nil? %>
<%= t("org_admin.guidance.question_label") %><%= _('Question') %> <%= raw @guidance.question.text %>
<%= t("org_admin.guidance.guidance_group_label") %><%= _('Guidance group') %> <%= @guidance.guidance_group.name %>
<%= t("org_admin.guidance.published") %><%= _('Published') %> <%if @guidance.published == false || @guidance.published.nil? then%> - <%= t("helpers.no_label")%> + <%= _('No')%> <% else %> - <%= t("helpers.yes_label")%> + <%= _('Yes')%> <% end %>
<%= t("org_admin.guidance.created") %><%= _('Created') %> <%= l @guidance.created_at.to_date, formats: :short %>
<%= t("org_admin.guidance.last_updated") %><%= _('Last updated') %> <%= l @guidance.updated_at.to_date, formats: :short %>
- <%= link_to t("helpers.submit.edit"), admin_edit_guidance_path(@guidance.id), class: "btn btn-primary"%> - <%= link_to t("helpers.submit.back"), :back, class: "btn cancel" %> + <%= link_to _('Edit'), admin_edit_guidance_path(@guidance.id), class: "btn btn-primary"%> + <%= link_to _('Back'), :back, class: "btn cancel" %>