diff --git a/Gemfile b/Gemfile index 0f656ba..314e27e 100644 --- a/Gemfile +++ b/Gemfile @@ -46,7 +46,6 @@ gem 'contact_us' # COULD BE EASILY REPLACED WITH OUR OWN CODE gem 'recaptcha' gem 'dragonfly' # LOGO UPLOAD -gem 'formtastic' # ------------------------------------------------ # EXPORTING diff --git a/Gemfile.lock b/Gemfile.lock index 2c2ea35..29f1a92 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -84,8 +84,6 @@ loofah (>= 2.0) sax-machine (>= 1.0) flag_shih_tzu (0.3.19) - formtastic (3.1.5) - actionpack (>= 3.2.13) gettext (3.2.9) locale (>= 2.0.5) text (>= 1.3.0) @@ -257,7 +255,6 @@ dragonfly feedjira flag_shih_tzu - formtastic gettext gettext_i18n_rails gettext_i18n_rails_js diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 5482157..b35f965 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -161,7 +161,7 @@ private def org_swap_params - params.require(:superadmin_user).permit(:org_id, :org_name) + params.require(:user).permit(:org_id, :org_name) end ## diff --git a/app/views/devise/registrations/_personal_details.html.erb b/app/views/devise/registrations/_personal_details.html.erb index 6a19985..19c1d10 100644 --- a/app/views/devise/registrations/_personal_details.html.erb +++ b/app/views/devise/registrations/_personal_details.html.erb @@ -1,4 +1,4 @@ -<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: {method: :put, id: 'personal_details_registration_form' }) do |f| %> +<%= form_for(resource, namespace: current_user.id, as: resource_name, url: registration_path(resource_name), html: {method: :put, id: 'personal_details_registration_form' }) do |f| %>

<%= raw _("Please note that your email address is used as your username. If you change this, remember to use your new email address on sign in.") %>

