Add resolved and last updated status to collapsed discussions
This commit is contained in:
parent
3b06987c34
commit
b3180d3486
2 changed files with 32 additions and 8 deletions
|
@ -39,6 +39,14 @@ class Discussion
|
|||
@notes = notes
|
||||
end
|
||||
|
||||
def last_updated_at
|
||||
last_note.created_at
|
||||
end
|
||||
|
||||
def last_updated_by
|
||||
last_note.author
|
||||
end
|
||||
|
||||
def id
|
||||
first_note.discussion_id
|
||||
end
|
||||
|
|
|
@ -7,6 +7,15 @@
|
|||
.timeline-content
|
||||
.discussion.js-toggle-container{ class: discussion.id }
|
||||
.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)
|
||||
|
||||
.inline.discussion-headline-light
|
||||
|
@ -29,14 +38,21 @@
|
|||
|
||||
= time_ago_with_tooltip(discussion.created_at, placement: "bottom", html_class: "note-created-ago")
|
||||
|
||||
.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
|
||||
-# TODO: Live update!
|
||||
- if discussion.resolved?
|
||||
.discussion-headline-light
|
||||
Resolved
|
||||
- if discussion.resolved_by
|
||||
by
|
||||
= link_to_member(@project, discussion.resolved_by, avatar: false)
|
||||
= 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) }
|
||||
- if discussion.diff_discussion? && discussion.diff_file
|
||||
|
|
Loading…
Reference in a new issue