diff --git a/app/controllers/orgs_controller.rb b/app/controllers/orgs_controller.rb index a8f9835..a3e50bf 100644 --- a/app/controllers/orgs_controller.rb +++ b/app/controllers/orgs_controller.rb @@ -1,5 +1,5 @@ class OrgsController < ApplicationController - after_action :verify_authorized + after_action :verify_authorized, except: ['shibboleth_ds'] respond_to :html ## @@ -44,6 +44,12 @@ end end + # GET /orgs/shibboleth_ds + def shibboleth_ds + # Display the custom Shibboleth discovery service page. + @orgs = Org.joins(:identifier_schemes).where('identifier_schemes.name = ?', 'shibboleth').sort{|x,y| x.name <=> y.name } + end + private def org_params params.require(:org).permit(:name, :abbreviation, :target_url, :is_other, :banner_text, :language_id, diff --git a/app/controllers/users/omniauth_callbacks_controller.rb b/app/controllers/users/omniauth_callbacks_controller.rb index 3aea62e..05796af 100644 --- a/app/controllers/users/omniauth_callbacks_controller.rb +++ b/app/controllers/users/omniauth_callbacks_controller.rb @@ -1,16 +1,5 @@ class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController - # GET /users/auth/shibboleth (user_shibboleth_omniauth_authorize_path) - # ------------------------------------------------------------- - def passthru - puts "HEADERS!!!!!!!!" - puts @request.headers.inspect - puts "BODY!!!!!!!!" - puts @request.body.inspect - puts "ENV!!!!!!!!" - puts @request.env.inspect - end - ## # Dynamically build a handler for each omniauth provider # ------------------------------------------------------------- diff --git a/app/policies/org_policy.rb b/app/policies/org_policy.rb index 311d389..fd67d33 100644 --- a/app/policies/org_policy.rb +++ b/app/policies/org_policy.rb @@ -30,5 +30,4 @@ def templates? true end - end \ No newline at end of file diff --git a/app/views/orgs/_shibboleth_ds_list.html.erb b/app/views/orgs/_shibboleth_ds_list.html.erb new file mode 100644 index 0000000..c4c59a7 --- /dev/null +++ b/app/views/orgs/_shibboleth_ds_list.html.erb @@ -0,0 +1,14 @@ +
+ <% letter = '' %> + +
\ No newline at end of file diff --git a/app/views/orgs/shibboleth_ds.html.erb b/app/views/orgs/shibboleth_ds.html.erb new file mode 100644 index 0000000..935270b --- /dev/null +++ b/app/views/orgs/shibboleth_ds.html.erb @@ -0,0 +1,37 @@ +<% javascript 'orgs/shibboleth_ds.js'%> + +

Find your institution to sign in

+ +
+
+
+ + + <%= render partial: "shared/accessible_combobox", + locals: {name: 'org_name', + id: 'org_name', + default_selection: nil, + models: @orgs, + attribute: 'name', + classes: 'fixed-width-large'} %> + +

+ - <%= _('or') %> - +
+ <%= _('See the full list of partner institutions') %> +

+ + + +
+ +

+ <%= _('Institution not a DMPTool partner?') %> <%= _('Create an account with any email address')%> +

+
+
+
diff --git a/app/views/shared/_login_form.html.erb b/app/views/shared/_login_form.html.erb index ebfd496..9f5db74 100644 --- a/app/views/shared/_login_form.html.erb +++ b/app/views/shared/_login_form.html.erb @@ -3,7 +3,8 @@ <% if request.fullpath != "/users/sign_up?nosplash=true" && session[:shibboleth_data].nil? then%> - <%else%> @@ -54,5 +55,4 @@ - <% end %> \ No newline at end of file diff --git a/config/application.rb b/config/application.rb index f09a873..eb7f16a 100644 --- a/config/application.rb +++ b/config/application.rb @@ -90,6 +90,7 @@ plans/new_plan.js contacts/new_contact.js home/index.js + orgs/shibboleth_ds.js shared/login_form.js shared/register_form.js) @@ -113,7 +114,7 @@ # will be driven out to your federation's discovery service # # A super admin will also be able to associate orgs with their shibboleth entityIds if this is set to true - config.shibboleth_use_filtered_discovery_service = false + config.shibboleth_use_filtered_discovery_service = true # Active Record will no longer suppress errors raised in after_rollback or after_commit # in the next version. Devise appears to be using those callbacks. diff --git a/config/routes.rb b/config/routes.rb index 42bfe18..8f87b9a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -51,6 +51,8 @@ delete '/users/identifiers/:id', to: 'user_identifiers#destroy', as: 'destroy_user_identifier' + get '/orgs/shibboleth', to: 'orgs#shibboleth_ds', as: 'shibboleth_ds' + #ActiveAdmin.routes(self) #organisation admin area diff --git a/lib/assets/javascripts/orgs/shibboleth_ds.js b/lib/assets/javascripts/orgs/shibboleth_ds.js new file mode 100644 index 0000000..a2e370d --- /dev/null +++ b/lib/assets/javascripts/orgs/shibboleth_ds.js @@ -0,0 +1,13 @@ +$(document).ready(function(){ + $("#show_list").click(function(e){ + e.preventDefault(); + $("#full_list").show(); + $(this).html(__('Hide list')); + }); + + $("#hide_list").click(function(e){ + e.preventDefault(); + $("#full_list").hide(); + $(this).html(__('See the full list of partner institutions')); + }); +}); \ No newline at end of file diff --git a/lib/assets/stylesheets/roadmap-form.scss b/lib/assets/stylesheets/roadmap-form.scss index 5bcc0ce..b443462 100644 --- a/lib/assets/stylesheets/roadmap-form.scss +++ b/lib/assets/stylesheets/roadmap-form.scss @@ -386,4 +386,8 @@ } #new_user #password-reset-form { width: 50%; +} + +#shibboleth-ds { + width: 50%; } \ No newline at end of file diff --git a/lib/assets/stylesheets/roadmap.scss b/lib/assets/stylesheets/roadmap.scss index 9537b86..7471041 100644 --- a/lib/assets/stylesheets/roadmap.scss +++ b/lib/assets/stylesheets/roadmap.scss @@ -8,6 +8,7 @@ $error-color: #CC0000; $error-background: #FFE6E6; $dark-grey: #333; +$medium-grey: #827D7E; $light-grey: #CCC; $primary-color: #F49700; @@ -35,6 +36,14 @@ margin-bottom: 20px; } +.content { + width: 98%; + background-color: $white; + border-radius: 3px; + margin-top: 25px; + padding: 10px 20px; +} + .content-two-column { width: 98%; @@ -64,4 +73,14 @@ border-bottom: 0px; margin-bottom: 20px; table-layout: fixed; +} + +div.three-column { + ul li.separator { + background-color: $medium-grey; + color: $white; + font-weight: bold; + padding: 4px 12px; + margin-top: 5px; + } } \ No newline at end of file