Commit 8759770c authored by Kamil Trzcinski's avatar Kamil Trzcinski

Re-use as much of views as possible

parent 1ef8be76
No related merge requests found
- is_playable = subject.playable? && can?(current_user, :update_build, @project) - is_playable = subject.playable? && can?(current_user, :update_build, @project)
%li.build{class: ("playable" if is_playable)} - if is_playable
.curve
.build-content
- if is_playable
= link_to play_namespace_project_build_path(subject.project.namespace, subject.project, subject, return_to: request.original_url), method: :post, title: 'Play' do = link_to play_namespace_project_build_path(subject.project.namespace, subject.project, subject, return_to: request.original_url), method: :post, title: 'Play' do
= render_status_with_link('build', 'play') = render_status_with_link('build', 'play')
.ci-status-text= subject.name .ci-status-text= subject.name
- elsif can?(current_user, :read_build, @project) - elsif can?(current_user, :read_build, @project)
= link_to namespace_project_build_path(subject.project.namespace, subject.project, subject) do = link_to namespace_project_build_path(subject.project.namespace, subject.project, subject) do
= render_status_with_link('build', subject.status) = render_status_with_link('build', subject.status)
.ci-status-text= subject.name .ci-status-text= subject.name
- else - else
= render_status_with_link('build', subject.status) = render_status_with_link('build', subject.status)
= ci_icon_for_status(subject.status) = ci_icon_for_status(subject.status)
...@@ -39,13 +39,7 @@ ...@@ -39,13 +39,7 @@
= stage.titleize = stage.titleize
.builds-container .builds-container
%ul %ul
- status_groups = statuses.group_by(&:group_name) = render "projects/commit/pipeline_stage", statuses: statuses
- status_groups.each do |group_name, grouped_statuses|
- if grouped_statuses.one?
- status = grouped_statuses.first
= render "projects/#{status.to_partial_path}_pipeline", subject: status
- else
= render "projects/commit/pipeline_grouped_status", name: group_name, subject: grouped_statuses
- if pipeline.yaml_errors.present? - if pipeline.yaml_errors.present?
......
%li.build
.curve
.build-content
- group_status = CommitStatus.where(id: subject).status
= render_status_with_link('build', group_status)
.dropdown.inline
%button.dropdown-menu-toggle{type: 'button', data: {toggle: 'dropdown'}}
%span.ci-status-text
= name
%span.badge= subject.length
%ul.dropdown-menu.grouped-pipeline-dropdown
.arrow
- subject.each do |status|
-# = render "projects/#{status.to_partial_path}_pipeline", subject: status
- is_playable = status.playable? && can?(current_user, :update_build, @project)
%li
- if is_playable
= link_to play_namespace_project_build_path(status.project.namespace, status.project, status, return_to: request.original_url), method: :post, title: 'Play' do
= render_status_with_link('build', 'play')
.ci-status-text= status.name
- elsif can?(current_user, :read_build, @project)
= link_to namespace_project_build_path(status.project.namespace, status.project, status) do
= render_status_with_link('build', status.status)
.ci-status-text= status.name
- else
= render_status_with_link('build', status.status)
= ci_icon_for_status(status.status)
- status_groups = statuses.group_by(&:group_name)
- status_groups.each do |group_name, grouped_statuses|
- if grouped_statuses.one?
- status = grouped_statuses.first
- is_playable = status.playable? && can?(current_user, :update_build, @project)
%li.build{class: ("playable" if is_playable)}
.curve
.build-content
= render "projects/#{status.to_partial_path}_pipeline", subject: status
- else
%li.build
.curve
.build-content
= render "projects/commit/pipeline_status_group", name: group_name, subject: grouped_statuses
- group_status = CommitStatus.where(id: subject).status
= render_status_with_link('build', group_status)
.dropdown.inline
%button.dropdown-menu-toggle{type: 'button', data: {toggle: 'dropdown'}}
%span.ci-status-text
= name
%span.badge= subject.length
%ul.dropdown-menu.grouped-pipeline-dropdown
.arrow
- subject.each do |status|
= render "projects/#{status.to_partial_path}_pipeline", subject: status
%li.build - if subject.target_url
.curve
.build-content
- if subject.target_url
- link_to subject.target_url do - link_to subject.target_url do
= render_status_with_link('commit status', subject.status) = render_status_with_link('commit status', subject.status)
%span.ci-status-text= subject.name %span.ci-status-text= subject.name
- else - else
= render_status_with_link('commit status', subject.status) = render_status_with_link('commit status', subject.status)
%span.ci-status-text= subject.name %span.ci-status-text= subject.name
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment