2017-10-10 11:36:32 -04:00
|
|
|
- disable_collapse_class = local_assigns.fetch(:disable_collapse_class, false)
|
|
|
|
- collapsed_class = 'collapsed' if discussion.resolved? && !disable_collapse_class
|
2017-10-07 00:25:17 -04:00
|
|
|
- badge_counter = discussion_counter + 1 if local_assigns[:discussion_counter]
|
|
|
|
- show_toggle = local_assigns.fetch(:show_toggle, true)
|
|
|
|
- show_image_comment_badge = local_assigns.fetch(:show_image_comment_badge, false)
|
|
|
|
|
|
|
|
.discussion-notes{ class: collapsed_class }
|
|
|
|
-# Save the first note position data so that we have a reference and can go
|
|
|
|
-# to the first note position when we click on a badge diff discussion
|
|
|
|
%ul.notes{ id: "discussion_#{discussion.id}", data: { discussion_id: discussion.id, position: discussion.notes[0].position.to_json } }
|
|
|
|
- if discussion.try(:on_image?) && show_toggle
|
|
|
|
%button.diff-notes-collapse.js-diff-notes-toggle{ type: 'button' }
|
|
|
|
= sprite_icon('collapse', css_class: 'collapse-icon')
|
2018-04-09 12:33:41 -04:00
|
|
|
%button.btn-transparent.badge.badge-pill.js-diff-notes-toggle{ type: 'button' }
|
2017-10-07 00:25:17 -04:00
|
|
|
= badge_counter
|
|
|
|
= render partial: "shared/notes/note", collection: discussion.notes, as: :note, locals: { badge_counter: badge_counter, show_image_comment_badge: show_image_comment_badge }
|
2016-07-26 00:49:53 -04:00
|
|
|
|
2017-05-26 15:01:42 -04:00
|
|
|
.flash-container
|
|
|
|
|
|
|
|
.discussion-reply-holder
|
|
|
|
- if can_create_note?
|
2019-06-06 11:51:04 -04:00
|
|
|
%a.user-avatar-link.d-none.d-sm-block{ href: user_path(current_user) }
|
|
|
|
= image_tag avatar_icon_for_user(current_user), alt: current_user.to_reference, class: 'avatar s40'
|
2017-03-30 22:34:14 -04:00
|
|
|
- if discussion.potentially_resolvable?
|
|
|
|
- line_type = local_assigns.fetch(:line_type, nil)
|
2016-07-28 21:14:00 -04:00
|
|
|
|
2019-06-06 11:51:04 -04:00
|
|
|
.discussion-with-resolve-btn
|
|
|
|
.btn-group.discussion-with-resolve-btn{ role: "group" }
|
|
|
|
.btn-group{ role: "group" }
|
|
|
|
= link_to_reply_discussion(discussion, line_type)
|
2017-03-09 20:29:11 -05:00
|
|
|
|
2019-06-06 11:51:04 -04:00
|
|
|
= render "discussions/resolve_all", discussion: discussion
|
2017-03-21 11:28:47 -04:00
|
|
|
|
2019-06-06 11:51:04 -04:00
|
|
|
.btn-group.discussion-actions
|
|
|
|
= render "discussions/new_issue_for_discussion", discussion: discussion, merge_request: discussion.noteable
|
|
|
|
= render "discussions/jump_to_next", discussion: discussion
|
2017-03-30 22:34:14 -04:00
|
|
|
- else
|
2019-06-06 11:51:04 -04:00
|
|
|
.discussion-with-resolve-btn
|
|
|
|
= link_to_reply_discussion(discussion)
|
2017-05-26 15:01:42 -04:00
|
|
|
- elsif !current_user
|
|
|
|
.disabled-comment.text-center
|
|
|
|
Please
|
|
|
|
= link_to "register", new_session_path(:user, redirect_to_referer: 'yes')
|
|
|
|
or
|
|
|
|
= link_to "sign in", new_session_path(:user, redirect_to_referer: 'yes')
|
|
|
|
to reply
|