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

This commit is contained in:
Valery Sizov 2015-09-14 16:49:03 +03:00
commit a399fe32e8
22 changed files with 60 additions and 54 deletions

View file

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

View file

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

View file

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

View file

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

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

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

View file

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

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

@ -1,4 +1,4 @@
%h3
%h3.page-title
Triggers
%p.light

View file

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

View file

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

View file

@ -1,4 +1,4 @@
%h3
%h3.page-title
Web hooks
%p.light

View file

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

View file

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

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

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

View file

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

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