Fix navigation and header tile

Remove redundant navigation on commits and builds page
This commit is contained in:
Kamil Trzcinski 2015-09-14 14:03:02 +02:00
parent d0b9a6fca2
commit 1ce85dc4e2
11 changed files with 45 additions and 20 deletions

View file

@ -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/

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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}

View 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)

View file

@ -0,0 +1,3 @@
= render 'layouts/ci/nav_project',
back_title: 'Back to project commits',
back_url: ci_project_path(@project)

View file

@ -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

View 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'

View 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'

View file

@ -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