diff --git a/app/views/devise/registrations/_external_identifier_shibboleth.html.erb b/app/views/devise/registrations/_external_identifier_shibboleth.html.erb index 1a33004..65ca8fb 100644 --- a/app/views/devise/registrations/_external_identifier_shibboleth.html.erb +++ b/app/views/devise/registrations/_external_identifier_shibboleth.html.erb @@ -16,7 +16,6 @@ <% title = _("Unlink your account from #{scheme.description}. You can link again at any time.") %> <%= link_to ''.html_safe, destroy_user_identifier_path(id), method: :delete, title: title, 'aria-label': title, - 'data-toggle': "modal", 'dialog-width': "450px", data: {confirm: _("Are you sure you want to unlink #{scheme.description} ID?")} %> <% end %> \ No newline at end of file diff --git a/app/views/devise/registrations/_personal_details.html.erb b/app/views/devise/registrations/_personal_details.html.erb index 692c43c..5ed5eb3 100644 --- a/app/views/devise/registrations/_personal_details.html.erb +++ b/app/views/devise/registrations/_personal_details.html.erb @@ -119,10 +119,3 @@ <% end %> - - - diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb index 0c689be..5976167 100644 --- a/app/views/devise/registrations/new.html.erb +++ b/app/views/devise/registrations/new.html.erb @@ -1,7 +1,7 @@

<%= _('Create account') %>

<% unless session["devise.shibboleth_data"].nil? %>

