Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

Commit

Permalink
Merge pull request #429 from Financial-Times/feat/ready-to-pay
Browse files Browse the repository at this point in the history
Add logic to only show the SWG button on `isReadyToPay` 🐿 v2.12.5
  • Loading branch information
thegreatercurve authored Feb 6, 2020
2 parents 8ab2cc0 + 062f90c commit 661a28b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
1 change: 1 addition & 0 deletions server/lib/article/article-flags.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,5 @@ module.exports = (article, options) => Object.assign(article, {
visibilityOptIn: segmentArticle(article),

showSwGButton: process.env.SHOW_SWG_BUTTON === 'true',
enableSwGReadyToPay: process.env.ENABLE_SWG_READY_TO_PAY === 'true',
});
27 changes: 19 additions & 8 deletions views/partials/barrier.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,27 @@ <h3 class="amp-access-barrier__offer-description-title">\{{description.title}}</
</amp-list>

{{#if showSwGButton}}
<div class="amp-access-barrier__offer">
<h2 class="amp-access-barrier__offer-title">
Digital or Premium Digital
</h2>
<div
class="amp-access-barrier__offer"
subscriptions-actions
subscriptions-display="{{#if enableSwGReadyToPay}}factors['subscribe.google.com'].isReadyToPay AND {{/if}}NOT granted"
>
<h2 class="amp-access-barrier__offer-title">
Digital or Premium Digital
</h2>

<div class="amp-access-barrier__offer-description">
You can also subscribe to the FT Digital or Premium Digital with Google
<div class="amp-access-barrier__offer-description">
You can also subscribe to the FT Digital or Premium Digital with Google
</div>
<button
class="amp-access-barrier__swg-button"
subscriptions-action="subscribe"
subscriptions-service="subscribe.google.com"
subscriptions-display="true"
>
Subscribe with Google
</button>
</div>
<button class="amp-access-barrier__swg-button" subscriptions-action="subscribe" subscriptions-service="subscribe.google.com" subscriptions-display="NOT granted">Subscribe with Google</button>
</div>
{{/if}}

<div class="amp-access-barrier__footer">
Expand Down

0 comments on commit 661a28b

Please sign in to comment.