Use navless layout when it makes sense
This commit is contained in:
parent
96e8c6b7ed
commit
3c2b085b21
7 changed files with 26 additions and 8 deletions
|
@ -419,7 +419,7 @@ img.emoji {
|
|||
height: 220px;
|
||||
}
|
||||
|
||||
.search-container {
|
||||
.navless-container {
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
10
app/views/layouts/navless.html.haml
Normal file
10
app/views/layouts/navless.html.haml
Normal file
|
@ -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
|
|
@ -11,7 +11,6 @@
|
|||
%h1 GITLAB
|
||||
%span.separator
|
||||
%h1.project_name Public Projects
|
||||
.container
|
||||
.container.navless-container
|
||||
.content
|
||||
.prepend-top-20
|
||||
= yield
|
||||
= yield
|
||||
|
|
|
@ -5,6 +5,6 @@
|
|||
= render "layouts/head_panel", title: "Search"
|
||||
= render "layouts/flash"
|
||||
|
||||
.container.search-container
|
||||
.container.navless-container
|
||||
.content
|
||||
= yield
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
.project-edit-container
|
||||
%h3.page_title New Project
|
||||
%hr
|
||||
.project-edit-errors
|
||||
= render 'projects/errors'
|
||||
.project-edit-content
|
||||
|
|
Loading…
Reference in a new issue