summaryrefslogtreecommitdiff
path: root/app/views/projects/jobs/_sidebar.html.haml
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-06-01 03:39:47 +0800
committerLin Jen-Shin <godfat@godfat.org>2017-06-01 03:39:47 +0800
commit554426ddcaa1d8088c0a4e8c649a7a026036df5a (patch)
tree0f794869fb48dfaaead039bc5c8aef9784a1b4f5 /app/views/projects/jobs/_sidebar.html.haml
parent8a1a73a75a4410115b3cc5a85bf5fd85cb634182 (diff)
parentf06daa26efc127565e4e68ca9d4ac62e5a1e3b36 (diff)
downloadgitlab-ce-554426ddcaa1d8088c0a4e8c649a7a026036df5a.tar.gz
Merge remote-tracking branch 'upstream/master' into 24196-protected-variables
* upstream/master: (141 commits) Add Documentation for GIT_CHECKOUT variable Ui improvements for count badges and permission badges Rename the other jobs Update jobs_spec for changes from builds_spec Update docs related to protected actions Add changelog for protected branches abilities fix Ask for an example project for bug reports Center loading spinner in issuable filters Fix chat commands specs related to protected actions Fix builds controller specs related to protected actions Fix pipeline retry specs related to protected actions Fix environment model specs related to protected actions Fix build factory specs related to protected actions Fix job play service specs related to protected actions Fix play status specs related to protected actions Fix deploy chat command specs for protected actions Fix environment specs related to protected actions Use another scope to add the - prefix, feedback: Fix pipeline processing specs related to protected actions Fix build entity specs related to protected actions ...
Diffstat (limited to 'app/views/projects/jobs/_sidebar.html.haml')
-rw-r--r--app/views/projects/jobs/_sidebar.html.haml135
1 files changed, 135 insertions, 0 deletions
diff --git a/app/views/projects/jobs/_sidebar.html.haml b/app/views/projects/jobs/_sidebar.html.haml
new file mode 100644
index 00000000000..3e83142377b
--- /dev/null
+++ b/app/views/projects/jobs/_sidebar.html.haml
@@ -0,0 +1,135 @@
+- builds = @build.pipeline.builds.to_a
+
+%aside.right-sidebar.right-sidebar-expanded.build-sidebar.js-build-sidebar.js-right-sidebar{ data: { "offset-top" => "101", "spy" => "affix" } }
+ .block.build-sidebar-header.visible-xs-block.visible-sm-block.append-bottom-default
+ Job
+ %strong ##{@build.id}
+ %a.gutter-toggle.pull-right.js-sidebar-build-toggle{ href: "#" }
+ = icon('angle-double-right')
+ - if @build.coverage
+ .block.coverage
+ .title
+ Test coverage
+ %p.build-detail-row
+ #{@build.coverage}%
+
+ .blocks-container
+ - if can?(current_user, :read_build, @project) && (@build.artifacts? || @build.artifacts_expired?)
+ .block{ class: ("block-first" if !@build.coverage) }
+ .title
+ Job artifacts
+ - if @build.artifacts_expired?
+ %p.build-detail-row
+ The artifacts were removed
+ #{time_ago_with_tooltip(@build.artifacts_expire_at)}
+ - elsif @build.has_expiring_artifacts?
+ %p.build-detail-row
+ The artifacts will be removed in
+ %span.js-artifacts-remove= @build.artifacts_expire_at
+
+ - if @build.artifacts?
+ .btn-group.btn-group-justified{ role: :group }
+ - if @build.has_expiring_artifacts? && can?(current_user, :update_build, @build)
+ = link_to keep_namespace_project_job_artifacts_path(@project.namespace, @project, @build), class: 'btn btn-sm btn-default', method: :post do
+ Keep
+
+ = link_to download_namespace_project_job_artifacts_path(@project.namespace, @project, @build), rel: 'nofollow', download: '', class: 'btn btn-sm btn-default' do
+ Download
+
+ - if @build.artifacts_metadata?
+ = link_to browse_namespace_project_job_artifacts_path(@project.namespace, @project, @build), class: 'btn btn-sm btn-default' do
+ Browse
+
+ .block{ class: ("block-first" if !@build.coverage && !(can?(current_user, :read_build, @project) && (@build.artifacts? || @build.artifacts_expired?))) }
+ .title
+ Job details
+ - if can?(current_user, :update_build, @build) && @build.retryable?
+ = link_to "Retry job", retry_namespace_project_job_path(@project.namespace, @project, @build), class: 'pull-right retry-link', method: :post
+ - if @build.merge_request
+ %p.build-detail-row
+ %span.build-light-text Merge Request:
+ = link_to "#{@build.merge_request.to_reference}", merge_request_path(@build.merge_request), class: 'bold'
+ - if @build.duration
+ %p.build-detail-row
+ %span.build-light-text Duration:
+ = time_interval_in_words(@build.duration)
+ - if @build.finished_at
+ %p.build-detail-row
+ %span.build-light-text Finished:
+ #{time_ago_with_tooltip(@build.finished_at)}
+ - if @build.erased_at
+ %p.build-detail-row
+ %span.build-light-text Erased:
+ #{time_ago_with_tooltip(@build.erased_at)}
+ %p.build-detail-row
+ %span.build-light-text Runner:
+ - if @build.runner && current_user && current_user.admin
+ = link_to "##{@build.runner.id}", admin_runner_path(@build.runner.id)
+ - elsif @build.runner
+ \##{@build.runner.id}
+ .btn-group.btn-group-justified{ role: :group }
+ - if @build.active?
+ = link_to "Cancel", cancel_namespace_project_job_path(@project.namespace, @project, @build), class: 'btn btn-sm btn-default', method: :post
+
+ - if @build.trigger_request
+ .build-widget
+ %h4.title
+ Trigger
+
+ %p
+ %span.build-light-text Token:
+ #{@build.trigger_request.trigger.short_token}
+
+ - if @build.trigger_request.variables
+ %p
+ %button.btn.group.btn-group-justified.reveal-variables Reveal Variables
+
+
+ - @build.trigger_request.variables.each do |key, value|
+ .hide.js-build
+ .js-build-variable= key
+ .js-build-value= value
+
+ .block
+ .title
+ Commit title
+ %p.build-light-text.append-bottom-0
+ #{@build.pipeline.git_commit_title}
+
+ - if @build.tags.any?
+ .block
+ .title
+ Tags
+ - @build.tag_list.each do |tag|
+ %span.label.label-primary
+ = tag
+
+ - if @build.pipeline.stages_count > 1
+ .dropdown.build-dropdown
+ .title Stage
+ %button.dropdown-menu-toggle{ type: 'button', 'data-toggle' => 'dropdown' }
+ %span.stage-selection More
+ = icon('chevron-down')
+ %ul.dropdown-menu
+ - @build.pipeline.stages.each do |stage|
+ %li
+ %a.stage-item= stage.name
+
+ .builds-container
+ - HasStatus::ORDERED_STATUSES.each do |build_status|
+ - builds.select{|build| build.status == build_status}.each do |build|
+ .build-job{ class: sidebar_build_class(build, @build), data: { stage: build.stage } }
+ = link_to namespace_project_job_path(@project.namespace, @project, build) do
+ = icon('arrow-right')
+ %span{ class: "ci-status-icon-#{build.status}" }
+ = ci_icon_for_status(build.status)
+ %span
+ - if build.name
+ = build.name
+ - else
+ = build.id
+ - if build.retried?
+ %i.fa.fa-refresh.has-tooltip{ data: { container: 'body', placement: 'bottom' }, title: 'Job was retried' }
+
+:javascript
+ new Sidebar();