diff --git a/app/views/branded/answers/_new_edit.html.erb b/app/views/branded/answers/_new_edit.html.erb index f08b398..182578d 100644 --- a/app/views/branded/answers/_new_edit.html.erb +++ b/app/views/branded/answers/_new_edit.html.erb @@ -6,7 +6,7 @@ <% q_format = question.question_format %> <% if q_format.rda_metadata? %>

- <%= raw question.text %> + <%= sanitize question.text %>

<% answer_hash = answer.answer_hash %>
@@ -69,15 +69,14 @@ <% if template.present? && template.org.present? %> - <% question.get_example_answers([base_template_org.id, template.org.id]).each do |annotation| %> + <% question.example_answers([base_template_org.id, template.org.id]).each do |annotation| %> <% if annotation.present? && annotation.org.present? && annotation.text.present? %> -
- "> +
+ <%="#{annotation.org.abbreviation} "%> <%=_('example answer')%> - -
" > - <%= raw annotation.text %> +
+ <%= sanitize annotation.text %>
<% end %> diff --git a/app/views/branded/guidance_groups/admin_edit.html.erb b/app/views/branded/guidance_groups/admin_edit.html.erb index 8858f8b..52d444e 100644 --- a/app/views/branded/guidance_groups/admin_edit.html.erb +++ b/app/views/branded/guidance_groups/admin_edit.html.erb @@ -27,9 +27,6 @@
<%= f.submit _('Save'), class: "btn btn-primary" %> - <% if @guidance_group.published == false then %> - <%= f.submit _('Publish'), name: "save_publish", class: "btn btn-primary" %> - <% end %> <%= link_to _('Cancel'), admin_index_guidance_path, class: "btn btn-primary", role: 'button' %>
<% end %> diff --git a/app/views/branded/guidances/admin_index.html.erb b/app/views/branded/guidances/admin_index.html.erb index 124ea81..28a7cea 100644 --- a/app/views/branded/guidances/admin_index.html.erb +++ b/app/views/branded/guidances/admin_index.html.erb @@ -4,7 +4,7 @@

<%= _('Guidance') %>

- <%= raw _("First create a guidance group. This could be organisation 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.") %> + <%= sanitize _("First create a guidance group. This could be organisation 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.") %>

