Commit c02e3f2104d9dbb1bca01935fe7c0dfeacf53baf

Authored by Riyad Preukschas
1 parent 3c02c93f

Rename 'notes/form' partial to 'notes/common_form'

app/views/notes/_common_form.html.haml 0 → 100644
... ... @@ -0,0 +1,39 @@
  1 +.note-form-holder
  2 + = form_for [@project, @note], remote: "true", multipart: true do |f|
  3 + %h3.page_title Leave a comment
  4 + -if @note.errors.any?
  5 + .alert-message.block-message.error
  6 + - @note.errors.full_messages.each do |msg|
  7 + %div= msg
  8 +
  9 + = f.hidden_field :noteable_id
  10 + = f.hidden_field :noteable_type
  11 + = f.text_area :note, size: 255, class: 'note-text'
  12 + #preview-note.preview_note.hide
  13 + .hint
  14 + .right Comments are parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}.
  15 + .clearfix
  16 +
  17 + .row.note_advanced_opts.hide
  18 + .span3
  19 + = f.submit 'Add Comment', class: "btn success submit_note grouped", id: "submit_note"
  20 + = link_to 'Preview', preview_project_notes_path(@project), class: 'btn grouped', id: 'preview-link'
  21 + .span4.notify_opts
  22 + %h6.left Notify via email:
  23 + = label_tag :notify do
  24 + = check_box_tag :notify, 1, @note.noteable_type != "Commit"
  25 + %span Project team
  26 +
  27 + - if @note.notify_only_author?(current_user)
  28 + = label_tag :notify_author do
  29 + = check_box_tag :notify_author, 1 , @note.noteable_type == "Commit"
  30 + %span Commit author
  31 + .span5.attachments
  32 + %h6.left Attachment:
  33 + %span.file_name File name...
  34 +
  35 + .input.input_file
  36 + %a.file_upload.btn.small Upload File
  37 + = f.file_field :attachment, class: "input-file"
  38 + %span.hint Any file less than 10 MB
  39 +
... ...
app/views/notes/_form.html.haml
... ... @@ -1,39 +0,0 @@
1   -.note-form-holder
2   - = form_for [@project, @note], remote: "true", multipart: true do |f|
3   - %h3.page_title Leave a comment
4   - -if @note.errors.any?
5   - .alert-message.block-message.error
6   - - @note.errors.full_messages.each do |msg|
7   - %div= msg
8   -
9   - = f.hidden_field :noteable_id
10   - = f.hidden_field :noteable_type
11   - = f.text_area :note, size: 255, class: 'note-text'
12   - #preview-note.preview_note.hide
13   - .hint
14   - .right Comments are parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}.
15   - .clearfix
16   -
17   - .row.note_advanced_opts.hide
18   - .span3
19   - = f.submit 'Add Comment', class: "btn success submit_note grouped", id: "submit_note"
20   - = link_to 'Preview', preview_project_notes_path(@project), class: 'btn grouped', id: 'preview-link'
21   - .span4.notify_opts
22   - %h6.left Notify via email:
23   - = label_tag :notify do
24   - = check_box_tag :notify, 1, @note.noteable_type != "Commit"
25   - %span Project team
26   -
27   - - if @note.notify_only_author?(current_user)
28   - = label_tag :notify_author do
29   - = check_box_tag :notify_author, 1 , @note.noteable_type == "Commit"
30   - %span Commit author
31   - .span5.attachments
32   - %h6.left Attachment:
33   - %span.file_name File name...
34   -
35   - .input.input_file
36   - %a.file_upload.btn.small Upload File
37   - = f.file_field :attachment, class: "input-file"
38   - %span.hint Any file less than 10 MB
39   -
app/views/notes/_notes_with_form.html.haml
... ... @@ -3,7 +3,7 @@
3 3 .notes-status
4 4  
5 5 - if can? current_user, :write_note, @project
6   - = render "notes/form"
  6 + = render "notes/common_form"
7 7  
8 8 :javascript
9 9 $(function(){
... ...