project layout
This commit is contained in:
parent
1ffb4b98c0
commit
487ae906a9
5 changed files with 71 additions and 9 deletions
|
@ -2,6 +2,7 @@ class IssuesController < ApplicationController
|
|||
before_filter :authenticate_user!
|
||||
before_filter :project
|
||||
before_filter :issue, :only => [:edit, :update, :destroy, :show]
|
||||
layout "project"
|
||||
|
||||
# Authorize
|
||||
before_filter :add_project_abilities
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
class ProjectsController < ApplicationController
|
||||
before_filter :project, :except => [:index, :new, :create]
|
||||
layout :determine_layout
|
||||
|
||||
# Authorize
|
||||
before_filter :add_project_abilities
|
||||
|
@ -152,4 +153,12 @@ class ProjectsController < ApplicationController
|
|||
def project
|
||||
@project ||= Project.find_by_code(params[:id])
|
||||
end
|
||||
|
||||
def determine_layout
|
||||
if @project && !@project.new_record?
|
||||
"project"
|
||||
else
|
||||
"application"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue