summaryrefslogtreecommitdiff
path: root/app/views/events
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-05-09 22:26:25 +0200
committerDouwe Maan <douwe@gitlab.com>2015-05-09 22:26:52 +0200
commit722e3935893e0493e5783f1a61034fe1481f8cb8 (patch)
tree9f051a8e42f0659adde57027b67efb3365de279d /app/views/events
parent8f75ab21d021fb5335ed9e084157cf2bc06caca1 (diff)
downloadgitlab-ce-722e3935893e0493e5783f1a61034fe1481f8cb8.tar.gz
Add Create Merge Request buttons to commits page and push event.
Diffstat (limited to 'app/views/events')
-rw-r--r--app/views/events/event/_push.html.haml14
1 files changed, 13 insertions, 1 deletions
diff --git a/app/views/events/event/_push.html.haml b/app/views/events/event/_push.html.haml
index 60d7978b13f..1da702be384 100644
--- a/app/views/events/event/_push.html.haml
+++ b/app/views/events/event/_push.html.haml
@@ -17,15 +17,27 @@
- few_commits.each do |commit|
= render "events/commit", commit: commit, project: project
+ - create_mr = current_user == event.author && event.new_ref? && create_mr_button?(event.project.default_branch, event.ref_name, event.project)
- if event.commits_count > 1
%li.commits-stat
- if event.commits_count > 2
%span ... and #{event.commits_count - 2} more commits.
+
- if event.md_ref?
- from = event.commit_from
- from_label = truncate_sha(from)
- else
- from = event.project.default_branch
- from_label = from
+
= link_to namespace_project_compare_path(event.project.namespace, event.project, from: from, to: event.commit_to) do
- %strong Compare &rarr; #{from_label}...#{truncate_sha(event.commit_to)}
+ Compare #{from_label}...#{truncate_sha(event.commit_to)}
+
+ - if create_mr
+ or
+ = link_to create_mr_path(event.project.default_branch, event.ref_name, event.project) do
+ create a merge request
+ - elsif create_mr
+ %li.commits-stat
+ = link_to create_mr_path(event.project.default_branch, event.ref_name, event.project) do
+ Create Merge Request