debian-mirror-gitlab/app/views/events/event/_push.html.haml

50 lines
2 KiB
Text
Raw Normal View History

2016-08-24 12:49:21 +05:30
- project = event.project
2017-08-17 22:00:37 +05:30
= icon_for_profile_event(event)
2018-12-13 13:39:08 +05:30
= event_user_info(event)
.event-title.d-flex.flex-wrap
= inline_event_icon(event)
2019-12-21 20:55:43 +05:30
- many_refs = event.ref_count.to_i > 1
2020-07-28 23:09:34 +05:30
%span.event-type.d-inline-block.gl-mr-2.pushed= many_refs ? "#{event.action_name} #{event.ref_count} #{event.ref_type.pluralize}" : "#{event.action_name} #{event.ref_type}"
2019-12-21 20:55:43 +05:30
- unless many_refs
2021-03-08 18:12:59 +05:30
%span.gl-mr-2.text-truncate
2019-12-21 20:55:43 +05:30
- commits_link = project_commits_path(project, event.ref_name)
- should_link = event.tag? ? project.repository.tag_exists?(event.ref_name) : project.repository.branch_exists?(event.ref_name)
= link_to_if should_link, event.ref_name, commits_link, class: 'ref-name'
2016-08-24 12:49:21 +05:30
= render "events/event_scope", event: event
2014-09-02 18:07:02 +05:30
- if event.push_with_commits?
.event-body
2018-11-08 19:23:39 +05:30
%ul.content-list.event_commits
2017-09-10 17:25:29 +05:30
= render "events/commit", project: project, event: event
2014-09-02 18:07:02 +05:30
2021-04-17 20:07:23 +05:30
- create_mr = event.new_ref? && create_mr_button?(from: project.default_branch, to: event.ref_name, source_project: project, target_project: project) && event.authored_by?(current_user)
- create_mr_path = create_mr_path(from: project.default_branch, to: event.ref_name, source_project: project, target_project: project) if create_mr
2014-09-02 18:07:02 +05:30
- if event.commits_count > 1
%li.commits-stat
2018-03-17 18:26:18 +05:30
%span ... and #{pluralize(event.commits_count - 1, 'more commit')}.
2015-09-11 14:41:01 +05:30
2015-04-26 12:48:37 +05:30
- if event.md_ref?
- from = event.commit_from
- from_label = truncate_sha(from)
- else
2016-08-24 12:49:21 +05:30
- from = project.default_branch
2015-04-26 12:48:37 +05:30
- from_label = from
2015-09-11 14:41:01 +05:30
2017-09-10 17:25:29 +05:30
= link_to project_compare_path(project, from: from, to: event.commit_to) do
2019-09-04 21:01:54 +05:30
%span Compare
%span.commit-sha #{from_label}...#{truncate_sha(event.commit_to)}
2015-09-11 14:41:01 +05:30
- if create_mr
2017-08-17 22:00:37 +05:30
%span
2015-09-11 14:41:01 +05:30
or
2021-04-17 20:07:23 +05:30
= link_to create_mr_path do
2015-09-11 14:41:01 +05:30
create a merge request
- elsif create_mr
2017-08-17 22:00:37 +05:30
%li.commits-stat
2021-04-17 20:07:23 +05:30
= link_to create_mr_path do
2015-09-11 14:41:01 +05:30
Create Merge Request