Skip to content

Commit

Permalink
adds option for changing the grid colspan for the article (#253)
Browse files Browse the repository at this point in the history
Co-authored-by: Tobias <[email protected]>
  • Loading branch information
Ændrew Rininsland and Sqyphen authored May 21, 2020
1 parent 151ce33 commit 1f17ae7
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
5 changes: 5 additions & 0 deletions config/article.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ export default (environment = 'development') => ({ // eslint-disable-line
// meta data
description: '',

oGridColspan: {
header: '12 S11 Scenter M9 L8 XL7',
body: '12 S11 Scenter M9 L8 XL7'
},

/*
TODO: Select Twitter card type -
"summary" or "summary_large_image"
Expand Down
14 changes: 14 additions & 0 deletions test/qa/qa.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,20 @@ describe('QA tests', () => {
dataContentId.should.not.equal('');
});

if('has a grid set for article header', () => {
const articleHeaderContainer = document.querySelector('.article-head.o-grid-container .o-grid-row div').getAttribute('data-o-grid-colspan');

should.exist(articleHeaderContainer);
articleHeaderContainer.should.not.equal('');
});

if('has a grid set for article body', () => {
const articleBodyContainer = document.querySelector('.article-body .o-grid-container .o-grid-row div').getAttribute('data-o-grid-colspan');

should.exist(articleBodyContainer);
articleBodyContainer.should.not.equal('');
});

// @TODO Add Onward Journey test
// @TODO Find way of testing that tracking code is installed
});
Expand Down
4 changes: 2 additions & 2 deletions views/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<article class="article" itemscope itemtype="http://schema.org/Article">
<div class="article-head o-grid-container">
<div class="o-grid-row">
<header data-o-grid-colspan="12 S11 Scenter M9 L8 XL7">
<header data-o-grid-colspan="{{ oGridColspan.header }}">
{% block article_head %}
{% include "includes/article-head.html" %}
{% endblock %}
Expand All @@ -36,7 +36,7 @@

<div class="o-grid-container">
<div class="o-grid-row">
<div data-o-grid-colspan="12 S11 Scenter M9 L8 XL7">
<div data-o-grid-colspan="{{ oGridColspan.body }}">
<div>
{% block article_body %}{% endblock %}
</div>
Expand Down

0 comments on commit 1f17ae7

Please sign in to comment.