fix forum replies number
This commit is contained in:
parent
103fb63d39
commit
6dc007c564
|
@ -20,10 +20,9 @@ case class Topic(
|
||||||
closed: Boolean,
|
closed: Boolean,
|
||||||
hidden: Boolean) {
|
hidden: Boolean) {
|
||||||
|
|
||||||
def nbReplies = nbPosts - 1
|
|
||||||
|
|
||||||
def updatedAt(troll: Boolean): DateTime = troll.fold(updatedAtTroll, updatedAt)
|
def updatedAt(troll: Boolean): DateTime = troll.fold(updatedAtTroll, updatedAt)
|
||||||
def nbPosts(troll: Boolean): Int = troll.fold(nbPostsTroll, nbPosts)
|
def nbPosts(troll: Boolean): Int = troll.fold(nbPostsTroll, nbPosts)
|
||||||
|
def nbReplies(troll: Boolean): Int = nbPosts(troll) - 1
|
||||||
def lastPostId(troll: Boolean): String = troll.fold(lastPostIdTroll, lastPostId)
|
def lastPostId(troll: Boolean): String = troll.fold(lastPostIdTroll, lastPostId)
|
||||||
|
|
||||||
def open = !closed
|
def open = !closed
|
||||||
|
|
|
@ -23,6 +23,7 @@ case class TopicView(
|
||||||
|
|
||||||
def updatedAt = topic updatedAt troll
|
def updatedAt = topic updatedAt troll
|
||||||
def nbPosts = topic nbPosts troll
|
def nbPosts = topic nbPosts troll
|
||||||
|
def nbReplies = topic nbReplies troll
|
||||||
def lastPostId = topic lastPostId troll
|
def lastPostId = topic lastPostId troll
|
||||||
|
|
||||||
def id = topic.id
|
def id = topic.id
|
||||||
|
|
Loading…
Reference in a new issue