BigW Consortium Gitlab

Commit 590c84c7 by Dmitriy Zaporozhets

Fix determine of layout for group/team

parent 08e52a56
class GroupsController < ApplicationController
respond_to :html
layout 'group', except: [:new, :create]
before_filter :group, except: [:new, :create]
# Authorize
......@@ -12,7 +10,8 @@ class GroupsController < ApplicationController
# Load group projects
before_filter :projects, except: [:new, :create]
layout 'navless', only: [:new, :create]
layout :determine_layout
before_filter :set_title, only: [:new, :create]
def new
......@@ -141,4 +140,12 @@ class GroupsController < ApplicationController
def set_title
@title = 'New Group'
end
def determine_layout
if [:new, :create].include?(action_name.to_sym)
'navless'
else
'group'
end
end
end
......@@ -6,8 +6,8 @@ class TeamsController < ApplicationController
before_filter :user_team, except: [:new, :create]
layout 'user_team', except: [:new, :create]
layout 'navless', only: [:new, :create]
layout :determine_layout
before_filter :set_title, only: [:new, :create]
def show
......@@ -82,4 +82,12 @@ class TeamsController < ApplicationController
def set_title
@title = 'New Team'
end
def determine_layout
if [:new, :create].include?(action_name.to_sym)
'navless'
else
'user_team'
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