- <%= (_("%{application_name} doesn't recognise your institutional credentials - either you haven't created an account with us or you haven't linked these details to your existing account.
* If you do not have an account with %{application_name}, please complete the form below.
* If you have an account with %{application_name}, please Sign in so we can link your account to your institutional credentials.
Once you have created and/or linked your account, you'll be able to sign in with your institutional credentials directly.") % { :application_name => Rails.configuration.branding[:application][:name] }).html_safe %> + <%= (_("%{application_name} doesn't recognise your institutional credentials - either you haven't created an account with us or you haven't linked these details to your existing account.
* If you do not have an account with %{application_name}, please complete the form below.
* If you have an account with %{application_name}, please so we can link your account to your institutional credentials.
Once you have created and/or linked your account, you'll be able to sign in with your institutional credentials directly.") % { :application_name => Rails.configuration.branding[:application][:name] }).html_safe %>

<% cookies[:show_shib_link] = { value: 'show_shib_link', expires: 3.hours.from_now } %> <% end %> diff --git a/app/views/guidances/_DELETE_add_guidance.html.erb b/app/views/guidances/_DELETE_add_guidance.html.erb deleted file mode 100644 index c0586f3..0000000 --- a/app/views/guidances/_DELETE_add_guidance.html.erb +++ /dev/null @@ -1,87 +0,0 @@ - -
- <%= form_for :guidance, url: {action: "admin_create"}, html: {id: "new_guidance_form"} do |f| %> - - - - - - - - - - - - - - - - - -
<%= _('Text') %> -
- <%= text_area_tag("guidance-text", "", class: "tinymce") %> -
-
- - -
-
-
<%= _('Should this guidance apply:') %> - -
<%= _('Published') %> -
- <%= f.check_box :published , as: :check_boxes %> -
-
<%= _('Guidance group') %> -
- <%= f.collection_select(:guidance_group_ids, - GuidanceGroup.where(org_id: current_user.org_id).order("name ASC"), - :id, :name, {prompt: false, include_blank: _('None')}, {multiple: false})%> -
-
- - -
-
-
- - - -
- <%= _('Save')%> - - <%= link_to _('Cancel'), :back, class: "btn cancel" %> -
-
- <% end %> -
- - - - - \ No newline at end of file diff --git a/app/views/guidances/admin_edit.html.erb b/app/views/guidances/admin_edit.html.erb index c260533..b5e351c 100644 --- a/app/views/guidances/admin_edit.html.erb +++ b/app/views/guidances/admin_edit.html.erb @@ -1,5 +1,3 @@ -<% javascript 'views/guidances/admin_edit.js' %> -

<%= _('Guidance') %>

@@ -42,7 +40,7 @@
- + \ No newline at end of file diff --git a/app/views/guidances/admin_new.html.erb b/app/views/guidances/admin_new.html.erb index d86038c..9f4899a 100644 --- a/app/views/guidances/admin_new.html.erb +++ b/app/views/guidances/admin_new.html.erb @@ -43,7 +43,7 @@ - + \ No newline at end of file diff --git a/app/views/layouts/_signin_signout.html.erb b/app/views/layouts/_signin_signout.html.erb index 613520d..062ed85 100644 --- a/app/views/layouts/_signin_signout.html.erb +++ b/app/views/layouts/_signin_signout.html.erb @@ -10,9 +10,7 @@ <% else %> <% if !isActivePage(root_path) %> - - <%= _('Sign in')%> - + | <% end %> <% end %> @@ -32,7 +30,5 @@ <% end %> <% if !user_signed_in? && !isActivePage(root_path) then %> - + <%= render partial: 'shared/login_form', layout: 'shared/modal', locals: { id: "header-signin", title: _('Sign in') } %> <% end %> diff --git a/app/views/orgs/shibboleth_ds.html.erb b/app/views/orgs/shibboleth_ds.html.erb index 763fc4c..3baca32 100644 --- a/app/views/orgs/shibboleth_ds.html.erb +++ b/app/views/orgs/shibboleth_ds.html.erb @@ -78,7 +78,11 @@

- <%= _('Institution not in the list?') %> <%= _('Create an account with any email address')%> + <%= _('Institution not in the list?') %>  +

+ <%= render partial: 'shared/signin' %> diff --git a/app/views/phases/edit.html.erb b/app/views/phases/edit.html.erb index 18c914c..cf89c4c 100644 --- a/app/views/phases/edit.html.erb +++ b/app/views/phases/edit.html.erb @@ -1,4 +1,3 @@ -<% javascript('views/answers/status.js') %> - - @@ -157,11 +129,4 @@ - - - -
-<%= render :partial => "plans/export", locals: {plan: @plan, plan_data: @plan_data, phase: @phase } %> -
\ No newline at end of file + \ No newline at end of file diff --git a/app/views/plans/_guidance_settings.html.erb b/app/views/plans/_guidance_settings.html.erb deleted file mode 100644 index 562f421..0000000 --- a/app/views/plans/_guidance_settings.html.erb +++ /dev/null @@ -1,9 +0,0 @@ - \ No newline at end of file diff --git a/app/views/shared/_modal.html.erb b/app/views/shared/_modal.html.erb new file mode 100644 index 0000000..f0787c4 --- /dev/null +++ b/app/views/shared/_modal.html.erb @@ -0,0 +1,23 @@ + + \ No newline at end of file diff --git a/app/views/shared/_signin.html.erb b/app/views/shared/_signin.html.erb index c482f92..dfc7c9b 100644 --- a/app/views/shared/_signin.html.erb +++ b/app/views/shared/_signin.html.erb @@ -7,15 +7,11 @@ <%= _('Create Account') %> -
-
+
<%= render :partial => 'shared/login_form' %>
- - diff --git a/lib/assets/javascripts/application.js b/lib/assets/javascripts/application.js index 8ba5321..193f07d 100644 --- a/lib/assets/javascripts/application.js +++ b/lib/assets/javascripts/application.js @@ -40,6 +40,8 @@ //= require utils/ariatiseForm.js // views JS files +//= require views/answers/status.js +//= require views/guidances/admin_edit.js //= require views/notes/add.js //= require views/notes/show.js //= require views/notes/edit.js @@ -49,7 +51,6 @@ // Rest of JS files //= require dmproadmap/accordions.js //= require dmproadmap/forms.js -//= require dmproadmap/modals.js //= require dmproadmap/tables.js // require dmproadmap/tabs.js //= require views/shared/login_form.js diff --git a/lib/assets/javascripts/dmproadmap/admin.js b/lib/assets/javascripts/dmproadmap/admin.js index 22bae39..56ed6f0 100644 --- a/lib/assets/javascripts/dmproadmap/admin.js +++ b/lib/assets/javascripts/dmproadmap/admin.js @@ -238,104 +238,11 @@ $('#new_guidance_alert_dialog').modal("hide"); }); -// TODO: This seems to duplicate the functionality in #edit_guidance_submit - $('#new_guidance_submit').click( function(e){ - // $('#new_guidance_alert_dialog').on("hide", function(){ - - var alert_message = []; - //verify if text area is not nil - var editorContent = tinyMCE.get('guidance-text').getContent(); - if (editorContent == ''){ - alert_message.push(__('add guidance text')); - } - //verify if themes are selected - if($('#guidance_theme_ids').val() == undefined || $('#guidance_theme_ids').val() == ''){ - alert_message.push(__('select at least one theme')); - } - //verify if guidance group is selected - if ( ($('#guidance_guidance_group_id').val() == '') || $('#guidance_guidance_group_id').val() == undefined ) { - alert_message.push(__('select a guidance group')); - } - if(alert_message.length == 0){ - //clear dropdowns before submission - $('#new_guidance_alert_dialog').modal("hide"); - - if ($('#g_options').val() == '2'){ - $('#guidance_theme_ids').val(null); - } - if($('#g_options').val() == '1'){ - $('#questions_select').val(null); - } - $('#new_guidance_form').submit(); - return false; - - } - else if (alert_message.length != 0){ - var message = ''; - $('#new_guidance_alert_dialog').on("show", function(){ - - $("#missing_fields_new_guidance").empty(); - $.each(alert_message, function(key, value){ - message += "
  • "+value+"
  • "; - }); - $("#missing_fields_new_guidance").append(message); - }); - delete message; - } - delete alert_message; - e.preventDefault(); - }); - //edit guidance alerts $("#return_to_edit_guidance").click(function(){ $('#edit_guidance_alert_dialog').modal("hide"); }); - - $('#edit_guidance_submit').click( function(e){ - // $('#new_guidance_alert_dialog').on("hide", function(){ - - var alert_message = []; - //verify if text area is not nil - var editorContent = tinyMCE.get('guidance-text').getContent(); - if (editorContent == ''){ - alert_message.push(__('add guidance text')); - } - //verify dropdown with questions has a selected option if guidance for a question being used - if($('#guidance_theme_ids').val() == undefined || $('#guidance_theme_ids').val() == ''){ - alert_message.push(__('select at least one theme')); - } - //verify if guidance group is selected - if ( ($('#guidance_guidance_group_id').val() == '') || $('#guidance_guidance_group_id').val() == undefined ) { - alert_message.push(__('select a guidance group')); - } - - if(alert_message.length == 0){ - //clear dropdowns before submission - $('#edit_guidance_alert_dialog').modal("hide"); - - if ($('#g_options').val() == '2'){ $('#guidance_theme_ids').val(null);} - if($('#g_options').val() == '1'){$('#questions_select').val(null);} - $('#edit_guidance_form').submit(); - return false; - } - else if (alert_message.length != 0){ - var message = ''; - $('#edit_guidance_alert_dialog').on("show", function(){ - - $("#missing_fields_edit_guidance").empty(); - $.each(alert_message, function(key, value){ - message += "
  • "+value+"
  • "; - }); - $("#missing_fields_edit_guidance").append(message); - }); - delete message; - } - delete alert_message; - e.preventDefault(); - }); - - //Validate banner_text area for less than 165 character $("form#edit_org_details").submit(function(){ if (getStats('org_banner_text').chars > 165) { diff --git a/lib/assets/javascripts/dmproadmap/modals.js b/lib/assets/javascripts/dmproadmap/modals.js deleted file mode 100644 index 2397348..0000000 --- a/lib/assets/javascripts/dmproadmap/modals.js +++ /dev/null @@ -1,35 +0,0 @@ -$(document).ready(function(){ - $("[data-toggle='modal']").click(function(e){ - e.preventDefault(); - var self = $(this), - target = ''; - - if($(this).prop('tagName') == 'a'){ - target = new URL($(this).prop('href')).hash; - }else{ - target = $(this).attr('href'); - } - - $(target).dialog({ - modal: true, - width: ($(self).attr('dialog-width') == undefined ? 'auto' : $(self).attr('dialog-width')), - title: $(self).html(), - - open: function(e, ui){ - $("button.ui-dialog-titlebar-close").remove(); - $(".ui-dialog-titlebar").append('' + __('Close') + ''); - - if($(self).is(".no-header")){ - $('.ui-dialog-title').remove(); - $('.ui-dialog-titlebar').css('border', 'none').css('height', '45px').css('padding-bottom', '0'); - } - - $("span.modal-close").click(function(e){ - e.preventDefault(); - $(this).parent(".ui-dialog-titlebar").siblings("div.modal").dialog('close'); - }); - } - }); - }); -}); diff --git a/lib/assets/javascripts/views/guidances/admin_edit.js b/lib/assets/javascripts/views/guidances/admin_edit.js index 9ffa069..31a99e1 100644 --- a/lib/assets/javascripts/views/guidances/admin_edit.js +++ b/lib/assets/javascripts/views/guidances/admin_edit.js @@ -16,8 +16,6 @@ alert_message.push(__('select a guidance group')); } -console.log("here: " + alert_message.length); - if(alert_message.length == 0){ $('#edit_guidance_form').submit(); return false;