Fix navigation and header tile
Remove redundant navigation on commits and builds page
This commit is contained in:
parent
d0b9a6fca2
commit
1ce85dc4e2
11 changed files with 45 additions and 20 deletions
|
@ -7,7 +7,7 @@ module Ci
|
|||
before_filter :authorize_manage_project!, except: [:status, :show, :retry, :cancel]
|
||||
before_filter :authorize_manage_builds!, only: [:retry, :cancel]
|
||||
before_filter :build, except: [:show]
|
||||
layout 'ci/project'
|
||||
layout 'ci/build'
|
||||
|
||||
def show
|
||||
if params[:id] =~ /\A\d+\Z/
|
||||
|
|
|
@ -6,7 +6,7 @@ module Ci
|
|||
before_filter :authorize_access_project!, except: [:status, :show, :cancel]
|
||||
before_filter :authorize_manage_builds!, only: [:cancel]
|
||||
before_filter :commit, only: :show
|
||||
layout 'ci/project'
|
||||
layout 'ci/commit'
|
||||
|
||||
def show
|
||||
@builds = @commit.builds
|
||||
|
|
|
@ -26,5 +26,14 @@ module Ci
|
|||
def truncate_first_line(message, length = 50)
|
||||
truncate(message.each_line.first.chomp, length: length) if message
|
||||
end
|
||||
|
||||
def ci_commit_title(commit)
|
||||
content_tag :span do
|
||||
link_to(
|
||||
simple_sanitize(commit.project.name), ci_project_path(commit.project)
|
||||
) + ' @ ' +
|
||||
gitlab_commit_link(@project, @commit.sha)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,12 +1,3 @@
|
|||
%h4.page-title
|
||||
= link_to @project.name, ci_project_path(@project)
|
||||
@
|
||||
= @commit.short_sha
|
||||
|
||||
%p
|
||||
= link_to ci_project_ref_commits_path(@project, @commit.ref, @commit.sha) do
|
||||
← Back to project commit
|
||||
%hr
|
||||
#up-build-trace
|
||||
- if @commit.matrix?
|
||||
%ul.nav.nav-tabs.append-bottom-10
|
||||
|
|
|
@ -1,11 +1,3 @@
|
|||
%h4.page-title
|
||||
= @project.name
|
||||
@
|
||||
#{gitlab_commit_link(@project, @commit.sha)}
|
||||
%p
|
||||
= link_to ci_project_path(@project) do
|
||||
← Back to project commits
|
||||
%hr
|
||||
.commit-info
|
||||
%pre.commit-message
|
||||
#{@commit.git_commit_message}
|
||||
|
|
3
app/views/layouts/ci/_nav_build.html.haml
Normal file
3
app/views/layouts/ci/_nav_build.html.haml
Normal file
|
@ -0,0 +1,3 @@
|
|||
= render 'layouts/ci/nav_project',
|
||||
back_title: 'Back to project commit',
|
||||
back_url: ci_project_ref_commits_path(@project, @commit.ref, @commit.sha)
|
3
app/views/layouts/ci/_nav_commit.haml
Normal file
3
app/views/layouts/ci/_nav_commit.haml
Normal file
|
@ -0,0 +1,3 @@
|
|||
= render 'layouts/ci/nav_project',
|
||||
back_title: 'Back to project commits',
|
||||
back_url: ci_project_path(@project)
|
|
@ -1,4 +1,9 @@
|
|||
%ul.nav.nav-sidebar
|
||||
= nav_link do
|
||||
= link_to defined?(back_url) ? back_url : ci_root_path, title: defined?(back_title) ? back_title : 'Back to Dashboard', data: {placement: 'right'}, class: 'back-link' do
|
||||
= icon('caret-square-o-left fw')
|
||||
%span= defined?(back_title) ? back_title : 'Back to Dashboard'
|
||||
%li.separate-item
|
||||
= nav_link path: ['projects#show', 'commits#show', 'builds#show'] do
|
||||
= link_to ci_project_path(@project) do
|
||||
%i.fa.fa-list-alt
|
||||
|
|
11
app/views/layouts/ci/build.html.haml
Normal file
11
app/views/layouts/ci/build.html.haml
Normal file
|
@ -0,0 +1,11 @@
|
|||
!!! 5
|
||||
%html{ lang: "en"}
|
||||
= render 'layouts/head'
|
||||
%body{class: "ci-body #{user_application_theme}", 'data-page' => body_data_page}
|
||||
- header_title ci_commit_title(@commit)
|
||||
- if current_user
|
||||
= render "layouts/header/default", title: header_title
|
||||
- else
|
||||
= render "layouts/header/public", title: header_title
|
||||
|
||||
= render 'layouts/ci/page', sidebar: 'nav_build'
|
11
app/views/layouts/ci/commit.html.haml
Normal file
11
app/views/layouts/ci/commit.html.haml
Normal file
|
@ -0,0 +1,11 @@
|
|||
!!! 5
|
||||
%html{ lang: "en"}
|
||||
= render 'layouts/head'
|
||||
%body{class: "ci-body #{user_application_theme}", 'data-page' => body_data_page}
|
||||
- header_title ci_commit_title(@commit)
|
||||
- if current_user
|
||||
= render "layouts/header/default", title: header_title
|
||||
- else
|
||||
= render "layouts/header/public", title: header_title
|
||||
|
||||
= render 'layouts/ci/page', sidebar: 'nav_commit'
|
|
@ -2,7 +2,7 @@
|
|||
%html{ lang: "en"}
|
||||
= render 'layouts/head'
|
||||
%body{class: "ci-body #{user_application_theme}", 'data-page' => body_data_page}
|
||||
- header_title = @project.name
|
||||
- header_title @project.name, ci_project_path(@project)
|
||||
- if current_user
|
||||
= render "layouts/header/default", title: header_title
|
||||
- else
|
||||
|
|
Loading…
Reference in a new issue