2013-07-23 13:29:35 +01:00
|
|
|
- if can?(:merge, @pull)
|
2014-01-21 04:51:49 +00:00
|
|
|
%a.button{href: '', 'ng-click' => 'merge()', 'ng-show' => "pull.status == 'ready'"}
|
2013-07-12 20:27:49 +01:00
|
|
|
= t 'projects.pull_requests.ready'
|
|
|
|
.both
|
2013-07-12 15:21:46 +01:00
|
|
|
|
|
|
|
.flash{'ng-show' => '!pull.mergeable'}
|
|
|
|
.notice{'ng-show' => "pull.status == 'blocked'"}
|
|
|
|
= t "projects.pull_requests.blocked"
|
|
|
|
.alert{'ng-show' => "pull.status == 'merged'"}
|
|
|
|
= t("projects.pull_requests.merged",
|
2014-01-21 04:51:49 +00:00
|
|
|
user: '{{pull.merged_by.uname}}',
|
|
|
|
to_ref: show_ref(@pull, 'to'),
|
|
|
|
from_ref: show_ref(@pull, 'from'),
|
|
|
|
time: '{{merged_at}}').html_safe
|
2013-07-12 15:21:46 +01:00
|
|
|
.alert{'ng-show' => "pull.status == 'closed'"}
|
|
|
|
= t("projects.pull_requests.closed",
|
2014-01-21 04:51:49 +00:00
|
|
|
user: '{{pull.closed_by.uname}}',
|
|
|
|
time: '{{closed_at}}')
|
2013-07-12 20:27:49 +01:00
|
|
|
.both
|
2013-07-12 15:21:46 +01:00
|
|
|
|
|
|
|
|
|
|
|
- if !@pull.cross_pull? && can?(:write, @project)
|
2013-07-18 18:20:22 +01:00
|
|
|
%div{'ng-init' => "getBranch('#{@pull.from_ref}')", 'ng-show' => "pull.status == 'closed' || pull.status == 'merged'"}
|
2014-01-21 04:51:49 +00:00
|
|
|
%a.button{href: '', 'ng-click' => 'deleteBranch()', 'ng-show' => "branch && branch.object.sha == pull.from_ref.sha"}
|
2013-07-12 15:21:46 +01:00
|
|
|
= t('layout.projects.delete_branch')
|
2014-01-21 04:51:49 +00:00
|
|
|
%a.button{href: '', 'ng-click' => 'restoreBranch()', 'ng-hide' => "branch"}
|
2013-07-12 15:21:46 +01:00
|
|
|
= t('layout.projects.restore_branch')
|
2013-07-12 20:27:49 +01:00
|
|
|
.both
|
2013-07-12 15:21:46 +01:00
|
|
|
|
|
|
|
|
|
|
|
-if can? :update, @pull
|
|
|
|
%br
|
2014-01-21 04:51:49 +00:00
|
|
|
%a.button{href: '', 'ng-click' => 'reopen()', 'ng-show' => "pull.status == 'closed'"}
|
2013-07-12 15:21:46 +01:00
|
|
|
= t '.reopen'
|
2014-01-21 04:51:49 +00:00
|
|
|
%a.button{href: '', 'ng-click' => 'close()', 'ng-show' => "pull.status == 'ready' || pull.status == 'open' || pull.status == 'blocked'"}
|
2013-07-12 15:21:46 +01:00
|
|
|
= t '.close'
|