Skip to content
Snippets Groups Projects
Commit b3180d34 authored by Douwe Maan's avatar Douwe Maan
Browse files

Add resolved and last updated status to collapsed discussions

parent 3b06987c
No related branches found
No related tags found
No related merge requests found
Loading
@@ -39,6 +39,14 @@ class Discussion
Loading
@@ -39,6 +39,14 @@ class Discussion
@notes = notes @notes = notes
end end
   
def last_updated_at
last_note.created_at
end
def last_updated_by
last_note.author
end
def id def id
first_note.discussion_id first_note.discussion_id
end end
Loading
Loading
Loading
@@ -7,6 +7,15 @@
Loading
@@ -7,6 +7,15 @@
.timeline-content .timeline-content
.discussion.js-toggle-container{ class: discussion.id } .discussion.js-toggle-container{ class: discussion.id }
.discussion-header .discussion-header
.discussion-actions
= link_to "#", class: "note-action-button discussion-toggle-button js-toggle-button" do
- if expanded
= icon("chevron-up")
- else
= icon("chevron-down")
Toggle discussion
= link_to_member(@project, discussion.author, avatar: false) = link_to_member(@project, discussion.author, avatar: false)
   
.inline.discussion-headline-light .inline.discussion-headline-light
Loading
@@ -29,14 +38,21 @@
Loading
@@ -29,14 +38,21 @@
   
= time_ago_with_tooltip(discussion.created_at, placement: "bottom", html_class: "note-created-ago") = time_ago_with_tooltip(discussion.created_at, placement: "bottom", html_class: "note-created-ago")
   
.discussion-actions -# TODO: Live update!
= link_to "#", class: "note-action-button discussion-toggle-button js-toggle-button" do - if discussion.resolved?
- if expanded .discussion-headline-light
= icon("chevron-up") Resolved
- else - if discussion.resolved_by
= icon("chevron-down") by
= link_to_member(@project, discussion.resolved_by, avatar: false)
Toggle discussion = time_ago_with_tooltip(discussion.resolved_at, placement: "bottom")
- elsif discussion.last_updated_at != discussion.created_at
.discussion-headline-light
Last updated
- if discussion.last_updated_by
by
= link_to_member(@project, discussion.last_updated_by, avatar: false)
= time_ago_with_tooltip(discussion.last_updated_at, placement: "bottom")
   
.discussion-body.js-toggle-content{ class: ("hide" unless expanded) } .discussion-body.js-toggle-content{ class: ("hide" unless expanded) }
- if discussion.diff_discussion? && discussion.diff_file - if discussion.diff_discussion? && discussion.diff_file
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment