Commit f0750b9166dd729383c4b3f865c80bb024d03798
1 parent
555c25e6
Exists in
spb-stable
and in
3 other branches
Add close button to MR comment form
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing
4 changed files
with
26 additions
and
20 deletions
Show diff stats
app/assets/stylesheets/generic/buttons.scss
| @@ -118,7 +118,6 @@ | @@ -118,7 +118,6 @@ | ||
| 118 | @extend .btn-primary; | 118 | @extend .btn-primary; |
| 119 | } | 119 | } |
| 120 | 120 | ||
| 121 | - &.btn-close, | ||
| 122 | &.btn-remove { | 121 | &.btn-remove { |
| 123 | @extend .btn-danger; | 122 | @extend .btn-danger; |
| 124 | } | 123 | } |
| @@ -143,6 +142,22 @@ | @@ -143,6 +142,22 @@ | ||
| 143 | line-height: 16px; | 142 | line-height: 16px; |
| 144 | margin: 2px; | 143 | margin: 2px; |
| 145 | } | 144 | } |
| 145 | + | ||
| 146 | + &.btn-close { | ||
| 147 | + color: #B94A48; | ||
| 148 | + font-weight: bold; | ||
| 149 | + &:hover { | ||
| 150 | + color: #B94A48; | ||
| 151 | + } | ||
| 152 | + } | ||
| 153 | + | ||
| 154 | + &.btn-reopen { | ||
| 155 | + color: #468847; | ||
| 156 | + font-weight: bold; | ||
| 157 | + &:hover { | ||
| 158 | + color: #468847; | ||
| 159 | + } | ||
| 160 | + } | ||
| 146 | } | 161 | } |
| 147 | 162 | ||
| 148 | .btn-block { | 163 | .btn-block { |
app/assets/stylesheets/sections/issues.scss
| @@ -65,21 +65,6 @@ | @@ -65,21 +65,6 @@ | ||
| 65 | } | 65 | } |
| 66 | } | 66 | } |
| 67 | 67 | ||
| 68 | -.btn.close_issue { | ||
| 69 | - color: #B94A48; | ||
| 70 | - font-weight: bold; | ||
| 71 | - &:hover { | ||
| 72 | - color: #B94A48; | ||
| 73 | - } | ||
| 74 | -} | ||
| 75 | -.btn.reopen_issue { | ||
| 76 | - color: #468847; | ||
| 77 | - font-weight: bold; | ||
| 78 | - &:hover { | ||
| 79 | - color: #468847; | ||
| 80 | - } | ||
| 81 | -} | ||
| 82 | - | ||
| 83 | @media (min-width: 800px) { .issues_filters select { width: 160px; } } | 68 | @media (min-width: 800px) { .issues_filters select { width: 160px; } } |
| 84 | @media (min-width: 1200px) { .issues_filters select { width: 220px; } } | 69 | @media (min-width: 1200px) { .issues_filters select { width: 220px; } } |
| 85 | 70 |
app/views/projects/issues/show.html.haml
| @@ -16,9 +16,9 @@ | @@ -16,9 +16,9 @@ | ||
| 16 | New Issue | 16 | New Issue |
| 17 | - if can?(current_user, :modify_issue, @issue) | 17 | - if can?(current_user, :modify_issue, @issue) |
| 18 | - if @issue.closed? | 18 | - if @issue.closed? |
| 19 | - = link_to 'Reopen', project_issue_path(@project, @issue, issue: {state_event: :reopen }, status_only: true), method: :put, class: "btn grouped reopen_issue" | 19 | + = link_to 'Reopen', project_issue_path(@project, @issue, issue: {state_event: :reopen }, status_only: true), method: :put, class: "btn grouped btn-reopen" |
| 20 | - else | 20 | - else |
| 21 | - = 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" | 21 | + = link_to 'Close', project_issue_path(@project, @issue, issue: {state_event: :close }, status_only: true), method: :put, class: "btn grouped btn-close", title: "Close Issue" |
| 22 | 22 | ||
| 23 | = link_to edit_project_issue_path(@project, @issue), class: "btn grouped" do | 23 | = link_to edit_project_issue_path(@project, @issue), class: "btn grouped" do |
| 24 | %i.icon-edit | 24 | %i.icon-edit |
| @@ -54,9 +54,9 @@ | @@ -54,9 +54,9 @@ | ||
| 54 | - content_for :note_actions do | 54 | - content_for :note_actions do |
| 55 | - if can?(current_user, :modify_issue, @issue) | 55 | - if can?(current_user, :modify_issue, @issue) |
| 56 | - if @issue.closed? | 56 | - if @issue.closed? |
| 57 | - = link_to 'Reopen Issue', project_issue_path(@project, @issue, issue: {state_event: :reopen }, status_only: true), method: :put, class: "btn grouped reopen_issue" | 57 | + = link_to 'Reopen Issue', project_issue_path(@project, @issue, issue: {state_event: :reopen }, status_only: true), method: :put, class: "btn grouped btn-reopen" |
| 58 | - else | 58 | - else |
| 59 | - = 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" | 59 | + = link_to 'Close Issue', project_issue_path(@project, @issue, issue: {state_event: :close }, status_only: true), method: :put, class: "btn grouped btn-close", title: "Close Issue" |
| 60 | 60 | ||
| 61 | .participants | 61 | .participants |
| 62 | %cite.cgray #{@issue.participants.count} participants | 62 | %cite.cgray #{@issue.participants.count} participants |
app/views/projects/merge_requests/_show.html.haml
| @@ -22,6 +22,12 @@ | @@ -22,6 +22,12 @@ | ||
| 22 | %i.icon-list-alt | 22 | %i.icon-list-alt |
| 23 | Diff | 23 | Diff |
| 24 | 24 | ||
| 25 | + - content_for :note_actions do | ||
| 26 | + - if can?(current_user, :modify_merge_request, @merge_request) | ||
| 27 | + - unless @merge_request.closed? | ||
| 28 | + = link_to 'Close', project_merge_request_path(@project, @merge_request, merge_request: {state_event: :close }), method: :put, class: "btn grouped btn-close", title: "Close merge request" | ||
| 29 | + | ||
| 30 | + | ||
| 25 | .notes.tab-content.voting_notes#notes{ class: (controller.action_name == 'show') ? "" : "hide" } | 31 | .notes.tab-content.voting_notes#notes{ class: (controller.action_name == 'show') ? "" : "hide" } |
| 26 | = render "projects/notes/notes_with_form" | 32 | = render "projects/notes/notes_with_form" |
| 27 | .diffs.tab-content | 33 | .diffs.tab-content |