summaryrefslogtreecommitdiff
path: root/app/views/projects/ci/commits/_commit.html.haml
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/projects/ci/commits/_commit.html.haml')
-rw-r--r--app/views/projects/ci/commits/_commit.html.haml141
1 files changed, 141 insertions, 0 deletions
diff --git a/app/views/projects/ci/commits/_commit.html.haml b/app/views/projects/ci/commits/_commit.html.haml
new file mode 100644
index 00000000000..671c5abcbed
--- /dev/null
+++ b/app/views/projects/ci/commits/_commit.html.haml
@@ -0,0 +1,141 @@
+%tr.commit
+ %td.commit-link
+ - if can?(current_user, :read_commit, commit)
+ = link_to namespace_project_commit_url(commit.project.namespace, commit.project, commit) do
+ %strong ##{commit.id}
+ - else
+ %strong ##{commit.id}
+
+ %td.status
+ %div
+ - if can?(current_user, :read_commit, commit)
+ = ci_status_with_icon(commit.status, namespace_project_commit_url(commit.project.namespace, commit.project, commit))
+ - else
+ = ci_status_with_icon(commit.status)
+
+ %td
+ %div
+ - if commit.ref
+ = link_to commit.ref, namespace_project_commits_path(commit.project.namespace, commit.project, commit.ref)
+  
+ - if commit.tag?
+ %span.label.label-primary tag
+ - if commit.branch?
+ %span.label.label-primary branch
+ - if commit.trigger_requests.any?
+ %span.label.label-primary triggered
+ - if commit.yaml_errors.present?
+ %span.label.label-danger.has-tooltip(title="#{commit.yaml_errors}") yaml invalid
+ - if commit.builds.any?(&:stuck?)
+ %span.label.label-warning stuck
+
+ - if commit_data = commit.commit_data
+ = render 'projects/branches/commit', commit: commit_data, project: @project
+ - else
+ %p
+ Cant find HEAD commit for this branch
+
+ %td
+ %div
+ Duration:
+  
+ - if commit.started_at && commit.finished_at
+ #{duration_in_words(commit.finished_at, commit.started_at)}
+ - else
+ \-
+ %p
+ Finished:
+  
+ - if commit.finished_at
+ #{time_ago_with_tooltip(commit.finished_at)}
+ - else
+ \-
+
+ %td.content
+ .controls.hidden-xs
+ = link_to project_builds_path(commit.project), class: 'btn btn-grouped btn-xs' do
+ = icon('cubes fw')
+ Details
+
+ - @project = commit.project
+ - ref = 'master'
+ %span.btn-group.btn-grouped
+ %a.btn.btn-default.dropdown-toggle{ 'data-toggle' => 'dropdown' }
+ %span.caret
+ %span.sr-only
+ Select Archive Format
+ %ul.col-xs-10.dropdown-menu.dropdown-menu-align-right{ role: 'menu' }
+ %li
+ = link_to archive_namespace_project_repository_path(@project.namespace, @project, ref: ref, format: 'zip'), rel: 'nofollow' do
+ %i.fa.fa-download
+ %span Download zip
+ %li
+ = link_to archive_namespace_project_repository_path(@project.namespace, @project, ref: ref, format: 'tar.gz'), rel: 'nofollow' do
+ %i.fa.fa-download
+ %span Download tar.gz
+ %li
+ = link_to archive_namespace_project_repository_path(@project.namespace, @project, ref: ref, format: 'tar.bz2'), rel: 'nofollow' do
+ %i.fa.fa-download
+ %span Download tar.bz2
+ %li
+ = link_to archive_namespace_project_repository_path(@project.namespace, @project, ref: ref, format: 'tar'), rel: 'nofollow' do
+ %i.fa.fa-download
+ %span Download tar
+-#%tr.commit
+-# %td.status
+-# - if can?(current_user, :read_commit, commit)
+-# = ci_status_with_icon(commit.status, namespace_project_commit_url(commit.project.namespace, commit.project, commit))
+-# - else
+-# = ci_status_with_icon(commit.status)
+-#
+-# %td.commit-link
+-# - if can?(current_user, :read_commit, commit)
+-# = link_to namespace_project_commit_url(commit.project.namespace, commit.project, commit) do
+-# %strong ##{commit.id}
+-# - else
+-# %strong ##{commit.id}
+-#
+-# - if defined?(commit_sha) && commit_sha
+-# %td
+-# = link_to commit.short_sha, namespace_project_commit_path(commit.project.namespace, commit.project, commit.sha), class: "monospace"
+-#
+-# %td
+-# - if commit.ref
+-# = link_to commit.ref, namespace_project_commits_path(commit.project.namespace, commit.project, commit.ref)
+-# - else
+-# .light none
+-#
+-# %td
+-# = commit.git_commit_message
+-#
+-# %td.duration
+-# - if commit.started_at && commit.finished_at
+-# #{duration_in_words(commit.finished_at, commit.started_at)}
+-#
+-# %td.timestamp
+-# - if commit.finished_at
+-# %span #{time_ago_with_tooltip(commit.finished_at)}
+-#
+-# - if defined?(coverage) && coverage
+-# %td.coverage
+-# - if commit.try(:coverage)
+-# #{commit.coverage}%
+-#
+-# %td
+-# .pull-right
+-# - if can?(current_user, :read_commit, commit) && commit.artifacts?
+-# = link_to download_namespace_project_commit_artifacts_path(commit.project.namespace, commit.project, commit), title: 'Download artifacts' do
+-# %i.fa.fa-download
+-# - if can?(current_user, :update_commit, commit)
+-# - if commit.active?
+-# = link_to cancel_namespace_project_commit_path(commit.project.namespace, commit.project, commit, return_to: request.original_url), method: :post, title: 'Cancel' do
+-# %i.fa.fa-remove.cred
+-# - elsif defined?(allow_retry) && allow_retry && commit.retryable?
+-# = link_to retry_namespace_project_commit_path(commit.project.namespace, commit.project, commit, return_to: request.original_url), method: :post, title: 'Retry' do
+-# %i.fa.fa-repeat
+-#
+-#- if commit.yaml_errors.present?
+-# %tr
+-# %td{colspan: 7}
+-# .light
+-# = commit.yaml_errors \ No newline at end of file