Skip to content

Commit

Permalink
Revert "Lift affiliate links disclaimer out of page elements"
Browse files Browse the repository at this point in the history
  • Loading branch information
SiAdcock authored Dec 8, 2023
1 parent cf3caa9 commit ee53506
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 32 deletions.
11 changes: 0 additions & 11 deletions common/app/model/dotcomrendering/DotcomRenderingDataModel.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import play.api.libs.json._
import play.api.mvc.RequestHeader
import services.NewsletterData
import views.support.{CamelCase, ContentLayout, JavaScriptPage}
import views.html.fragments.affiliateLinksDisclaimer
// -----------------------------------------------------------------
// DCR DataModel
// -----------------------------------------------------------------
Expand All @@ -41,7 +40,6 @@ case class DotcomRenderingDataModel(
version: Int,
headline: String,
standfirst: String,
affiliateLinksDisclaimer: Option[String],
webTitle: String,
mainMediaElements: List[PageElement],
main: String,
Expand Down Expand Up @@ -123,7 +121,6 @@ object DotcomRenderingDataModel {
"version" -> model.version,
"headline" -> model.headline,
"standfirst" -> model.standfirst,
"affiliateLinksDisclaimer" -> model.affiliateLinksDisclaimer,
"webTitle" -> model.webTitle,
"mainMediaElements" -> model.mainMediaElements,
"main" -> model.main,
Expand Down Expand Up @@ -548,13 +545,6 @@ object DotcomRenderingDataModel {

val selectedTopics = topicResult.map(topic => Seq(Topic(topic.`type`, topic.name)))

def getAffiliateLinksDisclaimer(shouldAddAffiliateLinks: Boolean) = {
if (shouldAddAffiliateLinks) {
Some(affiliateLinksDisclaimer("article").body)
} else {
None
}
}
DotcomRenderingDataModel(
author = author,
badge = Badges.badgeFor(content).map(badge => DCRBadge(badge.seriesTag, badge.imageUrl)),
Expand Down Expand Up @@ -608,7 +598,6 @@ object DotcomRenderingDataModel {
showBottomSocialButtons = ContentLayout.showBottomSocialButtons(content),
slotMachineFlags = request.slotMachineFlags,
standfirst = TextCleaner.sanitiseLinks(edition)(content.fields.standfirst.getOrElse("")),
affiliateLinksDisclaimer = getAffiliateLinksDisclaimer(shouldAddAffiliateLinks),
starRating = content.content.starRating,
subMetaKeywordLinks = content.content.submetaLinks.keywords.map(SubMetaLink.apply),
subMetaSectionLinks =
Expand Down
39 changes: 18 additions & 21 deletions common/app/views/fragments/affiliateLinksDisclaimer.scala.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,24 @@
@(contentType: String) @articleDisclaimer() = {
@(contentType: String)


@articleDisclaimer() = {
<p><em><sup>
The Guardian’s product and service reviews are independent and are
in no way influenced by any advertiser or commercial initiative. We
will earn a commission from the retailer if you buy something
through an affiliate link.
<a
href="https://www.theguardian.com/info/2017/nov/01/reader-information-on-affiliate-links"
data-link-name="in body link"
class="u-underline"
>Learn more</a
>.
This article contains affiliate links, which means we may earn a small commission if a reader clicks through and
makes a purchase. All our journalism is independent and is in no way influenced by any advertiser or commercial initiative.
By clicking on an affiliate link, you accept that third-party cookies will be set.
<a href="https://www.theguardian.com/info/2017/nov/01/reader-information-on-affiliate-links" data-link-name="in body link" class="u-underline">More information</a>.
</sup></em></p>
} @galleryDisclaimer() = {
<br><em>
The Guardian’s product and service reviews are independent and are in no
way influenced by any advertiser or commercial initiative. We will earn a
commission from the retailer if you buy something through an affiliate link.
<a
href="https://www.theguardian.com/info/2017/nov/01/reader-information-on-affiliate-links"
>Learn more</a
>.
}

@galleryDisclaimer() = {
<br><em>This article contains affiliate links, which means we may earn a small commission if a reader clicks through and
makes a purchase. All our journalism is independent and is in no way influenced by any advertiser or commercial initiative.
By clicking on an affiliate link, you accept that third-party cookies will be set.
<a href="https://www.theguardian.com/info/2017/nov/01/reader-information-on-affiliate-links">More information</a>.
</em>
} @{contentType match {
}

@{contentType match {
case "gallery" => galleryDisclaimer()
case "article" => articleDisclaimer()
case _ => Html("")
Expand Down

0 comments on commit ee53506

Please sign in to comment.