Skip to content

Commit

Permalink
🐛 Fixed missing accent color for default content cta (#15611)
Browse files Browse the repository at this point in the history
refs TryGhost/Casper#901

- the site accent color property on default cta for upgrade link had a typo and was using wrong property
  • Loading branch information
rishabhgrg authored Oct 13, 2022
1 parent 2c7ade7 commit e05889c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ghost/core/core/frontend/helpers/tpl/content-cta.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<h2>This {{#is "page"}}page{{else}}post{{/is}} is for subscribers on the {{tiers}} only </h2>
{{/has}}
{{#if @member}}
<a class="gh-btn" data-portal="account/plans" style="color:{{@site.accentColor}}">Upgrade your account</a>
<a class="gh-btn" data-portal="account/plans" style="color:{{@site.accent_color}}">Upgrade your account</a>
{{else}}
<a class="gh-btn" data-portal="signup" style="color:{{@site.accent_color}}">Subscribe now</a>
<p><small>Already have an account? <a data-portal="signin">Sign in</a></small></p>
Expand Down
12 changes: 12 additions & 0 deletions ghost/core/test/unit/frontend/helpers/content.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,18 @@ describe('{{content}} helper with no access', function () {
rendered.string.should.containEql('"background-color: #abcdef"');
rendered.string.should.containEql('This page is for');
});

it('can render default template for upgrade case', function () {
// html will be included when there is free content available
const html = 'Free content';
optionsData.data.member = {
id: '123'
};
const rendered = content.call({html: html, access: false, visibility: 'members'}, optionsData);
rendered.string.should.containEql('Free content');
rendered.string.should.containEql('Upgrade your account');
rendered.string.should.containEql('color:#abcdef');
});
});

describe('{{content}} helper with custom template', function () {
Expand Down

0 comments on commit e05889c

Please sign in to comment.