debian-mirror-gitlab/app/views/projects/commits/_commit.html.haml

73 lines
4.4 KiB
Text
Raw Normal View History

2018-12-05 23:21:45 +05:30
-#-----------------------------------------------------------------
WARNING: Please keep changes up-to-date with the following files:
- `assets/javascripts/diffs/components/commit_item.vue`
2020-05-24 23:13:21 +05:30
EXCEPTION WARNING - see above `.vue` file for de-sync drift
2019-09-04 21:01:54 +05:30
2021-06-08 01:23:25 +05:30
WARNING: When introducing new content here, please consider what
changes may need to be made in the cache keys used to
wrap this view, found in
CommitsHelper#commit_partial_cache_key
-#-----------------------------------------------------------------
- view_details = local_assigns.fetch(:view_details, false)
- merge_request = local_assigns.fetch(:merge_request, nil)
- project = local_assigns.fetch(:project) { merge_request&.project }
- ref = local_assigns.fetch(:ref) { merge_request&.source_branch }
- commit = commit.present(current_user: current_user)
- commit_status = commit.status_for(ref)
- collapsible = local_assigns.fetch(:collapsible, true)
- link_data_attrs = local_assigns.fetch(:link_data_attrs, {})
- link = commit_path(project, commit, merge_request: merge_request)
2019-09-04 21:01:54 +05:30
- show_project_name = local_assigns.fetch(:show_project_name, false)
2020-10-24 23:57:45 +05:30
%li{ class: ["commit flex-row", ("js-toggle-container" if collapsible)], id: "commit-#{commit.short_id}" }
2018-11-29 20:51:05 +05:30
.avatar-cell.d-none.d-sm-block
2019-09-04 21:01:54 +05:30
= author_avatar(commit, size: 40, has_tooltip: false)
2018-11-29 20:51:05 +05:30
.commit-detail.flex-list
2021-01-29 00:20:46 +05:30
.commit-content{ data: { qa_selector: 'commit_content' } }
2018-11-29 20:51:05 +05:30
- if view_details && merge_request
2020-03-13 15:44:24 +05:30
= 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-29 20:51:05 +05:30
- else
2020-11-24 15:15:51 +05:30
= 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-07-07 11:18:12 +05:30
%span.commit-row-message.d-inline.d-sm-none
2018-11-29 20:51:05 +05:30
·
= commit.short_id
2020-10-24 23:57:45 +05:30
- if commit.description? && collapsible
2021-03-11 19:13:27 +05:30
%button.gl-button.btn.btn-default.button-ellipsis-horizontal.btn-sm.gl-ml-2.text-expander.js-toggle-button
2018-11-29 20:51:05 +05:30
= sprite_icon('ellipsis_h', size: 12)
2014-09-02 18:07:02 +05:30
2018-11-29 20:51:05 +05:30
.committer
- commit_author_link = commit_author_link(commit, avatar: false, size: 24)
2021-11-18 22:05:49 +05:30
- commit_authored_timeago = time_ago_with_tooltip(commit.authored_date, placement: 'bottom')
- if commit.different_committer? && commit.committer
- commit_committer_link = commit_committer_link(commit)
- commit_committer_timeago = time_ago_with_tooltip(commit.committed_date, placement: 'bottom')
- commit_committer_avatar = commit_committer_avatar(commit.committer, size: 18, has_tooltip: false)
- commit_text = _('%{commit_author_link} authored %{commit_authored_timeago} and %{commit_committer_avatar} %{commit_committer_link} committed %{commit_committer_timeago}') % { commit_author_link: commit_author_link, commit_authored_timeago: commit_authored_timeago, commit_committer_avatar: commit_committer_avatar, commit_committer_link: commit_committer_link, commit_committer_timeago: commit_committer_timeago }
- else
- commit_text = _('%{commit_author_link} authored %{commit_authored_timeago}') % { commit_author_link: commit_author_link, commit_authored_timeago: commit_authored_timeago }
2018-11-29 20:51:05 +05:30
#{ commit_text.html_safe }
2019-09-04 21:01:54 +05:30
= render_if_exists 'projects/commits/project_namespace', show_project_name: show_project_name, project: project
2017-09-10 17:25:29 +05:30
2018-11-29 20:51:05 +05:30
- if commit.description?
2020-10-24 23:57:45 +05:30
%pre{ class: ["commit-row-description gl-mb-3", (collapsible ? "js-toggle-content" : "d-block")] }
2018-11-29 20:51:05 +05:30
= preserve(markdown_field(commit, :description))
2018-10-15 14:42:47 +05:30
2019-07-07 11:18:12 +05:30
.commit-actions.flex-row
2018-11-29 20:51:05 +05:30
- if request.xhr?
= render partial: 'projects/commit/signature', object: commit.signature
- else
= render partial: 'projects/commit/ajax_signature', locals: { commit: commit }
2014-09-02 18:07:02 +05:30
2019-02-02 18:00:53 +05:30
- if commit_status
2019-12-21 20:55:43 +05:30
= render_commit_status(commit, commit_status, ref: ref)
2017-09-10 17:25:29 +05:30
2018-11-29 20:51:05 +05:30
.js-commit-pipeline-status{ data: { endpoint: pipelines_project_commit_path(project, commit.id, ref: ref) } }
2018-03-17 18:26:18 +05:30
2021-01-29 00:20:46 +05:30
.commit-sha-group.btn-group.d-none.d-sm-flex
2019-07-31 22:56:46 +05:30
.label.label-monospace.monospace
2018-11-29 20:51:05 +05:30
= commit.short_id
2021-04-17 20:07:23 +05:30
= clipboard_button(text: commit.id, title: _("Copy commit SHA"), class: "gl-button btn btn-default btn-icon", container: "body")
2018-11-29 20:51:05 +05:30
= link_to_browse_code(project, commit)