sort Q&A comments - closes #3571
parent
c802556c39
commit
6cee95c359
|
@ -66,7 +66,7 @@
|
|||
</form>
|
||||
}
|
||||
<div class="comments" id="answer-@a.id-comments">
|
||||
@views.html.qa.commentList(q, a.comments, routes.QaComment.answer(q.id, a.id).url)
|
||||
@views.html.qa.commentList(q, a.comments.sorted, routes.QaComment.answer(q.id, a.id).url)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -55,7 +55,7 @@ description = shorten(q.body.replace("\n", ""), 152).body).some) {
|
|||
@autoLink(q.body)
|
||||
</div>
|
||||
<div class="comments" id="question-@q.id-comments">
|
||||
@views.html.qa.commentList(q, q.comments, routes.QaComment.question(q.id).url)
|
||||
@views.html.qa.commentList(q, q.comments.sorted, routes.QaComment.question(q.id).url)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -86,7 +86,10 @@ case class Comment(
|
|||
userId: String,
|
||||
body: String,
|
||||
createdAt: DateTime
|
||||
)
|
||||
) extends Ordered[Comment] {
|
||||
|
||||
def compare(other: Comment) = createdAt.getSeconds compare other.createdAt.getSeconds
|
||||
}
|
||||
|
||||
object Comment {
|
||||
|
||||
|
|
Loading…
Reference in New Issue