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 }
|
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)
|
|
|
|
- cache_key = [project.full_path,
|
2018-04-11 09:54:55 -04:00
|
|
|
ref,
|
2017-11-21 13:06:38 -05:00
|
|
|
commit.id,
|
2018-02-02 13:39:55 -05:00
|
|
|
Gitlab::CurrentSettings.current_application_settings,
|
2017-11-21 13:06:38 -05:00
|
|
|
@path.presence,
|
|
|
|
current_controller?(:commits),
|
|
|
|
merge_request&.iid,
|
|
|
|
view_details,
|
|
|
|
commit.status(ref),
|
|
|
|
I18n.locale].compact
|
2015-09-23 06:18:16 -04:00
|
|
|
|
2016-08-31 10:04:51 -04:00
|
|
|
= cache(cache_key, expires_in: 1.day) do
|
2017-07-06 10:30:43 -04:00
|
|
|
%li.commit.flex-row.js-toggle-container{ id: "commit-#{commit.short_id}" }
|
2016-07-08 20:47:05 -04:00
|
|
|
|
2018-04-09 17:50:40 -04:00
|
|
|
.avatar-cell.d-none.d-sm-block
|
2016-12-09 09:37:44 -05:00
|
|
|
= author_avatar(commit, size: 36)
|
2014-07-08 10:12:06 -04:00
|
|
|
|
2018-02-26 06:18:45 -05:00
|
|
|
.commit-detail.flex-list
|
2017-02-27 22:31:21 -05:00
|
|
|
.commit-content
|
2018-04-06 09:35:07 -04:00
|
|
|
- if view_details && merge_request
|
|
|
|
= link_to commit.title, project_commit_path(project, commit.id, merge_request_iid: merge_request.iid), class: "commit-row-message item-title"
|
|
|
|
- else
|
|
|
|
= link_to_markdown_field(commit, :title, link, class: "commit-row-message item-title")
|
2018-04-09 15:38:44 -04:00
|
|
|
%span.commit-row-message.d-block.d-sm-none
|
2017-02-27 22:31:21 -05:00
|
|
|
·
|
|
|
|
= commit.short_id
|
2018-01-22 19:34:21 -05:00
|
|
|
- if commit.status(ref)
|
2018-04-09 15:38:44 -04:00
|
|
|
.d-block.d-sm-none
|
2018-01-22 19:34:21 -05:00
|
|
|
= render_commit_status(commit, ref: ref)
|
2017-02-27 22:31:21 -05:00
|
|
|
- if commit.description?
|
2018-04-10 16:18:09 -04:00
|
|
|
%button.text-expander.d-none.d-sm-inline-block.js-toggle-button{ type: "button" } ...
|
2014-06-10 02:50:27 -04:00
|
|
|
|
2017-02-27 22:31:21 -05:00
|
|
|
- if commit.description?
|
|
|
|
%pre.commit-row-description.js-toggle-content
|
2017-08-23 12:53:29 -04:00
|
|
|
= preserve(markdown_field(commit, :description))
|
|
|
|
|
2017-02-27 22:31:21 -05:00
|
|
|
.commiter
|
2017-06-09 09:08:39 -04:00
|
|
|
- commit_author_link = commit_author_link(commit, avatar: false, size: 24)
|
2017-12-11 15:42:30 -05:00
|
|
|
- commit_timeago = time_ago_with_tooltip(commit.authored_date, placement: 'bottom')
|
2017-12-13 09:41:52 -05:00
|
|
|
- commit_text = _('%{commit_author_link} authored %{commit_timeago}') % { commit_author_link: commit_author_link, commit_timeago: commit_timeago }
|
2017-06-09 09:08:39 -04:00
|
|
|
#{ commit_text.html_safe }
|
|
|
|
|
2018-04-13 16:56:26 -04:00
|
|
|
.commit-actions.flex-row.d-none.d-sm-flex
|
2017-07-25 03:40:23 -04:00
|
|
|
- if request.xhr?
|
|
|
|
= render partial: 'projects/commit/signature', object: commit.signature
|
|
|
|
- else
|
|
|
|
= render partial: 'projects/commit/ajax_signature', locals: { commit: commit }
|
|
|
|
|
2018-01-22 19:34:21 -05:00
|
|
|
- if commit.status(ref)
|
|
|
|
= render_commit_status(commit, ref: ref)
|
|
|
|
|
2018-04-11 09:54:55 -04:00
|
|
|
.js-commit-pipeline-status{ data: { endpoint: pipelines_project_commit_path(project, commit.id, ref: ref) } }
|
2017-06-29 17:19:09 -04:00
|
|
|
|
2018-04-06 09:35:07 -04:00
|
|
|
.commit-sha-group
|
2018-04-13 15:33:27 -04:00
|
|
|
.badge.label-monospace
|
2018-04-06 09:35:07 -04:00
|
|
|
= commit.short_id
|
2018-04-09 13:05:46 -04:00
|
|
|
= clipboard_button(text: commit.id, title: _("Copy commit SHA to clipboard"), class: "btn btn-secondary", container: "body")
|
2018-04-06 09:35:07 -04:00
|
|
|
= link_to_browse_code(project, commit)
|