remove notify checkboxes from note forms
This commit is contained in:
parent
70947fedda
commit
5ad4be295f
5 changed files with 12 additions and 30 deletions
|
@ -274,6 +274,15 @@ ul.notes {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.common-note-form {
|
||||||
|
margin: 0;
|
||||||
|
height: 140px;
|
||||||
|
background: #F9F9F9;
|
||||||
|
padding: 3px;
|
||||||
|
padding-bottom: 25px;
|
||||||
|
border: 1px solid #DDD;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.note-form-actions {
|
.note-form-actions {
|
||||||
background: #F9F9F9;
|
background: #F9F9F9;
|
||||||
|
@ -281,8 +290,8 @@ ul.notes {
|
||||||
padding: 0 5px;
|
padding: 0 5px;
|
||||||
|
|
||||||
.note-form-option {
|
.note-form-option {
|
||||||
margin-top: 8px;
|
margin-top: 10px;
|
||||||
margin-left: 15px;
|
margin-left: 30px;
|
||||||
@extend .pull-left;
|
@extend .pull-left;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,6 @@ module Notes
|
||||||
def execute
|
def execute
|
||||||
note = project.notes.new(params[:note])
|
note = project.notes.new(params[:note])
|
||||||
note.author = current_user
|
note.author = current_user
|
||||||
note.notify = params[:notify].present?
|
|
||||||
note.notify_author = params[:notify_author].present?
|
|
||||||
note.save
|
note.save
|
||||||
note
|
note
|
||||||
end
|
end
|
||||||
|
|
|
@ -22,9 +22,6 @@ class Note < ActiveRecord::Base
|
||||||
attr_accessible :note, :noteable, :noteable_id, :noteable_type, :project_id,
|
attr_accessible :note, :noteable, :noteable_id, :noteable_type, :project_id,
|
||||||
:attachment, :line_code, :commit_id
|
:attachment, :line_code, :commit_id
|
||||||
|
|
||||||
attr_accessor :notify
|
|
||||||
attr_accessor :notify_author
|
|
||||||
|
|
||||||
belongs_to :project
|
belongs_to :project
|
||||||
belongs_to :noteable, polymorphic: true
|
belongs_to :noteable, polymorphic: true
|
||||||
belongs_to :author, class_name: "User"
|
belongs_to :author, class_name: "User"
|
||||||
|
@ -143,14 +140,6 @@ class Note < ActiveRecord::Base
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
|
|
||||||
def notify
|
|
||||||
@notify ||= false
|
|
||||||
end
|
|
||||||
|
|
||||||
def notify_author
|
|
||||||
@notify_author ||= false
|
|
||||||
end
|
|
||||||
|
|
||||||
# Returns true if this is an upvote note,
|
# Returns true if this is an upvote note,
|
||||||
# otherwise false is returned
|
# otherwise false is returned
|
||||||
def upvote?
|
def upvote?
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
= form_for [@project, @note], remote: true, html: { multipart: true, id: nil, class: "new_note js-new-note-form" } do |f|
|
= form_for [@project, @note], remote: true, html: { multipart: true, id: nil, class: "new_note js-new-note-form common-note-form" } do |f|
|
||||||
|
|
||||||
= note_target_fields
|
= note_target_fields
|
||||||
= f.hidden_field :commit_id
|
= f.hidden_field :commit_id
|
||||||
|
@ -26,15 +26,6 @@
|
||||||
|
|
||||||
%a.btn.grouped.js-close-discussion-note-form Cancel
|
%a.btn.grouped.js-close-discussion-note-form Cancel
|
||||||
|
|
||||||
.note-form-option
|
|
||||||
= label_tag :notify do
|
|
||||||
= check_box_tag :notify, 1, false
|
|
||||||
%span.light Notify team via email
|
|
||||||
|
|
||||||
.js-notify-commit-author
|
|
||||||
= label_tag :notify_author do
|
|
||||||
= check_box_tag :notify_author, 1 , false
|
|
||||||
%span.light Notify commit author
|
|
||||||
.note-form-option
|
.note-form-option
|
||||||
%a.choose-btn.btn.btn-small.js-choose-note-attachment-button
|
%a.choose-btn.btn.btn-small.js-choose-note-attachment-button
|
||||||
%i.icon-paper-clip
|
%i.icon-paper-clip
|
||||||
|
|
|
@ -11,11 +11,6 @@
|
||||||
.buttons
|
.buttons
|
||||||
= f.submit 'Add Comment', class: "btn comment-btn grouped js-comment-button"
|
= f.submit 'Add Comment', class: "btn comment-btn grouped js-comment-button"
|
||||||
|
|
||||||
.note-form-option
|
|
||||||
= label_tag :notify do
|
|
||||||
= check_box_tag :notify, 1, false
|
|
||||||
%span.light Notify team via email
|
|
||||||
|
|
||||||
.note-form-option
|
.note-form-option
|
||||||
%a.choose-btn.btn.btn-small.js-choose-note-attachment-button
|
%a.choose-btn.btn.btn-small.js-choose-note-attachment-button
|
||||||
%i.icon-paper-clip
|
%i.icon-paper-clip
|
||||||
|
|
Loading…
Reference in a new issue