From 89f25ffae778992c6834ce9b9d9e0c4eb476923d Mon Sep 17 00:00:00 2001 From: Jan-Willem van der Meer Date: Mon, 1 Sep 2014 09:24:45 +0200 Subject: [PATCH 1/2] Render correct layout, css fix empty state of ldap links Fixes #157 --- app/controllers/groups/ldap_group_links_controller.rb | 2 ++ app/views/ldap_group_links/_ldap_group_links.html.haml | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/groups/ldap_group_links_controller.rb b/app/controllers/groups/ldap_group_links_controller.rb index e1a0a56229..e654726b57 100644 --- a/app/controllers/groups/ldap_group_links_controller.rb +++ b/app/controllers/groups/ldap_group_links_controller.rb @@ -2,6 +2,8 @@ class Groups::LdapGroupLinksController < ApplicationController before_action :group before_action :authorize_admin_group! + layout 'group' + def index end diff --git a/app/views/ldap_group_links/_ldap_group_links.html.haml b/app/views/ldap_group_links/_ldap_group_links.html.haml index df1bb41266..6b8fe0f27f 100644 --- a/app/views/ldap_group_links/_ldap_group_links.html.haml +++ b/app/views/ldap_group_links/_ldap_group_links.html.haml @@ -8,4 +8,5 @@ %ul.well-list = render collection: group.ldap_group_links, partial: 'ldap_group_links/ldap_group_link', locals: { group: group } - else - %p No linked LDAP groups + .panel-body + No linked LDAP groups From bac04b220b582be7295f71f5a1fd35114cedc421 Mon Sep 17 00:00:00 2001 From: Jan-Willem van der Meer Date: Mon, 1 Sep 2014 10:05:08 +0200 Subject: [PATCH 2/2] admin group edits now redirect to group#show on success --- app/controllers/groups/ldap_group_links_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/groups/ldap_group_links_controller.rb b/app/controllers/groups/ldap_group_links_controller.rb index e654726b57..1e1e468155 100644 --- a/app/controllers/groups/ldap_group_links_controller.rb +++ b/app/controllers/groups/ldap_group_links_controller.rb @@ -10,7 +10,11 @@ class Groups::LdapGroupLinksController < ApplicationController def create ldap_group_link = @group.ldap_group_links.build(ldap_group_link_params) if ldap_group_link.save - redirect_to :back, notice: 'New LDAP link saved' + if request.referer && request.referer.include?('admin') + redirect_to [:admin, @group], notice: 'New LDAP link saved' + else + redirect_to :back, notice: 'New LDAP link saved' + end else redirect_to :back, alert: 'Could not create new LDAP link' end