summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValery Sizov <vsv2711@gmail.com>2015-09-14 16:49:03 +0300
committerValery Sizov <vsv2711@gmail.com>2015-09-14 16:49:03 +0300
commita399fe32e88d9b151426d43325e659df688b2019 (patch)
tree921133707f7ed9b30d83a0765cccfdefab1f35de
parent2c4daf1a68a23e6d4f17340b03415cfd715d5afc (diff)
parentf31d8ef2875c05ef2e254b637889b804990633c5 (diff)
downloadgitlab-ce-a399fe32e88d9b151426d43325e659df688b2019.tar.gz
Merge branch 'ci-and-ce-sitting-in-a-tree-k-i-s-s-i-n-g' of gitlab.com:gitlab-org/gitlab-ce into ci-and-ce-sitting-in-a-tree-k-i-s-s-i-n-g
-rw-r--r--app/controllers/ci/admin/runners_controller.rb2
-rw-r--r--app/controllers/ci/builds_controller.rb2
-rw-r--r--app/controllers/ci/commits_controller.rb2
-rw-r--r--app/controllers/ci/services_controller.rb2
-rw-r--r--app/helpers/ci/commits_helper.rb9
-rw-r--r--app/helpers/ci/routes_helper.rb4
-rw-r--r--app/helpers/ci/triggers_helper.rb2
-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/ci/triggers/index.html.haml2
-rw-r--r--app/views/ci/user_sessions/show.html.haml15
-rw-r--r--app/views/ci/variables/show.html.haml4
-rw-r--r--app/views/ci/web_hooks/index.html.haml2
-rw-r--r--app/views/layouts/ci/_info.html.haml6
-rw-r--r--app/views/layouts/ci/_nav_admin.html.haml2
-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_dashboard.html.haml2
-rw-r--r--app/views/layouts/ci/_nav_project.html.haml11
-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
22 files changed, 60 insertions, 54 deletions
diff --git a/app/controllers/ci/admin/runners_controller.rb b/app/controllers/ci/admin/runners_controller.rb
index 2aabe21ed66..dc3508b49dd 100644
--- a/app/controllers/ci/admin/runners_controller.rb
+++ b/app/controllers/ci/admin/runners_controller.rb
@@ -13,7 +13,7 @@ module Ci
@builds = @runner.builds.order('id DESC').first(30)
@projects = Ci::Project.all
@projects = @projects.search(params[:search]) if params[:search].present?
- @projects = @projects.where("projects.id NOT IN (?)", @runner.projects.pluck(:id)) if @runner.projects.any?
+ @projects = @projects.where("ci_projects.id NOT IN (?)", @runner.projects.pluck(:id)) if @runner.projects.any?
@projects = @projects.page(params[:page]).per(30)
end
diff --git a/app/controllers/ci/builds_controller.rb b/app/controllers/ci/builds_controller.rb
index fbfb02af4fb..80ee8666792 100644
--- a/app/controllers/ci/builds_controller.rb
+++ b/app/controllers/ci/builds_controller.rb
@@ -7,7 +7,7 @@ module Ci
before_action :authorize_manage_project!, except: [:status, :show, :retry, :cancel]
before_action :authorize_manage_builds!, only: [:retry, :cancel]
before_action :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 e41f3487de4..7a0a500fbe6 100644
--- a/app/controllers/ci/commits_controller.rb
+++ b/app/controllers/ci/commits_controller.rb
@@ -6,7 +6,7 @@ module Ci
before_action :authorize_access_project!, except: [:status, :show, :cancel]
before_action :authorize_manage_builds!, only: [:cancel]
before_action :commit, only: :show
- layout 'ci/project'
+ layout 'ci/commit'
def show
@builds = @commit.builds
diff --git a/app/controllers/ci/services_controller.rb b/app/controllers/ci/services_controller.rb
index 1495223786d..52c96a34ce8 100644
--- a/app/controllers/ci/services_controller.rb
+++ b/app/controllers/ci/services_controller.rb
@@ -20,7 +20,7 @@ module Ci
def update
if @service.update_attributes(service_params)
- redirect_to edit_ci_project_service_path(@project, @service.to_param), notice: 'Service was successfully updated.'
+ redirect_to edit_ci_project_service_path(@project, @service.to_param)
else
render 'edit'
end
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/helpers/ci/routes_helper.rb b/app/helpers/ci/routes_helper.rb
index 299a96edee4..42cd54b064f 100644
--- a/app/helpers/ci/routes_helper.rb
+++ b/app/helpers/ci/routes_helper.rb
@@ -13,11 +13,11 @@ module Ci
end
def url_helpers
- @url_helpers ||= Ci::Base.new
+ @url_helpers ||= Base.new
end
def self.method_missing(method, *args, &block)
- @url_helpers ||= Ci::Base.new
+ @url_helpers ||= Base.new
if @url_helpers.respond_to?(method)
@url_helpers.send(method, *args, &block)
diff --git a/app/helpers/ci/triggers_helper.rb b/app/helpers/ci/triggers_helper.rb
index 0d62bbf36b8..0d2438928ce 100644
--- a/app/helpers/ci/triggers_helper.rb
+++ b/app/helpers/ci/triggers_helper.rb
@@ -1,6 +1,6 @@
module Ci
module TriggersHelper
- def build_trigger_url(project_id, ref_name)
+ def ci_build_trigger_url(project_id, ref_name)
"#{Settings.gitlab_ci.url}/ci/api/v1/projects/#{project_id}/refs/#{ref_name}/trigger"
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
- &larr; 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
- &larr; Back to project commits
-%hr
.commit-info
%pre.commit-message
#{@commit.git_commit_message}
diff --git a/app/views/ci/triggers/index.html.haml b/app/views/ci/triggers/index.html.haml
index f04c116231d..44374a1a4d5 100644
--- a/app/views/ci/triggers/index.html.haml
+++ b/app/views/ci/triggers/index.html.haml
@@ -1,4 +1,4 @@
-%h3
+%h3.page-title
Triggers
%p.light
diff --git a/app/views/ci/user_sessions/show.html.haml b/app/views/ci/user_sessions/show.html.haml
deleted file mode 100644
index 0710e205618..00000000000
--- a/app/views/ci/user_sessions/show.html.haml
+++ /dev/null
@@ -1,15 +0,0 @@
-= image_tag user_avatar_url(current_user, 90), class: 'avatar avatar-inline avatar-tile s90', alt: ''
-%h3
- Hi, #{@user.name}
-
- - if @user.is_admin?
- %span.label.label-success Admin
-
-.profile-block
- %p
- %span.light Email:
- %strong= @user.email
-
- %p
- %span.light GitLab profile:
- %strong= link_to @user.username, GitlabCi.config.gitlab_server.url + '/u/' + @user.username, target: "_blank"
diff --git a/app/views/ci/variables/show.html.haml b/app/views/ci/variables/show.html.haml
index 5cced18a09f..ebf68341e08 100644
--- a/app/views/ci/variables/show.html.haml
+++ b/app/views/ci/variables/show.html.haml
@@ -1,4 +1,6 @@
-%h3 Secret Variables
+%h3.page-title
+ Secret Variables
+
%p.light
These variables will be set to environment by the runner and will be hidden in the build log.
%br
diff --git a/app/views/ci/web_hooks/index.html.haml b/app/views/ci/web_hooks/index.html.haml
index 92c43cd1d9d..78e8203b25e 100644
--- a/app/views/ci/web_hooks/index.html.haml
+++ b/app/views/ci/web_hooks/index.html.haml
@@ -1,4 +1,4 @@
-%h3
+%h3.page-title
Web hooks
%p.light
diff --git a/app/views/layouts/ci/_info.html.haml b/app/views/layouts/ci/_info.html.haml
index 9bc23cfad05..f7230f44242 100644
--- a/app/views/layouts/ci/_info.html.haml
+++ b/app/views/layouts/ci/_info.html.haml
@@ -1,9 +1,3 @@
.container
- - if alert || notice
- - if alert
- .alert.alert-danger= alert
- - if notice
- .alert.alert-info= notice
-
- if current_user && current_user.is_admin? && Ci::Runner.count.zero?
= render 'ci/shared/no_runners'
diff --git a/app/views/layouts/ci/_nav_admin.html.haml b/app/views/layouts/ci/_nav_admin.html.haml
index 7d65405740c..c987ab876a3 100644
--- a/app/views/layouts/ci/_nav_admin.html.haml
+++ b/app/views/layouts/ci/_nav_admin.html.haml
@@ -14,7 +14,7 @@
= link_to ci_admin_events_path do
%i.fa.fa-book
Events
- = nav_link path: 'runners#index' do
+ = nav_link path: ['runners#index', 'runners#show'] do
= link_to ci_admin_runners_path do
%i.fa.fa-cog
Runners
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_dashboard.html.haml b/app/views/layouts/ci/_nav_dashboard.html.haml
index 202d73d1713..fcff405d19d 100644
--- a/app/views/layouts/ci/_nav_dashboard.html.haml
+++ b/app/views/layouts/ci/_nav_dashboard.html.haml
@@ -5,7 +5,7 @@
%span
Back to GitLab
%li.separate-item
- = nav_link path: 'projects#show' do
+ = nav_link path: 'projects#index' do
= link_to ci_root_path do
%i.fa.fa-home
%span
diff --git a/app/views/layouts/ci/_nav_project.html.haml b/app/views/layouts/ci/_nav_project.html.haml
index 9cef47eb4f7..10b87e3a2b1 100644
--- a/app/views/layouts/ci/_nav_project.html.haml
+++ b/app/views/layouts/ci/_nav_project.html.haml
@@ -1,5 +1,10 @@
%ul.nav.nav-sidebar
- = nav_link path: 'projects#show' do
+ = 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
%span
@@ -10,7 +15,7 @@
%i.fa.fa-bar-chart
%span
Charts
- = nav_link path: ['runners#index', 'runners#show'] do
+ = nav_link path: ['runners#index', 'runners#show', 'runners#edit'] do
= link_to ci_project_runners_path(@project) do
%i.fa.fa-cog
%span
@@ -30,7 +35,7 @@
%i.fa.fa-retweet
%span
Triggers
- = nav_link path: 'services#index' do
+ = nav_link path: ['services#index', 'services#edit'] do
= link_to ci_project_services_path(@project) do
%i.fa.fa-share
%span
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