Skip to content
This repository was archived by the owner on Jun 9, 2022. It is now read-only.

Commit fdbf4d3

Browse files
authored
Merge pull request #46 from ftlabs/update/add_articles
[UPDATE] Add new articles
2 parents 40baa69 + a05efc3 commit fdbf4d3

File tree

7 files changed

+1330
-18
lines changed

7 files changed

+1330
-18
lines changed

index.js

+8-12
Original file line numberDiff line numberDiff line change
@@ -293,18 +293,14 @@ app.get('/content/:uuid', (req,res) => {
293293

294294
Tracking.splunk(`request=content uuid=${uuid}`);
295295

296-
switch(uuid) {
297-
case exampleUUIDs[1]:
298-
data.partial2 = true;
299-
break;
300-
301-
case exampleUUIDs[2]:
302-
data.partial3 = true;
303-
break;
304-
305-
case exampleUUIDs[0]:
306-
default:
307-
data.partial1 = true;
296+
const contentID = exampleUUIDs.findIndex(item => {
297+
return item === uuid;
298+
});
299+
300+
if(contentID === -1) {
301+
data.partial1 = true;
302+
} else {
303+
data[`partial${contentID + 1}`] = true;
308304
}
309305

310306
res.render('content', data);

public/css/translation-component.css

+21
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,27 @@
153153
flex-direction: column;
154154
}
155155

156+
.topper--split-text-center .topper__headline--large {
157+
display: block;
158+
}
159+
160+
.topper--split-text-center .topper__headline--large .ftlabs-translation__cell:nth-child(odd) {
161+
border: none;
162+
width: 100%;
163+
display: block;
164+
padding: 0 0 20px 0;
165+
}
166+
167+
.topper--split-text-center .topper__headline--large .ftlabs-translation__cell:nth-child(even) {
168+
background-color: #F2DFCE;
169+
display: block;
170+
padding: 10px;
171+
}
172+
173+
.topper--split-text-center .topper__standfirst .ftlabs-translation__cell:nth-child(even) {
174+
padding-right: 20px;
175+
}
176+
156177
@media (max-width: 1219px) {
157178
.ftlabs-translation__share-bar-language {
158179
padding-left: 10px;

public/js/componentSecondIteration/main.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ function showTranslation(language) {
207207
}
208208

209209
fetch(
210-
`https://ftlabs-left.herokuapp.com/article/${articleId}/${languageCode.toLowerCase()}`,
210+
`${window.origin}/article/${articleId}/${languageCode.toLowerCase()}`,
211211
fetchOptions
212212
)
213213
.then(function(res) {
@@ -395,7 +395,7 @@ function logComponentInteractions(interaction, language = 'EN', error = null) {
395395
}
396396

397397
function getTranslationData(e) {
398-
fetch(`https://ftlabs-left.herokuapp.com/check/${articleId}/${pubDate}`)
398+
fetch(`${window.origin}/check/${articleId}/${pubDate}`)
399399
.then(function(res) { return res.json(); })
400400
.then(function(data) {
401401
if (data.displayWidget) {

views/content.hbs

+9-4
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,19 @@
2929

3030
<div class="n-layout__row n-layout__row--content">
3131
{{#if partial1}}
32-
{{> userTest/content1}}
32+
{{> userTest/content1}}
3333
{{else if partial2}}
34-
{{> userTest/content2}}
34+
{{> userTest/content2}}
3535
{{else if partial3}}
36-
{{> userTest/content3}}
36+
{{> userTest/content3}}
37+
{{else if partial4}}
38+
{{> userTest/content4}}
39+
{{else if partial5}}
40+
{{> userTest/content5}}
41+
{{else if partial6}}
42+
{{> userTest/content6}}
3743
{{/if}}
3844
</div>
39-
<div class="ftlabs-translation__translation-component"></div>
4045
{{> footer}}
4146
</div>
4247
<script src="https://cdn.polyfill.io/v2/polyfill.min.js"></script>

views/partials/userTest/content4.hbs

+437
Large diffs are not rendered by default.

views/partials/userTest/content5.hbs

+457
Large diffs are not rendered by default.

views/partials/userTest/content6.hbs

+396
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)