Commit 1ce85dc4 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Fix navigation and header tile

Remove redundant navigation on commits and builds page
parent d0b9a6fc
...@@ -7,7 +7,7 @@ module Ci ...@@ -7,7 +7,7 @@ module Ci
before_filter :authorize_manage_project!, except: [:status, :show, :retry, :cancel] before_filter :authorize_manage_project!, except: [:status, :show, :retry, :cancel]
before_filter :authorize_manage_builds!, only: [:retry, :cancel] before_filter :authorize_manage_builds!, only: [:retry, :cancel]
before_filter :build, except: [:show] before_filter :build, except: [:show]
layout 'ci/project' layout 'ci/build'
def show def show
if params[:id] =~ /\A\d+\Z/ if params[:id] =~ /\A\d+\Z/
......
...@@ -6,7 +6,7 @@ module Ci ...@@ -6,7 +6,7 @@ module Ci
before_filter :authorize_access_project!, except: [:status, :show, :cancel] before_filter :authorize_access_project!, except: [:status, :show, :cancel]
before_filter :authorize_manage_builds!, only: [:cancel] before_filter :authorize_manage_builds!, only: [:cancel]
before_filter :commit, only: :show before_filter :commit, only: :show
layout 'ci/project' layout 'ci/commit'
def show def show
@builds = @commit.builds @builds = @commit.builds
......
...@@ -26,5 +26,14 @@ module Ci ...@@ -26,5 +26,14 @@ module Ci
def truncate_first_line(message, length = 50) def truncate_first_line(message, length = 50)
truncate(message.each_line.first.chomp, length: length) if message truncate(message.each_line.first.chomp, length: length) if message
end 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
end end
%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 #up-build-trace
- if @commit.matrix? - if @commit.matrix?
%ul.nav.nav-tabs.append-bottom-10 %ul.nav.nav-tabs.append-bottom-10
......
%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 .commit-info
%pre.commit-message %pre.commit-message
#{@commit.git_commit_message} #{@commit.git_commit_message}
......
= render 'layouts/ci/nav_project',
back_title: 'Back to project commit',
back_url: ci_project_ref_commits_path(@project, @commit.ref, @commit.sha)
= render 'layouts/ci/nav_project',
back_title: 'Back to project commits',
back_url: ci_project_path(@project)
%ul.nav.nav-sidebar %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 = nav_link path: ['projects#show', 'commits#show', 'builds#show'] do
= link_to ci_project_path(@project) do = link_to ci_project_path(@project) do
%i.fa.fa-list-alt %i.fa.fa-list-alt
......
!!! 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'
!!! 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 @@ ...@@ -2,7 +2,7 @@
%html{ lang: "en"} %html{ lang: "en"}
= render 'layouts/head' = render 'layouts/head'
%body{class: "ci-body #{user_application_theme}", 'data-page' => body_data_page} %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 - if current_user
= render "layouts/header/default", title: header_title = render "layouts/header/default", title: header_title
- else - else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment