Back to Frontend

Comment.Scala

discussion/app/views/fragments/comment.scala.html

latest2.6 KB
Original Source

@import common.Edition @import conf.Configuration @import discussion.model.Comment @import views.support.{GuDateFormatLegacy, RenderClasses} @import views.support.package.withJsoup @import views.support.{BulletCleaner, InBodyLinkCleaner} @import navigation.AuthenticationComponentEvent._ @(comment: Comment, isClosedForRecommendation: Boolean = true, isResponse: Boolean = false)(implicit request: RequestHeader) @* Please don't use the isTopComment switch - we've kept it pretty clean without it, but just need a solution for IDs *@

  • isResponse, "d-comment--top-level" -> !isResponse, "d-comment--blocked" -> comment.isBlocked, "d-comment--has-replies" -> comment.responses.nonEmpty, "d-comment-staff" -> comment.profile.isStaff ))" id="[email protected]" data-comment-id="@comment.id" data-comment-author="@comment.profile.displayName" data-comment-replies="@comment.responseCount" data-comment-timestamp="@comment.date" data-comment-author-id="@comment.profile.userId" data-comment-highlighted="@comment.isHighlighted" itemscope itemtype="http://schema.org/Comment"\>

@comment.profile.displayName @comment.responseTo.map{ r => @fragments.inlineSvg("reply", "icon", List("grey")) @r.displayName } @GuDateFormatLegacy(comment.date, "d MMM y HH:mm") @fragments.inlineSvg("comment-anchor", "icon") @fragments.commentBadges(comment) @if(comment.isHighlighted && !comment.isBlocked) { @fragments.inlineSvg("marque-36", "icon", Seq("d-comment__gu-icon")) Guardian Pick }

@if(!comment.isBlocked){ @* Change here should be double check for functionality relating to whether recs should show when recs are closed *@ @fragments.inlineSvg("arrow-up-white", "icon") @comment.numRecommends @(comment.numRecommends+1) }

@if(comment.isBlocked){ This comment was removed by a moderator because it didn't abide by our community standards. Replies may also be deleted. For more detail see our FAQs. }else{ @defining(Edition(request)) { edition => @withJsoup(BulletCleaner(comment.body))( InBodyLinkCleaner("in body link") ) } } @if(!comment.isBlocked){ @fragments.inlineSvg("reply", "icon", List("blue")) Reply|@if(comment.isHighlighted){Unpick}else{Pick}

Report }

@if(comment.responses.nonEmpty){ @comment.responses.map{ response => @fragments.comment(response, isClosedForRecommendation, true) } }