@import common.Edition
@import common.LinkTo
@import model.ContentType
@import com.gu.contentapi.client.model.v1.TagType
@import views.support.{BulletCleaner, ContributorLinks, InBodyLinkCleaner, RenderClasses, withJsoup}
@(item: ContentType)(implicit request: RequestHeader)
item.content.isGallery,
"content__standfirst--immersive-article" -> (item.content.isImmersive && item.tags.isArticle),
"content__standfirst--advertisement" -> (item.content.isImmersive && item.tags.isPaidContent),
"content__standfirst--immersive-minute-article" -> item.tags.isTheMinuteArticle),
"content__standfirst")" data-link-name="standfirst" data-component="standfirst" @langAttributes(item.content)>
@item.fields.trailText.map{ t =>
@defining({
val trailText = views.support.StripHtmlTags(t)
// description has to end in a full stop in the metadata to match google linked data standards, but
// editorial style doesn't allow it in trail text.
s"$trailText${if (item.tags.isReview) "." else ""}"
}){ trailText =>
}
}
@item.fields.standfirst.map { standfirst =>
@defining(Edition(request)) { edition =>
@withJsoup(BulletCleaner(
if(item.content.isImmersive && item.tags.isArticle && item.trail.byline) {
if (standfirst.contains(item.trail.byline.get)) {
ContributorLinks(standfirst, item.tags.contributors).toString()
} else {
standfirst + "
by " + ContributorLinks(item.trail.byline.get, item.tags.contributors) + "
"
}
} else {
standfirst
}
))(
InBodyLinkCleaner("in standfirst link")
)
}
}
@if(item.tags.isAudio) {
How to listen to podcasts: everything you need to know
}