summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/ci/builds_controller.rb2
-rw-r--r--app/controllers/ci/commits_controller.rb2
-rw-r--r--app/helpers/ci/commits_helper.rb9
-rw-r--r--app/views/ci/builds/show.html.haml9
-rw-r--r--app/views/ci/commits/show.html.haml8
-rw-r--r--app/views/layouts/ci/_nav_build.html.haml3
-rw-r--r--app/views/layouts/ci/_nav_commit.haml3
-rw-r--r--app/views/layouts/ci/_nav_project.html.haml5
-rw-r--r--app/views/layouts/ci/build.html.haml11
-rw-r--r--app/views/layouts/ci/commit.html.haml11
-rw-r--r--app/views/layouts/ci/project.html.haml2
11 files changed, 45 insertions, 20 deletions
diff --git a/app/controllers/ci/builds_controller.rb b/app/controllers/ci/builds_controller.rb
index 9338b37e678..2bab562d6b3 100644
--- a/app/controllers/ci/builds_controller.rb
+++ b/app/controllers/ci/builds_controller.rb
@@ -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/
diff --git a/app/controllers/ci/commits_controller.rb b/app/controllers/ci/commits_controller.rb
index f0c0ff1bc11..f79dbbe927a 100644
--- a/app/controllers/ci/commits_controller.rb
+++ b/app/controllers/ci/commits_controller.rb
@@ -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
diff --git a/app/helpers/ci/commits_helper.rb b/app/helpers/ci/commits_helper.rb
index 86f254223cb..994157ed84b 100644
--- a/app/helpers/ci/commits_helper.rb
+++ b/app/helpers/ci/commits_helper.rb
@@ -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
diff --git a/app/views/ci/builds/show.html.haml b/app/views/ci/builds/show.html.haml
index 1a07feeb20e..d1e955b5012 100644
--- a/app/views/ci/builds/show.html.haml
+++ b/app/views/ci/builds/show.html.haml
@@ -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
diff --git a/app/views/ci/commits/show.html.haml b/app/views/ci/commits/show.html.haml
index 72fda8fe949..1aeb557314a 100644
--- a/app/views/ci/commits/show.html.haml
+++ b/app/views/ci/commits/show.html.haml
@@ -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}
diff --git a/app/views/layouts/ci/_nav_build.html.haml b/app/views/layouts/ci/_nav_build.html.haml
new file mode 100644
index 00000000000..732882726e7
--- /dev/null
+++ b/app/views/layouts/ci/_nav_build.html.haml
@@ -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)
diff --git a/app/views/layouts/ci/_nav_commit.haml b/app/views/layouts/ci/_nav_commit.haml
new file mode 100644
index 00000000000..19c526678d0
--- /dev/null
+++ b/app/views/layouts/ci/_nav_commit.haml
@@ -0,0 +1,3 @@
+= render 'layouts/ci/nav_project',
+ back_title: 'Back to project commits',
+ back_url: ci_project_path(@project)
diff --git a/app/views/layouts/ci/_nav_project.html.haml b/app/views/layouts/ci/_nav_project.html.haml
index 2d9897fa864..10b87e3a2b1 100644
--- a/app/views/layouts/ci/_nav_project.html.haml
+++ b/app/views/layouts/ci/_nav_project.html.haml
@@ -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
diff --git a/app/views/layouts/ci/build.html.haml b/app/views/layouts/ci/build.html.haml
new file mode 100644
index 00000000000..d404ecb894a
--- /dev/null
+++ b/app/views/layouts/ci/build.html.haml
@@ -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'
diff --git a/app/views/layouts/ci/commit.html.haml b/app/views/layouts/ci/commit.html.haml
new file mode 100644
index 00000000000..5727f1b8e3e
--- /dev/null
+++ b/app/views/layouts/ci/commit.html.haml
@@ -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'
diff --git a/app/views/layouts/ci/project.html.haml b/app/views/layouts/ci/project.html.haml
index 23a4928fcc7..15478c3f5bc 100644
--- a/app/views/layouts/ci/project.html.haml
+++ b/app/views/layouts/ci/project.html.haml
@@ -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