lila/app/views/timeline/entry.scala.html

37 lines
1.6 KiB
HTML

@(e: lila.timeline.Entry)(implicit ctx: Context)
@import lila.hub.actorApi.timeline._
@e.decode.map { decoded =>
@decoded match {
case Follow(u1, u2) => {
@trans.xStartedFollowingY(userIdLink(u1.some, withOnline = false), userIdLink(u2.some, withOnline = false))
}
case TeamJoin(userId, teamId) => {
@trans.xJoinedTeamY(userIdLink(userId.some, withOnline = false), teamLink(teamId, withIcon = false))
}
case TeamCreate(userId, teamId) => {
@trans.xCreatedTeamY(userIdLink(userId.some, withOnline = false), teamLink(teamId, withIcon = false))
}
case ForumPost(userId, topicName, postId) => {
@trans.xPostedInForumY(userIdLink(userId.some, withOnline = false), """<a href="%s">&nbsp;%s</a>""".format(routes.ForumPost.redirect(postId), shorten(topicName, 30)))
}
case NoteCreate(fromId, toId) => {
@userIdLink(fromId.some, withOnline = false) left a note on @userIdLink(toId.some, withOnline = false, params = "?note")
}
case TourJoin(userId, tourId, tourName) => {
@userIdLink(userId.some, withOnline = false) competes in <a href="@routes.Tournament.show(tourId)">@trans.xTournament(tourName)</a>
}
case QaQuestion(userId, id, title) => {
@userIdLink(userId.some, withOnline = false) asked <a href="@routes.QaQuestion.show(id, "redirect")">@title</a>
}
case QaAnswer(userId, id, title, answerId) => {
@userIdLink(userId.some, withOnline = false) answered <a href="@routes.QaQuestion.show(id, "redirect")#answer-@answerId">@title</a>
}
case QaComment(userId, id, title, commentId) => {
@userIdLink(userId.some, withOnline = false) commented <a href="@routes.QaQuestion.show(id, "redirect")#comment-@commentId">@title</a>
}
}
@momentFromNow(e.date)
}