summaryrefslogtreecommitdiff
path: root/app/controllers/projects_controller.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-04-30 19:06:18 +0200
committerDouwe Maan <douwe@gitlab.com>2015-04-30 19:12:15 +0200
commit26ad250989d82b496b131811f8a0ddd7e662b650 (patch)
treea61059ff97f7d5bb1db163fa2dcb041065b092f2 /app/controllers/projects_controller.rb
parentf2cf6d75ecc6082897543f976e8e4bee7ac24e90 (diff)
downloadgitlab-ce-26ad250989d82b496b131811f8a0ddd7e662b650.tar.gz
Add a page title to every page.
Diffstat (limited to 'app/controllers/projects_controller.rb')
-rw-r--r--app/controllers/projects_controller.rb22
1 files changed, 14 insertions, 8 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 883e5865a21..da6b0c3c91a 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -9,14 +9,14 @@ class ProjectsController < ApplicationController
before_action :set_title, only: [:new, :create]
before_action :event_filter, only: :show
- layout 'navless', only: [:new, :create, :fork]
+ layout :determine_layout
def new
@project = Project.new
end
def edit
- render 'edit', layout: 'project_settings'
+ render 'edit'
end
def create
@@ -46,7 +46,7 @@ class ProjectsController < ApplicationController
end
format.js
else
- format.html { render 'edit', layout: 'project_settings' }
+ format.html { render 'edit' }
format.js
end
end
@@ -72,13 +72,13 @@ class ProjectsController < ApplicationController
format.html do
if @project.repository_exists?
if @project.empty_repo?
- render 'projects/empty', layout: user_layout
+ render 'projects/empty'
else
@last_push = current_user.recent_push(@project.id) if current_user
- render :show, layout: user_layout
+ render :show
end
else
- render 'projects/no_repo', layout: user_layout
+ render 'projects/no_repo'
end
end
@@ -164,8 +164,14 @@ class ProjectsController < ApplicationController
@title = 'New Project'
end
- def user_layout
- current_user ? 'projects' : 'public_projects'
+ def determine_layout
+ if [:new, :create].include?(action_name.to_sym)
+ 'application'
+ elsif [:edit, :update].include?(action_name.to_sym)
+ 'project_settings'
+ else
+ 'project'
+ end
end
def load_events