project layout

This commit is contained in:
gitlabhq 2011-10-28 15:07:58 +03:00
parent 1ffb4b98c0
commit 487ae906a9
5 changed files with 71 additions and 9 deletions

View file

@ -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