Commit 590c84c7 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix determine of layout for group/team

parent 08e52a56
class GroupsController < ApplicationController class GroupsController < ApplicationController
respond_to :html respond_to :html
layout 'group', except: [:new, :create]
before_filter :group, except: [:new, :create] before_filter :group, except: [:new, :create]
# Authorize # Authorize
...@@ -12,7 +10,8 @@ class GroupsController < ApplicationController ...@@ -12,7 +10,8 @@ class GroupsController < ApplicationController
# Load group projects # Load group projects
before_filter :projects, except: [:new, :create] before_filter :projects, except: [:new, :create]
layout 'navless', only: [:new, :create] layout :determine_layout
before_filter :set_title, only: [:new, :create] before_filter :set_title, only: [:new, :create]
def new def new
...@@ -141,4 +140,12 @@ class GroupsController < ApplicationController ...@@ -141,4 +140,12 @@ class GroupsController < ApplicationController
def set_title def set_title
@title = 'New Group' @title = 'New Group'
end end
def determine_layout
if [:new, :create].include?(action_name.to_sym)
'navless'
else
'group'
end
end
end end
...@@ -6,8 +6,8 @@ class TeamsController < ApplicationController ...@@ -6,8 +6,8 @@ class TeamsController < ApplicationController
before_filter :user_team, except: [:new, :create] before_filter :user_team, except: [:new, :create]
layout 'user_team', except: [:new, :create] layout :determine_layout
layout 'navless', only: [:new, :create]
before_filter :set_title, only: [:new, :create] before_filter :set_title, only: [:new, :create]
def show def show
...@@ -82,4 +82,12 @@ class TeamsController < ApplicationController ...@@ -82,4 +82,12 @@ class TeamsController < ApplicationController
def set_title def set_title
@title = 'New Team' @title = 'New Team'
end end
def determine_layout
if [:new, :create].include?(action_name.to_sym)
'navless'
else
'user_team'
end
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment