Commit 5ad4be295f68310bbd031585bbf6e203084f325e
1 parent
70947fed
Exists in
master
and in
4 other branches
remove notify checkboxes from note forms
Showing
5 changed files
with
12 additions
and
30 deletions
Show diff stats
app/assets/stylesheets/sections/notes.scss
| @@ -274,6 +274,15 @@ ul.notes { | @@ -274,6 +274,15 @@ ul.notes { | ||
| 274 | } | 274 | } |
| 275 | 275 | ||
| 276 | 276 | ||
| 277 | +.common-note-form { | ||
| 278 | + margin: 0; | ||
| 279 | + height: 140px; | ||
| 280 | + background: #F9F9F9; | ||
| 281 | + padding: 3px; | ||
| 282 | + padding-bottom: 25px; | ||
| 283 | + border: 1px solid #DDD; | ||
| 284 | +} | ||
| 285 | + | ||
| 277 | 286 | ||
| 278 | .note-form-actions { | 287 | .note-form-actions { |
| 279 | background: #F9F9F9; | 288 | background: #F9F9F9; |
| @@ -281,8 +290,8 @@ ul.notes { | @@ -281,8 +290,8 @@ ul.notes { | ||
| 281 | padding: 0 5px; | 290 | padding: 0 5px; |
| 282 | 291 | ||
| 283 | .note-form-option { | 292 | .note-form-option { |
| 284 | - margin-top: 8px; | ||
| 285 | - margin-left: 15px; | 293 | + margin-top: 10px; |
| 294 | + margin-left: 30px; | ||
| 286 | @extend .pull-left; | 295 | @extend .pull-left; |
| 287 | } | 296 | } |
| 288 | 297 |
app/contexts/notes/create_context.rb
| @@ -3,8 +3,6 @@ module Notes | @@ -3,8 +3,6 @@ module Notes | ||
| 3 | def execute | 3 | def execute |
| 4 | note = project.notes.new(params[:note]) | 4 | note = project.notes.new(params[:note]) |
| 5 | note.author = current_user | 5 | note.author = current_user |
| 6 | - note.notify = params[:notify].present? | ||
| 7 | - note.notify_author = params[:notify_author].present? | ||
| 8 | note.save | 6 | note.save |
| 9 | note | 7 | note |
| 10 | end | 8 | end |
app/models/note.rb
| @@ -22,9 +22,6 @@ class Note < ActiveRecord::Base | @@ -22,9 +22,6 @@ class Note < ActiveRecord::Base | ||
| 22 | attr_accessible :note, :noteable, :noteable_id, :noteable_type, :project_id, | 22 | attr_accessible :note, :noteable, :noteable_id, :noteable_type, :project_id, |
| 23 | :attachment, :line_code, :commit_id | 23 | :attachment, :line_code, :commit_id |
| 24 | 24 | ||
| 25 | - attr_accessor :notify | ||
| 26 | - attr_accessor :notify_author | ||
| 27 | - | ||
| 28 | belongs_to :project | 25 | belongs_to :project |
| 29 | belongs_to :noteable, polymorphic: true | 26 | belongs_to :noteable, polymorphic: true |
| 30 | belongs_to :author, class_name: "User" | 27 | belongs_to :author, class_name: "User" |
| @@ -143,14 +140,6 @@ class Note < ActiveRecord::Base | @@ -143,14 +140,6 @@ class Note < ActiveRecord::Base | ||
| 143 | nil | 140 | nil |
| 144 | end | 141 | end |
| 145 | 142 | ||
| 146 | - def notify | ||
| 147 | - @notify ||= false | ||
| 148 | - end | ||
| 149 | - | ||
| 150 | - def notify_author | ||
| 151 | - @notify_author ||= false | ||
| 152 | - end | ||
| 153 | - | ||
| 154 | # Returns true if this is an upvote note, | 143 | # Returns true if this is an upvote note, |
| 155 | # otherwise false is returned | 144 | # otherwise false is returned |
| 156 | def upvote? | 145 | def upvote? |
app/views/notes/_form.html.haml
| 1 | -= form_for [@project, @note], remote: true, html: { multipart: true, id: nil, class: "new_note js-new-note-form" } do |f| | 1 | += form_for [@project, @note], remote: true, html: { multipart: true, id: nil, class: "new_note js-new-note-form common-note-form" } do |f| |
| 2 | 2 | ||
| 3 | = note_target_fields | 3 | = note_target_fields |
| 4 | = f.hidden_field :commit_id | 4 | = f.hidden_field :commit_id |
| @@ -27,15 +27,6 @@ | @@ -27,15 +27,6 @@ | ||
| 27 | %a.btn.grouped.js-close-discussion-note-form Cancel | 27 | %a.btn.grouped.js-close-discussion-note-form Cancel |
| 28 | 28 | ||
| 29 | .note-form-option | 29 | .note-form-option |
| 30 | - = label_tag :notify do | ||
| 31 | - = check_box_tag :notify, 1, false | ||
| 32 | - %span.light Notify team via email | ||
| 33 | - | ||
| 34 | - .js-notify-commit-author | ||
| 35 | - = label_tag :notify_author do | ||
| 36 | - = check_box_tag :notify_author, 1 , false | ||
| 37 | - %span.light Notify commit author | ||
| 38 | - .note-form-option | ||
| 39 | %a.choose-btn.btn.btn-small.js-choose-note-attachment-button | 30 | %a.choose-btn.btn.btn-small.js-choose-note-attachment-button |
| 40 | %i.icon-paper-clip | 31 | %i.icon-paper-clip |
| 41 | %span Choose File ... | 32 | %span Choose File ... |
app/views/walls/show.html.haml
| @@ -12,11 +12,6 @@ | @@ -12,11 +12,6 @@ | ||
| 12 | = f.submit 'Add Comment', class: "btn comment-btn grouped js-comment-button" | 12 | = f.submit 'Add Comment', class: "btn comment-btn grouped js-comment-button" |
| 13 | 13 | ||
| 14 | .note-form-option | 14 | .note-form-option |
| 15 | - = label_tag :notify do | ||
| 16 | - = check_box_tag :notify, 1, false | ||
| 17 | - %span.light Notify team via email | ||
| 18 | - | ||
| 19 | - .note-form-option | ||
| 20 | %a.choose-btn.btn.btn-small.js-choose-note-attachment-button | 15 | %a.choose-btn.btn.btn-small.js-choose-note-attachment-button |
| 21 | %i.icon-paper-clip | 16 | %i.icon-paper-clip |
| 22 | %span Choose File ... | 17 | %span Choose File ... |