diff --git a/app/views/branded/guidances/new_edit.html.erb b/app/views/branded/guidances/new_edit.html.erb index 1e5d170..8aca3dc 100644 --- a/app/views/branded/guidances/new_edit.html.erb +++ b/app/views/branded/guidances/new_edit.html.erb @@ -1,3 +1,13 @@ +<% +if @guidance.id.present? + url = admin_update_guidance_path(@guidance) + method = "PUT" +else + url = admin_create_guidance_path + method = "POST" +end +%> + <% title _('Guidance') %> <%# locals: { guidance, themes, guidance_groups, options } %>
@@ -8,21 +18,29 @@
- <%= form_for(guidance, url: options[:url], html: { method: options[:method] , id: 'new_edit_guidance'}) do |f| %> + <%= form_for(@guidance, url: url, html: { method: method , id: 'new_edit_guidance'}) do |f| %>
<%= f.label :text, class: 'control-label' %> - <%= text_area_tag("guidance-text", guidance.text, class: "form-control", 'aria-required': true, rows: 10) %> + <%= text_area_tag("guidance-text", @guidance.text, class: "form-control", 'aria-required': true, rows: 10) %>
<%= render partial: 'org_admin/shared/theme_selector', - locals: { f: f, all_themes: themes, as_radio: true, required: true, + locals: { f: f, all_themes: Theme.all.order("title"), as_radio: true, required: true, + in_error: @guidance.errors[:themes].present?, popover_message: _('Select one or more themes that are relevant to this guidance. This will display your generic organisation-level guidance, or any Schools/Departments for which you create guidance groups, across all templates that have questions with the corresponding theme tags.') } %>
<%= f.label _('Guidance group'), for: :guidance_group_id, class: 'control-label' %> - <%= f.collection_select(:guidance_group_id, guidance_groups, + <%= f.collection_select(:guidance_group_id, + GuidanceGroup.where(org_id: current_user.org_id).order("name ASC"), :id, :name, {prompt: false}, {multiple: false, 'data-toggle': 'tooltip', title: _('Select which group this guidance relates to.'), class: 'form-control', 'aria-required': true})%>
- <%= f.label :published, raw("#{f.check_box :published, as: :check_boxes, 'data-toggle': 'tooltip', title: _("Check this box when you are ready for this guidance to appear on user's plans.")} #{_('Published?')}") %> + <%= f.label :published do %> + <%= f.check_box :published, + as: :check_boxes, + data: { toggle: 'tooltip' }, + title: _("Check this box when you are ready for this guidance to appear on user's plans.") %> + <%= _('Published?') %> + <% end %>
<%= f.submit _('Save'), name: "edit_guidance_submit", class: "btn btn-primary" %> diff --git a/app/views/branded/layouts/_branding.html.erb b/app/views/branded/layouts/_branding.html.erb index 7e193d5..025a954 100644 --- a/app/views/branded/layouts/_branding.html.erb +++ b/app/views/branded/layouts/_branding.html.erb @@ -10,7 +10,7 @@ <% if user_signed_in? && !current_user.org.nil? %> <% if current_user.org.logo.present? %> - <%= link_to(image_tag(current_user.org.logo.thumb('100x100%').url, + <%= link_to(image_tag(logo_url_for_org(current_user.org), alt: current_user.org.name, class: "org-logo", title: current_user.org.name), @@ -34,6 +34,7 @@ <%= link_to link['link'], :target=>'_blank', :class => 'org-a' do %> <%= link['text'].blank? ? link['link'] : link['text'] %> + (new window) <% end; i+=1 %> <% end %> <% end %> @@ -47,12 +48,13 @@ <% end %> <% end %> +
+ <% if !current_user.org.banner_text.nil? %> + <%= current_user.org.banner_text.html_safe %> + <% end %> +
<% end %> -
- <% if !current_user.org.banner_text.nil? %> - <%= current_user.org.banner_text.html_safe %> - <% end %> -
+
diff --git a/app/views/branded/layouts/_signin_signout.html.erb b/app/views/branded/layouts/_signin_signout.html.erb index 08731fa..8b5e9d8 100644 --- a/app/views/branded/layouts/_signin_signout.html.erb +++ b/app/views/branded/layouts/_signin_signout.html.erb @@ -1,5 +1,5 @@ -<% if MANY_LANGUAGES %> +<% if Language.many? %> <% else %> - <% if !isActivePage(root_path, true) %> + <% if !active_page?(root_path, true) %>
  • diff --git a/app/views/branded/layouts/application.html.erb b/app/views/branded/layouts/application.html.erb index c99e53d..02683c9 100644 --- a/app/views/branded/layouts/application.html.erb +++ b/app/views/branded/layouts/application.html.erb @@ -1,9 +1,10 @@ + <%= content_for?(:title) ? yield(:title) : _('%{application_name}') % { :application_name => Rails.configuration.branding[:application][:name] } %> - <%= favicon_link_tag "favicon.ico" %> + <%= favicon_link_tag "favicon.ico" %> - <%= stylesheet_link_tag fingerprinted_asset('application') %> - <%= javascript_include_tag fingerprinted_asset('vendor') %> - <%= javascript_include_tag fingerprinted_asset('application') %> + <%= stylesheet_link_tag(stylesheet_manifest_file) %> + <%= javascript_pack_tag(javascript_manifest_file) %> <%= javascript_tag do %> var options = { message: '<%= d_("dmpopidor", "By continuing to browse, you accept the use of cookies to measure the traffic of the website with the software Matomo. Those data are not personal, as they are anonymized. We followed directions from the CNIL and configured this tool so that its use does not require your consent.")%>', @@ -68,12 +68,13 @@
    <%= (has_alert or has_notice) ? 'show' : 'hide' %>" role="<%= (has_notice ? 'status' : (has_alert ? 'alert' : '')) %>"> <%= has_alert ? _('Error:') : _('Notice:') %> - <%= raw (has_alert ? alert : notice) %> + <%= sanitize (has_alert ? alert : notice) %> + <%= yield :errors %>
    <%= render "layouts/notifications", notifications: Notification.active_per_user(current_user) %> <%= yield %> @@ -89,22 +90,13 @@ <% constants_json = { + HOST: (Rails.env.development? || Rails.env.test? ? 'localhost' : Socket.gethostname), PASSWORD_MIN_LENGTH: 8, PASSWORD_MAX_LENGTH: 128, MAX_NUMBER_ORG_URLS: 3, MAX_NUMBER_GUIDANCE_SELECTIONS: 6, - VALIDATION_MESSAGE_DEFAULT: _('Please enter a valid value.'), - VALIDATION_MESSAGE_EMAIL: _('You must enter a valid email address.'), - VALIDATION_MESSAGE_URL: _('You must enter a valid URL (e.g. https://organisation.org).'), - VALIDATION_MESSAGE_NUMBER: _('Please enter a valid number.'), - VALIDATION_MESSAGE_PASSWORD: _('The password must be between 8 and 128 characters.'), - VALIDATION_MESSAGE_PASSWORDS_MATCH: _('The passwords must match.'), - VALIDATION_MESSAGE_RADIO: _('Please choose one of the options.'), - VALIDATION_MESSAGE_CHECKBOX: _('Please check the box to continue.'), - VALIDATION_MESSAGE_MULTI_CHECKBOX: _('Please select at least one of the options to continue.'), - VALIDATION_MESSAGE_SELECT: _('Please select a value from the list.'), - VALIDATION_MESSAGE_TEXT: _('This field is required.'), + REQUIRED_FIELD_TEXT: _('This field is required.'), SHOW_PASSWORD_MESSAGE: _('Show password'), SHOW_SELECT_ORG_MESSAGE: _('Select an organisation from the list.'), diff --git a/app/views/branded/org_admin/phases/container.html.erb b/app/views/branded/org_admin/phases/container.html.erb index 35e155f..df2e960 100644 --- a/app/views/branded/org_admin/phases/container.html.erb +++ b/app/views/branded/org_admin/phases/container.html.erb @@ -10,7 +10,8 @@
    - <%= render partial: "/org_admin/templates/navigation", locals: local_assigns.merge({ modifiable: modifiable }) %> + <%= render partial: "/org_admin/templates/navigation", + locals: local_assigns.merge({ modifiable: modifiable }) %>
    @@ -20,29 +21,62 @@

    <%= _('Phase details')%>

    - <%= link_to(_('Preview'), preview_org_admin_template_phase_path(template, phase), { class: 'btn btn-default phase_preview_link', role: 'button' }) %> + <%= link_to(_('Preview'), + preview_org_admin_template_phase_path(template, phase), + class: 'btn btn-default phase_preview_link', role: 'button') %>
    - <%= render partial: partial_path, locals: local_assigns.merge({ modifiable: modifiable }) %> + <%= render partial: partial_path, + locals: local_assigns.merge({ modifiable: modifiable }) %>

    <%= _('Sections') %>

    - <% if phase.sections.length > 1 %> -
    - + +
    + +
    + <% if phase.sections.many? %> + + <% end %>
    - <% end %> + +
    +
    + <% if template.latest? && (modifiable || template.customization_of.present?) %> + + <%= _("Drag arrows to rearrange sections.") %> + <% unless phase.sections.all?(&:modifiable?) %> + <%= _("You may place them before or after the main template sections.") %> + <% end %> + <% else %> + <%= link_to _('Re-order sections'), + org_admin_template_phase_versions_path(phase.template, phase), + method: "post", + class: "btn btn-primary btn-sm" %> + <% end %> +
    +
    +
    +
    - <%= render partial: 'org_admin/sections/index', locals: local_assigns.merge({ modifiable: modifiable }) %> + <%= render partial: 'org_admin/sections/index', + locals: local_assigns.merge(modifiable: modifiable) %>
    diff --git a/app/views/branded/org_admin/plans/index.html.erb b/app/views/branded/org_admin/plans/index.html.erb index 79dc2bc..0fa1410 100644 --- a/app/views/branded/org_admin/plans/index.html.erb +++ b/app/views/branded/org_admin/plans/index.html.erb @@ -35,6 +35,7 @@
    <% end %> <% if @plans.length > 0 %> + <%= link_to sanitize(_('Download plans (new window)')), org_admin_download_plans_path(format: :csv), target: '_blank', class: 'btn btn-default pull-right' %> <%= paginable_renderise( partial: '/paginable/plans/org_admin', controller: 'paginable/plans', diff --git a/app/views/branded/org_admin/question_options/_option_fields.html.erb b/app/views/branded/org_admin/question_options/_option_fields.html.erb index 1bb60f2..ab836c5 100644 --- a/app/views/branded/org_admin/question_options/_option_fields.html.erb +++ b/app/views/branded/org_admin/question_options/_option_fields.html.erb @@ -1,11 +1,11 @@
    -
    +
    <%= _('Order')%>
    - <%= _('Text')%> + <%= f.label(:text, _('Text'), class: "control-label") %>
    -
    +
    <%= _('Default')%>
    @@ -24,7 +24,11 @@ <%= op.number_field :number, min: 1, class: 'form-control' %>
    - <%= op.text_field :text, as: :string, class: 'form-control' %> + <% if i == 1 %> + <%= op.text_field :text, as: :string, class: 'form-control', 'aria-required': true %> + <% else %> + <%= op.text_field :text, as: :string, class: 'form-control' %> + <% end %>
    <%= op.check_box :is_default %> diff --git a/app/views/branded/org_admin/questions/_form.html.erb b/app/views/branded/org_admin/questions/_form.html.erb deleted file mode 100644 index ccf2757..0000000 --- a/app/views/branded/org_admin/questions/_form.html.erb +++ /dev/null @@ -1,79 +0,0 @@ -

    <%= question.id.present? ? _('Question %{number}:') % { number: question.number } : _('New question:') %>

    -<%= form_for(question, url: url, namespace: question.id.present? ? question.id : 'new_question', html: { method: method, class: 'question_form' }) do |f| %> - <% current_format = question.question_format.present? ? question.question_format : QuestionFormat.find_by(formattype: QuestionFormat.formattypes[:textarea]) %> - - -
    - <%= f.label(:number, _('Question Number'), class: "control-label") %> - <%= f.number_field(:number, in: 1..50, class: "form-control", 'aria-required': true) %> -
    - -
    - <%= f.label(:text, _('Question text'), class: "control-label") %> - <%= f.text_area(:text, class: "question", 'aria-required': true) %> -
    - -
    - <%= f.label(:question_format_id, _('Answer format'), class: "control-label") %> - <%= f.select :question_format_id, - options_from_collection_for_select(QuestionFormat.all.order("title"), - :id, - :title, - question.question_format_id), - {}, - class: "form-control question_format", - 'data-toggle': 'tooltip', - 'data-html': true, - title: _("You can choose from:
    • - text area (large box for paragraphs);
    • - text field (for a short answer);
    • - checkboxes where options are presented in a list and multiple values can be selected;
    • - radio buttons where options are presented in a list but only one can be selected;
    • - dropdown like this box - only one option can be selected;
    • - multiple select box allows users to select several options from a scrollable list, using the CTRL key;
    ") - %> -
    - -
    -
    - <%= render "/org_admin/question_options/option_fields", f: f, q: question %> - -
    -
    - <% comment_disp = current_format.option_based? || current_format.rda_metadata? %> -
    - -
    - -
    - <%= f.label(:default_value, _('Default answer'), class: "control-label") %> -
    - - <%= f.text_field(:default_value, class: 'form-control') %> - - - <%= text_area_tag('question[default_value]', question.default_value, id: "#{question.id.present? ? question.id : 'new'}_question_default_value_area", class: "form-control question") %> - -
    -
    - <%# example_answer and guidance annotations as nested fields %> - <% question.annotations_per_org(current_user.org_id).each do |annotation| %> - <%= f.fields_for(:annotations, annotation) do |annotation_fields| %> - <%= render partial: 'org_admin/annotations/form', locals: { f: annotation_fields } %> - <% end %> - <% end %> - -
    - <%= render partial: 'org_admin/shared/theme_selector', - locals: { f: f, all_themes: Theme.all.order("title"), as_radio: false, - popover_message: _('Select one or more themes that are relevant to this question. This will allow similarly themed organisation-level guidance to appear alongside your question.') } %> -
    -
    -
    - <%= f.submit _('Save'), class: "btn btn-default", role:'button' %> - <% if question.id.present? && !question.section.phase.template.published? %> - <% href = org_admin_template_phase_section_question_path(template_id: template.id, phase_id: question.section.phase.id, section_id: question.section.id, id: question.id) %> - <%= link_to _('Delete'), href, method: :delete, class: "btn btn-default", role:'button', 'data-confirm': _("You are about to delete question #%{question_number}. Are you sure?") % { question_number: question.number } %> - <%= link_to _('Cancel'), href, class: "btn btn-default ajaxified-question", method: 'get', remote: true %> - <% else %> - <%= link_to _('Cancel'), '#', class: "btn btn-default cancel-new-question" %> - <% end %> -
    -
    -<% end %> diff --git a/app/views/branded/org_admin/shared/_theme_selector.html.erb b/app/views/branded/org_admin/shared/_theme_selector.html.erb deleted file mode 100644 index 13dd640..0000000 --- a/app/views/branded/org_admin/shared/_theme_selector.html.erb +++ /dev/null @@ -1,45 +0,0 @@ -<%# locals: all_themes, as_radio & popover_message %> -<% as_radio ||= false %> -<% required ||= false %> - -
    -
    - <% if all_themes.length > 0 %> - <% - cntr = 0 - nbr_of_cols = (all_themes.length.to_f / MAX_NUMBER_THEMES_PER_COLUMN.to_f).ceil - col_size = (12 / (nbr_of_cols > 4 ? 3 : nbr_of_cols)).round - %> -
    - - <%= _('Themes') %> - <%= render partial: 'shared/popover', - locals: { message: popover_message, placement: 'right' }%> - - -
    - <% all_themes.each do |theme| %> - <% if cntr >= MAX_NUMBER_THEMES_PER_COLUMN %> -
    -
    - <% cntr = 0 %> - <% end %> -
    - <% namespace = f.object.class.name.downcase %> - <% id = f.object.id.present? ? f.object.id : 'new' %> - - value="<%= theme.id %>"<%= f.object.themes.include?(theme) ? ' checked="checked"' : '' %>> - <%= theme.title %> -
    - <% cntr += 1 %> - <% end %> -
    -
    - <% else %> -

    <%= _('No themes have been defined. Please contact your administrator for assistance.') %>

    - <% end %> -
    -
    \ No newline at end of file diff --git a/app/views/branded/org_admin/templates/_new.html.erb b/app/views/branded/org_admin/templates/_new.html.erb deleted file mode 100644 index 2e594ab..0000000 --- a/app/views/branded/org_admin/templates/_new.html.erb +++ /dev/null @@ -1,9 +0,0 @@ -
    -
    -
    - <%= form_for(template, url: org_admin_templates_path) do |f| %> - <%= render partial: 'form', locals: { template: template, referrer: referrer, f: f }%> - <% end %> -
    -
    -
    diff --git a/app/views/branded/org_admin/templates/history.html.erb b/app/views/branded/org_admin/templates/history.html.erb index 6360734..b1c3593 100644 --- a/app/views/branded/org_admin/templates/history.html.erb +++ b/app/views/branded/org_admin/templates/history.html.erb @@ -6,7 +6,9 @@ <%= link_to _('View all templates'), referrer, class: "btn btn-primary" %>
    -

    <%= raw _('Here you can view previously published versions of your template. These can no longer be modified.')%>

    +

    + <%= sanitize _('Here you can view previously published versions of your template. These can no longer be modified.')%> +

    diff --git a/app/views/branded/org_admin/templates/index.html.erb b/app/views/branded/org_admin/templates/index.html.erb index 9dc396e..3b07251 100644 --- a/app/views/branded/org_admin/templates/index.html.erb +++ b/app/views/branded/org_admin/templates/index.html.erb @@ -3,42 +3,64 @@

    <%= _('Templates') %>

    + <% if current_user.can_super_admin? %>
    -

    <%= _('If you would like to modify one of the templates below, you must first change your organisation affiliation.') %>

    +

    + <%= _('If you would like to modify one of the templates below, you must first change your organisation affiliation.') %> +

    - <%= form_for current_user, url: org_swap_user_path(current_user), namespace: 'superadmin', html: {method: :put, id: 'super-admin-switch-org'} do |f| %> - <%= render partial: "shared/my_org", locals: {f: f, default_org: current_user.org, orgs: orgs, allow_other_orgs: false} %> + <%= form_for current_user, url: user_org_swaps_path(current_user), + namespace: 'superadmin', + method: "post", + html: { id: 'super-admin-switch-org' } do |f| %> + <%= render partial: "shared/my_org", + locals: { f: f, + default_org: current_user.org, + orgs: @orgs, + allow_other_orgs: false + } %> <%= f.submit _('Change affiliation'), class: 'btn btn-default' %> <% end %>
    <% end %> +

    <%= _('If you wish to add an organisational 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 organisation when no funder templates apply. If you want to add questions to funder templates use the \'customise template\' options below.') %>

    +
    @@ -47,30 +69,44 @@
    -

    <%= title %>

    +

    <%= @title %>

    - <% filter_path = "/paginable/templates/#{action}/#{1}" %> - <% qry = query_params.collect{ |k,v| "#{k}=#{v}" }.join('&') %> + <% filter_path = "/paginable/templates/#{action_name}/#{1}" %> + <% qry = @query_params.collect{ |k,v| "#{k}=#{v}" }.join('&') %>
    <%= paginable_renderise( - partial: "paginable/templates/#{action}", + partial: "paginable/templates/#{action_name}", controller: 'paginable/templates', - action: action, - scope: templates, - query_params: { sort_field: 'templates.title', sort_direction: :asc }, - locals: local_assigns) %> + action: action_name, + scope: @templates, + query_params: @query_params, + locals: { customizations: @customizations }) %>
    diff --git a/app/views/branded/org_admin/templates/new.html.erb b/app/views/branded/org_admin/templates/new.html.erb new file mode 100644 index 0000000..7dd6211 --- /dev/null +++ b/app/views/branded/org_admin/templates/new.html.erb @@ -0,0 +1,30 @@ +
    +
    +

    <%= @template.id.present? ? template.title : _('New Template') %>

    + <%= link_to _('View all templates'), + org_admin_templates_path, + class: 'btn btn-default pull-right' %> +
    +
    + +
    +
    + + <%= render partial: "org_admin/templates/navigation", + locals: { template: @template } %> + +
    +
    +
    +
    +
    + <%= form_for([:org_admin, @template]) do |f| %> + <%= render 'form', { f: f }%> + <% end %> +
    +
    +
    +
    +
    +
    +
    diff --git a/app/views/branded/phases/_guidances_notes.html.erb b/app/views/branded/phases/_guidances_notes.html.erb deleted file mode 100644 index a564285..0000000 --- a/app/views/branded/phases/_guidances_notes.html.erb +++ /dev/null @@ -1,95 +0,0 @@ -<%# locals: { plan, template, question, answer, question_guidance, guidance_groups } %> -<% annotations = question.annotations.where(type: Annotation.types[:guidance]).where.not(text: [nil, ""]) %> -<% guidance_set = question_guidance[question.id] || {} %> -<% guidances_active = (annotations.present? || guidance_set.length > 0) %> -
    - - -
    -
    - -
    - <% if annotations.present? %> -
    -
    -
    - - <% num_annotations = 0 %> - <% i = 0 %> - <% annotations.each do |annotation| %> - <%= render partial: 'org_admin/annotations/show', - locals: { - template: template, - example_answer: (annotation.example_answer? ? annotation : nil), - guidance: (annotation.guidance? ? annotation : nil), - for_plan: true - } %> - <% num_annotations += 1%> - <% i += 1 %> - <% end %> -
    -
    -
    - <% end %> - <% guidance_accordion_id = 0 %> - <% guidance_set.keys.each_with_index do |group, i| %> - <% obj = guidance_groups.select{ |gg| gg.name == group }.first %> - <% if obj.present? %> - <% accordion_id = "#{question.id}-#{obj.id}" %> -
    -
    -
    - <%= render partial: 'guidance_groups/show', - locals: { group: guidance_set[group], question: question, guidance_accordion_id: "#{accordion_id}-#{i}" } %> -
    -
    -
    - <% end %> - <% end %> -
    -
    - - <% if plan.present? %> -
    - <%= render partial: '/notes/layout', locals: { plan: plan, question: question, answer: answer } %> -
    - <% end %> -
    -
    \ No newline at end of file diff --git a/app/views/branded/plans/_edit_details.html.erb b/app/views/branded/plans/_edit_details.html.erb index 6d0f294..1087935 100644 --- a/app/views/branded/plans/_edit_details.html.erb +++ b/app/views/branded/plans/_edit_details.html.erb @@ -10,8 +10,10 @@ title: _('If applying for funding, state the name exactly as in the grant proposal.')) %>
    <%= f.hidden_field :visibility %> - <%= f.hidden_field :default_visibility, value: Rails.configuration.default_plan_visibility %> - <%= f.label(:is_test, raw("#{check_box_tag(:is_test,1, @plan.is_test? , "aria-label": "is_test")} #{_('mock project for testing, practice, or educational purposes')}"), class: 'control-label') %> + <%= f.label(:is_test, class: 'control-label') do %> + <%= check_box_tag(:is_test, 1, @plan.is_test?, "aria-label": "is_test") %> + <%= _('mock project for testing, practice, or educational purposes') %> + <% end %>
    @@ -87,8 +89,7 @@ <%= f.email_field( :principal_investigator_email, class: "form-control", - "aria-required": false, - "data-validation": "email") %> + "aria-required": false) %>
    @@ -107,7 +108,10 @@ <%= _('Data contact person') %>
    <% checked = ((@plan.data_contact.present? || @plan.data_contact_phone.present? || @plan.data_contact_email.present?) ? 1 : 0) %> - <%= label_tag(:show_data_contact, raw("#{check_box_tag(:show_data_contact, checked, checked == 0)} #{_('Same as Principal Investigator')}"), class: 'control-label') %> + <%= label_tag(:show_data_contact, class: 'control-label') do %> + <%= check_box_tag(:show_data_contact, checked, checked == 0) %> + <%= _('Same as Principal Investigator') %> + <% end %>
    @@ -128,8 +132,7 @@ <%= f.email_field( :data_contact_email, class: "form-control", - "aria-required": false, - "data-validation": "email") %> + "aria-required": false) %>
    @@ -148,48 +151,58 @@

    <%= _('Plan Guidance Configuration') %>

    -

    <%= _('To help you write your plan, %{application_name} can show you guidance from a variety of organisations.') % - {application_name: Rails.configuration.branding[:application][:name]} %> -

    -
    -

    <%= _('Select up to 6 organisations to see their guidance.') %>

    -
      - <%= render partial: "guidance_choices", - locals: {choices: @important_ggs, form: f, - current_selections: @selected_guidance_groups} %> -
    -
    -

    <%= _('Find guidance from additional organisations below') %>

    - <%= link_to _('See the full list'), '#', 'data-toggle' => 'modal', 'data-target' => '#modal-full-guidances', class: 'modal-guidances-window' %> -
    - <%= f.button(_('Submit'), class: "btn btn-default", type: "submit") %> + <% if @all_guidance_groups.length > 0 %><% if @all_guidance_groups.length > 0 %> +

    <%= _('To help you write your plan, %{application_name} can show you guidance from a variety of organisations.') % + {application_name: Rails.configuration.branding[:application][:name]} %> +

    +
    +

    <%= _('Select up to 6 organisations to see their guidance.') %>

    +
      + <%= render partial: "guidance_choices", + locals: {choices: @important_ggs, form: f, + current_selections: @selected_guidance_groups} %> +
    +
    + + <% if @all_guidance_groups.length > @important_ggs.length %> +

    <%= _('Find guidance from additional organisations below') %>

    + <%= link_to _('See the full list'), '#', 'data-toggle' => 'modal', 'data-target' => '#modal-full-guidances', class: 'modal-guidances-window' %> + <% end %> +
    + <%= f.button(_('Save'), class: "btn btn-default", type: "submit") %> + + <% else %> +

    <%= _("There is no additional guidance for this template.") %>

    + <% end %>
    - diff --git a/app/views/branded/users/admin_index.html.erb b/app/views/branded/users/admin_index.html.erb index 6e97654..20e4b1e 100644 --- a/app/views/branded/users/admin_index.html.erb +++ b/app/views/branded/users/admin_index.html.erb @@ -4,22 +4,31 @@

    <%= _('User accounts') %>

    <%= _('Total ') + @total_users.to_s %>

    +
    +
    + +
    +

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

    + <%- # Only display Download Csv button for non super-admin users -%> + <% if !current_user.can_super_admin? %> + <%= button_to _('Download users'), admin_index_users_path(format: 'csv'), class: 'btn btn-default pull-right', method: 'get' %> + <% end %>
    <%= paginable_renderise( partial: '/paginable/users/index', controller: 'paginable/users', action: 'index', scope: @users, - view_all: !current_user.can_super_admin?, - query_params: { sort_field: 'users.last_sign_in_at', sort_direction: 'DESC' }) %> + view_all: !current_user.can_super_admin?) %>
    diff --git a/app/views/shared/export/_plan_styling.erb b/app/views/shared/export/_plan_styling.erb index da1685c..3ed931b 100644 --- a/app/views/shared/export/_plan_styling.erb +++ b/app/views/shared/export/_plan_styling.erb @@ -1,7 +1,6 @@