From 26ad250989d82b496b131811f8a0ddd7e662b650 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Thu, 30 Apr 2015 19:06:18 +0200 Subject: Add a page title to every page. --- app/controllers/groups/application_controller.rb | 11 +++++------ app/controllers/groups/avatars_controller.rb | 2 -- app/controllers/groups/milestones_controller.rb | 4 +--- 3 files changed, 6 insertions(+), 11 deletions(-) (limited to 'app/controllers/groups') diff --git a/app/controllers/groups/application_controller.rb b/app/controllers/groups/application_controller.rb index 469a6813ee2..e0fd4befae9 100644 --- a/app/controllers/groups/application_controller.rb +++ b/app/controllers/groups/application_controller.rb @@ -1,4 +1,5 @@ class Groups::ApplicationController < ApplicationController + before_action :set_title private @@ -18,11 +19,9 @@ class Groups::ApplicationController < ApplicationController end end - def determine_layout - if current_user - 'group' - else - 'public_group' - end + def set_title + @title = group.name + @title_url = group_path(group) + @sidebar = "group" end end diff --git a/app/controllers/groups/avatars_controller.rb b/app/controllers/groups/avatars_controller.rb index 38071410f40..6aa64222f77 100644 --- a/app/controllers/groups/avatars_controller.rb +++ b/app/controllers/groups/avatars_controller.rb @@ -1,6 +1,4 @@ class Groups::AvatarsController < ApplicationController - layout "profile" - def destroy @group = Group.find_by(path: params[:group_id]) @group.remove_avatar! diff --git a/app/controllers/groups/milestones_controller.rb b/app/controllers/groups/milestones_controller.rb index 41564b04a92..669f7f3126d 100644 --- a/app/controllers/groups/milestones_controller.rb +++ b/app/controllers/groups/milestones_controller.rb @@ -1,6 +1,4 @@ -class Groups::MilestonesController < ApplicationController - layout 'group' - +class Groups::MilestonesController < Groups::ApplicationController before_action :authorize_group_milestone!, only: :update def index -- cgit v1.2.1