2018-09-26 04:28:50 -04:00
|
|
|
-#-----------------------------------------------------------------
|
|
|
|
WARNING: Please keep changes up-to-date with the following files:
|
|
|
|
- `assets/javascripts/diffs/components/commit_item.vue`
|
|
|
|
-#-----------------------------------------------------------------
|
2017-11-21 13:06:38 -05:00
|
|
|
- view_details = local_assigns.fetch(:view_details, false)
|
2017-06-29 17:19:09 -04:00
|
|
|
- merge_request = local_assigns.fetch(:merge_request, nil)
|
2017-11-21 13:06:38 -05:00
|
|
|
- project = local_assigns.fetch(:project) { merge_request&.project }
|
|
|
|
- ref = local_assigns.fetch(:ref) { merge_request&.source_branch }
|
2019-09-30 11:08:09 -04:00
|
|
|
- commit = commit.present(current_user: current_user)
|
|
|
|
- commit_status = commit.status_for(ref)
|
2017-06-29 17:19:09 -04:00
|
|
|
|
2017-11-21 13:06:38 -05:00
|
|
|
- link = commit_path(project, commit, merge_request: merge_request)
|
2019-05-23 06:22:36 -04:00
|
|
|
|
|
|
|
- show_project_name = local_assigns.fetch(:show_project_name, false)
|
|
|
|
|
2018-11-28 13:38:40 -05:00
|
|
|
%li.commit.flex-row.js-toggle-container{ id: "commit-#{commit.short_id}" }
|
|
|
|
|
|
|
|
.avatar-cell.d-none.d-sm-block
|
2019-05-30 14:42:06 -04:00
|
|
|
= author_avatar(commit, size: 40, has_tooltip: false)
|
2018-11-28 13:38:40 -05:00
|
|
|
|
|
|
|
.commit-detail.flex-list
|
|
|
|
.commit-content.qa-commit-content
|
|
|
|
- if view_details && merge_request
|
2020-01-16 07:08:32 -05:00
|
|
|
= link_to commit.title, project_commit_path(project, commit.id, merge_request_iid: merge_request.iid), class: ["commit-row-message item-title js-onboarding-commit-item", ("font-italic" if commit.message.empty?)]
|
2018-11-28 13:38:40 -05:00
|
|
|
- else
|
2020-01-16 07:08:32 -05:00
|
|
|
= link_to_markdown_field(commit, :title, link, class: "commit-row-message item-title js-onboarding-commit-item #{"font-italic" if commit.message.empty?}")
|
2019-03-13 18:33:10 -04:00
|
|
|
%span.commit-row-message.d-inline.d-sm-none
|
2018-11-28 13:38:40 -05:00
|
|
|
·
|
|
|
|
= commit.short_id
|
|
|
|
- if commit.description?
|
|
|
|
%button.text-expander.js-toggle-button
|
|
|
|
= sprite_icon('ellipsis_h', size: 12)
|
2014-06-10 02:50:27 -04:00
|
|
|
|
2018-11-28 13:38:40 -05:00
|
|
|
.committer
|
|
|
|
- commit_author_link = commit_author_link(commit, avatar: false, size: 24)
|
|
|
|
- commit_timeago = time_ago_with_tooltip(commit.authored_date, placement: 'bottom')
|
|
|
|
- commit_text = _('%{commit_author_link} authored %{commit_timeago}') % { commit_author_link: commit_author_link, commit_timeago: commit_timeago }
|
|
|
|
#{ commit_text.html_safe }
|
2019-05-23 06:22:36 -04:00
|
|
|
= render_if_exists 'projects/commits/project_namespace', show_project_name: show_project_name, project: project
|
2017-06-09 09:08:39 -04:00
|
|
|
|
2018-11-28 13:38:40 -05:00
|
|
|
- if commit.description?
|
|
|
|
%pre.commit-row-description.js-toggle-content.append-bottom-8
|
|
|
|
= preserve(markdown_field(commit, :description))
|
2018-05-07 13:08:57 -04:00
|
|
|
|
2019-03-13 18:33:10 -04:00
|
|
|
.commit-actions.flex-row
|
2018-11-28 13:38:40 -05:00
|
|
|
- if request.xhr?
|
|
|
|
= render partial: 'projects/commit/signature', object: commit.signature
|
|
|
|
- else
|
|
|
|
= render partial: 'projects/commit/ajax_signature', locals: { commit: commit }
|
2017-07-25 03:40:23 -04:00
|
|
|
|
2019-01-28 07:12:30 -05:00
|
|
|
- if commit_status
|
2019-09-30 11:08:09 -04:00
|
|
|
= render_commit_status(commit, commit_status, ref: ref)
|
2018-01-22 19:34:21 -05:00
|
|
|
|
2018-11-28 13:38:40 -05:00
|
|
|
.js-commit-pipeline-status{ data: { endpoint: pipelines_project_commit_path(project, commit.id, ref: ref) } }
|
2017-06-29 17:19:09 -04:00
|
|
|
|
2019-03-13 18:33:10 -04:00
|
|
|
.commit-sha-group.d-none.d-sm-flex
|
2019-04-25 14:49:13 -04:00
|
|
|
.label.label-monospace.monospace
|
2018-11-28 13:38:40 -05:00
|
|
|
= commit.short_id
|
2019-10-09 08:06:13 -04:00
|
|
|
= clipboard_button(text: commit.id, title: _("Copy commit SHA"), class: "btn btn-default", container: "body")
|
2018-11-28 13:38:40 -05:00
|
|
|
= link_to_browse_code(project, commit)
|