diff options
author | Phil Hughes <me@iamphill.com> | 2016-03-29 18:17:31 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2016-04-04 10:48:49 +0100 |
commit | b7f0b22b9fe76f634d9e8cbce03cfaac41f333e6 (patch) | |
tree | 231a29b941866a0b1c46e85a0d328486ae0fe1e8 /app/views | |
parent | 3dd91f55a048c13e6dc81ec685e521d2fc5a78f5 (diff) | |
download | gitlab-ce-b7f0b22b9fe76f634d9e8cbce03cfaac41f333e6.tar.gz |
Started refactoring of note form
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/projects/_zen.html.haml | 7 | ||||
-rw-r--r-- | app/views/projects/notes/_form.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/notes/_notes_with_form.html.haml | 34 |
3 files changed, 23 insertions, 20 deletions
diff --git a/app/views/projects/_zen.html.haml b/app/views/projects/_zen.html.haml index e701253d7de..93a7e1cfebd 100644 --- a/app/views/projects/_zen.html.haml +++ b/app/views/projects/_zen.html.haml @@ -5,8 +5,7 @@ = f.text_area attr, class: classes - else = text_area_tag attr, nil, class: classes - %a.js-zen-enter(tabindex="-1" href="#") - = icon('expand') - Edit in fullscreen - %a.js-zen-leave(tabindex="-1" href="#") + %a.js-zen-enter{ tabindex: "-1", href: "#" } + Go full screen + %a.js-zen-leave{ tabindex: "-1", href: "#" } = icon('compress') diff --git a/app/views/projects/notes/_form.html.haml b/app/views/projects/notes/_form.html.haml index f675f092da1..8517e5a765a 100644 --- a/app/views/projects/notes/_form.html.haml +++ b/app/views/projects/notes/_form.html.haml @@ -1,4 +1,4 @@ -= form_for [@project.namespace.becomes(Namespace), @project, @note], remote: true, html: { :'data-type' => 'json', multipart: true, id: nil, class: "new_note js-new-note-form js-quick-submit common-note-form gfm-form" }, authenticity_token: true do |f| += form_for [@project.namespace.becomes(Namespace), @project, @note], remote: true, html: { :'data-type' => 'json', multipart: true, id: nil, class: "new-note js-new-note-form js-quick-submit common-note-form gfm-form" }, authenticity_token: true do |f| = hidden_field_tag :view, diff_view = hidden_field_tag :line_type = note_target_fields(@note) diff --git a/app/views/projects/notes/_notes_with_form.html.haml b/app/views/projects/notes/_notes_with_form.html.haml index 910eb6cf66e..003f42db0b8 100644 --- a/app/views/projects/notes/_notes_with_form.html.haml +++ b/app/views/projects/notes/_notes_with_form.html.haml @@ -1,20 +1,24 @@ %ul#notes-list.notes.main-notes-list.timeline = render "projects/notes/notes" -.js-notes-busy - -.js-main-target-form -- if can? current_user, :create_note, @project - = render "projects/notes/form", view: diff_view -- else - .disabled-comment-area - .disabled-profile - .disabled-comment - %span - Please - = link_to "register",new_user_session_path - or - = link_to "login",new_user_session_path - to post a comment + %li.timeline-entry + .timeline-icon + - if can? current_user, :create_note, @project + %a.author_link{ href: user_path(current_user) } + = image_tag avatar_icon(current_user), alt: current_user.to_reference, class: 'avatar s40' + .timeline-content + .js-main-target-form + - if can? current_user, :create_note, @project + = render "projects/notes/form", view: diff_view + - else + .disabled-comment-area + .disabled-profile + .disabled-comment + %span + Please + = link_to "register",new_user_session_path + or + = link_to "login",new_user_session_path + to post a comment :javascript var notes = new Notes("#{namespace_project_notes_path(namespace_id: @project.namespace, target_id: @noteable.id, target_type: @noteable.class.name.underscore)}", #{@notes.map(&:id).to_json}, #{Time.now.to_i}, "#{diff_view}") |