summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-06-07 17:31:12 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-06-07 17:31:12 +0300
commit3c2b085b2169be6f5880294bf95d27d4c899ae40 (patch)
tree83ea243cfbc60a618306d88f4109af09bbc5724f /app
parent96e8c6b7ed3f8caf63ca2ac52f844d414479801b (diff)
downloadgitlab-ce-3c2b085b2169be6f5880294bf95d27d4c899ae40.tar.gz
Use navless layout when it makes sense
Diffstat (limited to 'app')
-rw-r--r--app/assets/stylesheets/common.scss2
-rw-r--r--app/controllers/projects_controller.rb9
-rw-r--r--app/controllers/users_controller.rb4
-rw-r--r--app/views/layouts/navless.html.haml10
-rw-r--r--app/views/layouts/public.html.haml5
-rw-r--r--app/views/layouts/search.html.haml2
-rw-r--r--app/views/projects/new.html.haml2
7 files changed, 26 insertions, 8 deletions
diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss
index 50dd6e4e4e7..8c76b4baa22 100644
--- a/app/assets/stylesheets/common.scss
+++ b/app/assets/stylesheets/common.scss
@@ -419,7 +419,7 @@ img.emoji {
height: 220px;
}
-.search-container {
+.navless-container {
margin-top: 30px;
}
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index e202ed3234e..f2dbc519797 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -7,7 +7,8 @@ class ProjectsController < ProjectResourceController
before_filter :authorize_admin_project!, only: [:edit, :update, :destroy, :transfer]
before_filter :require_non_empty_project, only: [:blob, :tree, :graph]
- layout 'application', only: [:new, :create]
+ layout 'navless', only: [:new, :create]
+ before_filter :set_title, only: [:new, :create]
def new
@project = Project.new
@@ -105,4 +106,10 @@ class ProjectsController < ProjectResourceController
format.json { render :json => @suggestions }
end
end
+
+ private
+
+ def set_title
+ @title = 'New Project'
+ end
end
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index e027057fe65..4947c33f959 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -1,7 +1,11 @@
class UsersController < ApplicationController
+ layout 'navless'
+
def show
@user = User.find_by_username!(params[:username])
@projects = @user.authorized_projects.where('projects.id in (?)', current_user.authorized_projects.map(&:id))
@events = @user.recent_events.where(project_id: @projects.map(&:id)).limit(20)
+
+ @title = @user.name
end
end
diff --git a/app/views/layouts/navless.html.haml b/app/views/layouts/navless.html.haml
new file mode 100644
index 00000000000..47dece4a091
--- /dev/null
+++ b/app/views/layouts/navless.html.haml
@@ -0,0 +1,10 @@
+!!! 5
+%html{ lang: "en"}
+ = render "layouts/head", title: @title
+ %body{class: "#{app_theme} application"}
+ = render "layouts/head_panel", title: @title
+ = render "layouts/flash"
+
+ .container.navless-container
+ .content
+ = yield
diff --git a/app/views/layouts/public.html.haml b/app/views/layouts/public.html.haml
index 435250b6825..5a3bb4abe66 100644
--- a/app/views/layouts/public.html.haml
+++ b/app/views/layouts/public.html.haml
@@ -11,7 +11,6 @@
%h1 GITLAB
%span.separator
%h1.project_name Public Projects
- .container
+ .container.navless-container
.content
- .prepend-top-20
- = yield
+ = yield
diff --git a/app/views/layouts/search.html.haml b/app/views/layouts/search.html.haml
index 01da8f1c53b..fbea9d441d9 100644
--- a/app/views/layouts/search.html.haml
+++ b/app/views/layouts/search.html.haml
@@ -5,6 +5,6 @@
= render "layouts/head_panel", title: "Search"
= render "layouts/flash"
- .container.search-container
+ .container.navless-container
.content
= yield
diff --git a/app/views/projects/new.html.haml b/app/views/projects/new.html.haml
index e9099f264bc..0754ee83114 100644
--- a/app/views/projects/new.html.haml
+++ b/app/views/projects/new.html.haml
@@ -1,6 +1,4 @@
.project-edit-container
- %h3.page_title New Project
- %hr
.project-edit-errors
= render 'projects/errors'
.project-edit-content