BigW Consortium Gitlab

_notes_with_form.html.haml 1.13 KB
Newer Older
1
%ul#notes-list.notes.main-notes-list.timeline
2
  = render "projects/notes/notes"
3 4 5

= render 'projects/notes/edit_form'

Phil Hughes committed
6
%ul.notes.notes-form.timeline
7
  %li.timeline-entry
8 9
    .flash-container.timeline-content

Phil Hughes committed
10 11
    - if can? current_user, :create_note, @project
      .timeline-icon.hidden-xs.hidden-sm
12 13
        %a.author_link{ href: user_path(current_user) }
          = image_tag avatar_icon(current_user), alt: current_user.to_reference, class: 'avatar s40'
Phil Hughes committed
14
      .timeline-content.timeline-content-form
Phil Hughes committed
15
        = render "projects/notes/form", view: diff_view
16
    - elsif !current_user
Phil Hughes committed
17 18 19
      .disabled-comment.text-center
        .disabled-comment-text.inline
          Please
20
          = link_to "register", new_session_path(:user, redirect_to_referer: 'yes')
Phil Hughes committed
21
          or
22
          = link_to "sign in", new_session_path(:user, redirect_to_referer: 'yes')
Phil Hughes committed
23
          to post a comment
24

gitlabhq committed
25
:javascript
26
  var notes = new Notes("#{namespace_project_noteable_notes_path(namespace_id: @project.namespace, project_id: @project, target_id: @noteable.id, target_type: @noteable.class.name.underscore)}", #{@notes.map(&:id).to_json}, #{Time.now.to_i}, "#{diff_view}")