Merge branch 'dev' into user_dashboard
Conflicts: app/views/layouts/_head_panel.html.erb
This commit is contained in:
commit
e9b22a2def
41 changed files with 1075 additions and 234 deletions
|
@ -8,8 +8,18 @@ class ApplicationController < ActionController::Base
|
|||
render :file => File.join(Rails.root, "public", "gitosis_error"), :layout => false
|
||||
end
|
||||
|
||||
layout :layout_by_resource
|
||||
|
||||
protected
|
||||
|
||||
def layout_by_resource
|
||||
if devise_controller?
|
||||
"devise"
|
||||
else
|
||||
"application"
|
||||
end
|
||||
end
|
||||
|
||||
def abilities
|
||||
@abilities ||= Six.new
|
||||
end
|
||||
|
|
|
@ -2,6 +2,7 @@ require "base64"
|
|||
|
||||
class CommitsController < ApplicationController
|
||||
before_filter :project
|
||||
layout "project"
|
||||
|
||||
# Authorize
|
||||
before_filter :add_project_abilities
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
class SnippetsController < ApplicationController
|
||||
before_filter :authenticate_user!
|
||||
before_filter :project
|
||||
layout "project"
|
||||
|
||||
# Authorize
|
||||
before_filter :add_project_abilities
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
class TeamMembersController < ApplicationController
|
||||
before_filter :project
|
||||
layout "project"
|
||||
|
||||
# Authorize
|
||||
before_filter :add_project_abilities
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue