gitlab-org--gitlab-foss/app/views/projects/commits/_commit.html.haml

65 lines
2.8 KiB
Text
Raw Normal View History

2017-11-21 13:06:38 -05:00
- view_details = local_assigns.fetch(:view_details, false)
- 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-11-21 13:06:38 -05:00
- link = commit_path(project, commit, merge_request: merge_request)
- cache_key = [project.full_path,
ref,
2017-11-21 13:06:38 -05:00
commit.id,
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
= cache(cache_key, expires_in: 1.day) do
%li.commit.flex-row.js-toggle-container{ id: "commit-#{commit.short_id}" }
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)
.commit-detail.flex-list
.commit-content
- 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")
%span.commit-row-message.d-block.d-sm-none
·
= commit.short_id
2018-01-22 19:34:21 -05:00
- if commit.status(ref)
.d-block.d-sm-none
2018-01-22 19:34:21 -05:00
= render_commit_status(commit, ref: ref)
- if commit.description?
%button.text-expander.d-none.d-sm-inline-block.js-toggle-button{ type: "button" } ...
- if commit.description?
%pre.commit-row-description.js-toggle-content
= preserve(markdown_field(commit, :description))
.commiter
2017-06-09 09:08:39 -04:00
- commit_author_link = commit_author_link(commit, avatar: false, size: 24)
- 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)
.js-commit-pipeline-status{ data: { endpoint: pipelines_project_commit_path(project, commit.id, ref: ref) } }
.commit-sha-group
2018-04-13 15:33:27 -04:00
.badge.label-monospace
= 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")
= link_to_browse_code(project, commit)