diff options
-rw-r--r-- | app/views/issues/show.html.haml | 13 | ||||
-rw-r--r-- | app/views/notes/_form.html.haml | 2 |
2 files changed, 12 insertions, 3 deletions
diff --git a/app/views/issues/show.html.haml b/app/views/issues/show.html.haml index f1a97e10913..2997cde1ed2 100644 --- a/app/views/issues/show.html.haml +++ b/app/views/issues/show.html.haml @@ -6,15 +6,16 @@ = @issue.created_at.stamp("Aug 21, 2011") %span.pull-right - - if can?(current_user, :admin_project, @project) || @issue.author == current_user + - if can?(current_user, :modify_issue, @issue) - if @issue.closed? = link_to 'Reopen', project_issue_path(@project, @issue, issue: {state_event: :reopen }, status_only: true), method: :put, class: "btn grouped reopen_issue" - else = link_to 'Close', project_issue_path(@project, @issue, issue: {state_event: :close }, status_only: true), method: :put, class: "btn grouped close_issue", title: "Close Issue" - - if can?(current_user, :admin_project, @project) || @issue.author == current_user + + - if can?(current_user, :admin_issue, @issue) = link_to edit_project_issue_path(@project, @issue), class: "btn grouped" do %i.icon-edit - Edit + Edit .pull-right .span3#votes= render 'votes/votes_block', votable: @issue @@ -55,5 +56,11 @@ = preserve do = markdown @issue.description +- content_for :note_actions do + - if can?(current_user, :modify_issue, @issue) + - if @issue.closed? + = link_to 'Reopen Issue', project_issue_path(@project, @issue, issue: {state_event: :reopen }, status_only: true), method: :put, class: "btn grouped reopen_issue" + - else + = link_to 'Close Issue', project_issue_path(@project, @issue, issue: {state_event: :close }, status_only: true), method: :put, class: "btn grouped close_issue", title: "Close Issue" .voting_notes#notes= render "notes/notes_with_form" diff --git a/app/views/notes/_form.html.haml b/app/views/notes/_form.html.haml index a154c31e5ab..eadf5bc65ae 100644 --- a/app/views/notes/_form.html.haml +++ b/app/views/notes/_form.html.haml @@ -22,6 +22,8 @@ .note-form-actions .buttons = f.submit 'Add Comment', class: "btn comment-btn grouped js-comment-button" + = yield(:note_actions) + %a.btn.grouped.js-close-discussion-note-form Cancel .note-form-option |