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

61 lines
2.7 KiB
Text
Raw Normal View History

2018-03-17 18:26:18 +05:30
- 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 }
- link = commit_path(project, commit, merge_request: merge_request)
- cache_key = [project.full_path,
commit.id,
Gitlab::CurrentSettings.current_application_settings,
@path.presence,
current_controller?(:commits),
merge_request&.iid,
view_details,
commit.status(ref),
I18n.locale].compact
2015-10-24 18:46:33 +05:30
2016-09-29 09:46:39 +05:30
= cache(cache_key, expires_in: 1.day) do
2017-09-10 17:25:29 +05:30
%li.commit.flex-row.js-toggle-container{ id: "commit-#{commit.short_id}" }
2016-08-24 12:49:21 +05:30
2017-08-17 22:00:37 +05:30
.avatar-cell.hidden-xs
= author_avatar(commit, size: 36)
2014-09-02 18:07:02 +05:30
2017-08-17 22:00:37 +05:30
.commit-detail
.commit-content
2018-03-17 18:26:18 +05:30
= link_to_markdown_field(commit, :title, link, class: "commit-row-message item-title")
2017-08-17 22:00:37 +05:30
%span.commit-row-message.visible-xs-inline
·
= commit.short_id
- if commit.status(ref)
.visible-xs-inline
2016-11-24 13:41:30 +05:30
= render_commit_status(commit, ref: ref)
2017-08-17 22:00:37 +05:30
- if commit.description?
%button.text-expander.hidden-xs.js-toggle-button{ type: "button" } ...
2014-09-02 18:07:02 +05:30
2017-08-17 22:00:37 +05:30
- if commit.description?
%pre.commit-row-description.js-toggle-content
2018-03-17 18:26:18 +05:30
= preserve(markdown_field(commit, :description))
2017-08-17 22:00:37 +05:30
.commiter
2017-09-10 17:25:29 +05:30
- commit_author_link = commit_author_link(commit, avatar: false, size: 24)
2018-03-17 18:26:18 +05:30
- 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 }
2017-09-10 17:25:29 +05:30
#{ commit_text.html_safe }
2018-03-17 18:26:18 +05:30
.commit-actions.flex-row.hidden-xs
2017-09-10 17:25:29 +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
2017-08-17 22:00:37 +05:30
- if commit.status(ref)
= render_commit_status(commit, ref: ref)
2017-09-10 17:25:29 +05:30
2018-03-17 18:26:18 +05:30
.js-commit-pipeline-status{ data: { endpoint: pipelines_project_commit_path(project, commit.id) } }
= link_to commit.short_id, link, class: "commit-sha btn btn-transparent btn-link"
2017-09-10 17:25:29 +05:30
= clipboard_button(text: commit.id, title: _("Copy commit SHA to clipboard"))
2017-08-17 22:00:37 +05:30
= link_to_browse_code(project, commit)
2018-03-17 18:26:18 +05:30
- if view_details && merge_request
= link_to "View details", project_commit_path(project, commit.id, merge_request_iid: merge_request.iid), class: "btn btn-default"