rosa-build/app/views/projects/pull_requests/_status.html.haml

36 lines
1.5 KiB
Plaintext
Raw Normal View History

2012-09-26 18:09:29 +01:00
- if can?(:merge, @pull) && @pull.can_merging?
2013-07-12 20:27:49 +01:00
%a.button{:href => '', 'ng-click' => 'merge()', 'ng-show' => "pull.status == 'ready'"}
= 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",
:user => '{{pull.merged_by.uname}}',
:to_ref => show_ref(@pull, 'to'),
:from_ref => show_ref(@pull, 'from'),
:time => '{{merged_at}}').html_safe
.alert{'ng-show' => "pull.status == 'closed'"}
= t("projects.pull_requests.closed",
: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-12 20:27:49 +01:00
%div{'ng-init' => 'check_branch = true', 'ng-show' => "pull.status == 'closed' || pull.status == 'merged'"}
%a.button{:href => '', 'ng-click' => 'deleteBranch()', 'ng-show' => "branch && can_delete_branch"}
2013-07-12 15:21:46 +01:00
= t('layout.projects.delete_branch')
%a.button{:href => '', 'ng-click' => 'restoreBranch()', 'ng-hide' => "branch"}
= 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
%a.button{:href => '', 'ng-click' => 'reopen()', 'ng-show' => "pull.status == 'closed'"}
= t '.reopen'
%a.button{:href => '', 'ng-click' => 'close()', 'ng-show' => "pull.status == 'ready' || pull.status == 'open' || pull.status == 'blocked'"}
= t '.close'