2018-09-26 08:28:50 +00:00
|
|
|
-#-----------------------------------------------------------------
|
|
|
|
WARNING: Please keep changes up-to-date with the following files:
|
|
|
|
- `assets/javascripts/diffs/components/commit_item.vue`
|
2020-05-13 18:08:47 +00:00
|
|
|
|
|
|
|
EXCEPTION WARNING - see above `.vue` file for de-sync drift
|
2018-09-26 08:28:50 +00:00
|
|
|
-#-----------------------------------------------------------------
|
2017-11-21 18:06:38 +00:00
|
|
|
- view_details = local_assigns.fetch(:view_details, false)
|
2017-06-29 21:19:09 +00:00
|
|
|
- merge_request = local_assigns.fetch(:merge_request, nil)
|
2017-11-21 18:06:38 +00:00
|
|
|
- project = local_assigns.fetch(:project) { merge_request&.project }
|
|
|
|
- ref = local_assigns.fetch(:ref) { merge_request&.source_branch }
|
2019-09-30 15:08:09 +00:00
|
|
|
- commit = commit.present(current_user: current_user)
|
|
|
|
- commit_status = commit.status_for(ref)
|
2020-07-20 09:09:22 +00:00
|
|
|
- collapsible = local_assigns.fetch(:collapsible, true)
|
2020-08-26 09:10:16 +00:00
|
|
|
- link_data_attrs = local_assigns.fetch(:link_data_attrs, {})
|
2017-06-29 21:19:09 +00:00
|
|
|
|
2017-11-21 18:06:38 +00:00
|
|
|
- link = commit_path(project, commit, merge_request: merge_request)
|
2019-05-23 10:22:36 +00:00
|
|
|
|
|
|
|
- show_project_name = local_assigns.fetch(:show_project_name, false)
|
|
|
|
|
2020-07-20 09:09:22 +00:00
|
|
|
%li{ class: ["commit flex-row", ("js-toggle-container" if collapsible)], id: "commit-#{commit.short_id}" }
|
2018-11-28 18:38:40 +00:00
|
|
|
|
|
|
|
.avatar-cell.d-none.d-sm-block
|
2019-05-30 18:42:06 +00:00
|
|
|
= author_avatar(commit, size: 40, has_tooltip: false)
|
2018-11-28 18:38:40 +00:00
|
|
|
|
|
|
|
.commit-detail.flex-list
|
2020-11-06 00:09:14 +00:00
|
|
|
.commit-content{ data: { qa_selector: 'commit_content' } }
|
2018-11-28 18:38:40 +00:00
|
|
|
- if view_details && merge_request
|
2020-01-16 12:08:32 +00: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 18:38:40 +00:00
|
|
|
- else
|
2020-08-26 09:10:16 +00:00
|
|
|
= link_to_markdown_field(commit, :title, link, class: "commit-row-message item-title js-onboarding-commit-item #{"font-italic" if commit.message.empty?}", data: link_data_attrs)
|
2019-03-13 22:33:10 +00:00
|
|
|
%span.commit-row-message.d-inline.d-sm-none
|
2018-11-28 18:38:40 +00:00
|
|
|
·
|
|
|
|
= commit.short_id
|
2020-07-20 09:09:22 +00:00
|
|
|
- if commit.description? && collapsible
|
2021-02-13 00:09:10 +00:00
|
|
|
%button.gl-button.btn.btn-default.button-ellipsis-horizontal.btn-sm.gl-ml-2.text-expander.js-toggle-button
|
2018-11-28 18:38:40 +00:00
|
|
|
= sprite_icon('ellipsis_h', size: 12)
|
2014-06-10 06:50:27 +00:00
|
|
|
|
2018-11-28 18:38:40 +00: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 10:22:36 +00:00
|
|
|
= render_if_exists 'projects/commits/project_namespace', show_project_name: show_project_name, project: project
|
2017-06-09 13:08:39 +00:00
|
|
|
|
2018-11-28 18:38:40 +00:00
|
|
|
- if commit.description?
|
2020-07-20 09:09:22 +00:00
|
|
|
%pre{ class: ["commit-row-description gl-mb-3", (collapsible ? "js-toggle-content" : "d-block")] }
|
2018-11-28 18:38:40 +00:00
|
|
|
= preserve(markdown_field(commit, :description))
|
2018-05-07 17:08:57 +00:00
|
|
|
|
2019-03-13 22:33:10 +00:00
|
|
|
.commit-actions.flex-row
|
2018-11-28 18:38:40 +00: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 07:40:23 +00:00
|
|
|
|
2019-01-28 12:12:30 +00:00
|
|
|
- if commit_status
|
2019-09-30 15:08:09 +00:00
|
|
|
= render_commit_status(commit, commit_status, ref: ref)
|
2018-01-23 00:34:21 +00:00
|
|
|
|
2018-11-28 18:38:40 +00:00
|
|
|
.js-commit-pipeline-status{ data: { endpoint: pipelines_project_commit_path(project, commit.id, ref: ref) } }
|
2017-06-29 21:19:09 +00:00
|
|
|
|
2020-11-16 15:09:23 +00:00
|
|
|
.commit-sha-group.btn-group.d-none.d-sm-flex
|
2019-04-25 18:49:13 +00:00
|
|
|
.label.label-monospace.monospace
|
2018-11-28 18:38:40 +00:00
|
|
|
= commit.short_id
|
2021-02-19 18:10:51 +00:00
|
|
|
= clipboard_button(text: commit.id, title: _("Copy commit SHA"), class: "gl-button btn btn-default btn-icon", container: "body")
|
2018-11-28 18:38:40 +00:00
|
|
|
= link_to_browse_code(project, commit)
|