@@ -24,7 +24,7 @@ <% org_admin = (current_user.can_org_admin? && !current_user.can_super_admin?) %>
> - <%= render partial: "shared/my_org", locals: {f: f, default_org: @default_org, orgs: @orgs, allow_other_orgs: true} %> + <%= render partial: "shared/my_org", locals: {f: f, default_org: @default_org, orgs: @orgs, allow_other_orgs: true, required: true} %>
<% if org_admin %> diff --git a/app/views/org_admin/templates/_form.html.erb b/app/views/org_admin/templates/_form.html.erb index 429e15e..81af474 100644 --- a/app/views/org_admin/templates/_form.html.erb +++ b/app/views/org_admin/templates/_form.html.erb @@ -51,7 +51,7 @@ <% end %> <% if template.org.funder? %> -
+
<%= render(partial: '/shared/links', locals: { context: 'funder', @@ -60,7 +60,7 @@ max_number_links: MAX_NUMBER_LINKS_FUNDER, tooltip: _('Add links to funder websites that provide additional information about the requirements for this template') }) %>
-
+
<%= render(partial: '/shared/links', locals: { context: 'sample_plan', diff --git a/app/views/orgs/_profile_form.html.erb b/app/views/orgs/_profile_form.html.erb index fc4bd65..d08b0ff 100644 --- a/app/views/orgs/_profile_form.html.erb +++ b/app/views/orgs/_profile_form.html.erb @@ -31,7 +31,7 @@
-
+
<%= render(partial: '/shared/links', locals: { context: 'org', @@ -51,7 +51,7 @@
<%= f.label :contact_email, _('Contact email'), class: "control-label" %> - <%= f.text_field :contact_email, class: "form-control" %> + <%= f.text_field :contact_email, class: "form-control", 'aria-required': true %>
<%= f.label :contact_name, _('Link text'), class: "control-label" %> diff --git a/app/views/orgs/admin_edit.html.erb b/app/views/orgs/admin_edit.html.erb index 2039176..bf3e7fa 100644 --- a/app/views/orgs/admin_edit.html.erb +++ b/app/views/orgs/admin_edit.html.erb @@ -20,18 +20,29 @@ <% end %> - -
-
- <%= render partial: 'orgs/profile_form', locals: local_assigns %> -
- <% if org.id.present? %> -
- <%= render partial: 'orgs/feedback_form', locals: local_assigns %> + +
+
+
+
+
+ <%= render partial: 'orgs/profile_form', locals: local_assigns %> +
+
- <% end %> +
+
+
+
+ <% if org.id.present? %> +
+ <%= render partial: 'orgs/feedback_form', locals: local_assigns %> +
+ <% end %> +
+
+
- diff --git a/app/views/orgs/shibboleth_ds.html.erb b/app/views/orgs/shibboleth_ds.html.erb index 8171809..570f72f 100644 --- a/app/views/orgs/shibboleth_ds.html.erb +++ b/app/views/orgs/shibboleth_ds.html.erb @@ -7,7 +7,7 @@
- <%= form_for 'shibboleth_ds', url: shibboleth_ds_path, html: {id: 'shibboleth_ds'} do |f| %> + <%= form_for 'shibboleth_ds', url: shibboleth_ds_path, namespace: 'shib-ds', html: {id: 'shibboleth_ds'} do |f| %>
<%= f.label(:org_name, _('Look up your organisation here'), class: "control-label") %> diff --git a/app/views/plans/new.html.erb b/app/views/plans/new.html.erb index 5eb8eb2..963960e 100644 --- a/app/views/plans/new.html.erb +++ b/app/views/plans/new.html.erb @@ -13,7 +13,7 @@
<%= form_for Plan.new, url: plans_path do |f| %> -

<%= _('What research project are you planning?') %>

+

* <%= _('What research project are you planning?') %>

<%= f.text_field(:title, class: 'form-control', 'aria-describedby': 'project-title', 'aria-required': 'true', 'aria-label': 'project-title', @@ -27,7 +27,7 @@
-

<%= _('Select the primary research organisation') %>

+

* <%= _('Select the primary research organisation') %>

<%= render partial: "shared/accessible_combobox", @@ -50,7 +50,7 @@
-

<%= _('Select the primary funding organisation') %>

+

* <%= _('Select the primary funding organisation') %>

<%= render partial: "shared/accessible_combobox", diff --git a/app/views/shared/_accessible_combobox.html.erb b/app/views/shared/_accessible_combobox.html.erb index 0a06f81..c0a6856 100644 --- a/app/views/shared/_accessible_combobox.html.erb +++ b/app/views/shared/_accessible_combobox.html.erb @@ -6,7 +6,8 @@ <% json = {} %> <% models.map{|m| json["#{m[attribute]}"] = m.id} %> - + + <% name = name.gsub(name.match(/^.*\[/)[0].split('_')[0] + '_', '') %> " name="<%= name.gsub("_#{attribute}]", "_id]") %>" value="<%= default_selection.id unless default_selection.nil? %>" aria-required="<%= required %>" - data-validation="js-combobox" data-validation-error="<%= error %>" /> + class="org-id" data-validation="js-combobox" data-validation-error="<%= error %>" /> <% else %> <%= _('No items available.') %> diff --git a/app/views/shared/_create_account_form.html.erb b/app/views/shared/_create_account_form.html.erb index ce35c59..6880aa8 100644 --- a/app/views/shared/_create_account_form.html.erb +++ b/app/views/shared/_create_account_form.html.erb @@ -1,4 +1,4 @@ -<%= form_for resource, as: 'user', url: registration_path("user"), html: {autocomplete: "off", id: "create_account_form"} do |f| %> +<%= form_for resource, as: 'user', namespace: 'new_user', url: registration_path("user"), html: {autocomplete: "off", id: "create_account_form"} do |f| %>
<%= f.label(:firstname, _('First Name'), class: "control-label") %> @@ -15,7 +15,8 @@
<%= render partial: "shared/my_org", locals: {f: f, default_org: @default_org, - orgs: Org.where("parent_id IS NULL").order("sort_name ASC, name ASC"), allow_other_orgs: true} %> + orgs: Org.where("parent_id IS NULL").order("sort_name ASC, name ASC"), + allow_other_orgs: true, required: true} %>
diff --git a/app/views/shared/_links.html.erb b/app/views/shared/_links.html.erb index 1f3300c..a288fa1 100644 --- a/app/views/shared/_links.html.erb +++ b/app/views/shared/_links.html.erb @@ -20,15 +20,15 @@ <% links.each_with_index do |l, i| %>