2017-08-24 23:54:02 +02:00
|
|
|
const html = require('choo/html');
|
2018-02-11 23:02:40 +01:00
|
|
|
const raw = require('choo/html/raw');
|
2017-08-24 23:54:02 +02:00
|
|
|
|
|
|
|
function replaceLinks(str, urls) {
|
|
|
|
let i = -1;
|
|
|
|
const s = str.replace(/<a>([^<]+)<\/a>/g, (m, v) => {
|
|
|
|
i++;
|
|
|
|
return `<a href="${urls[i]}">${v}</a>`;
|
|
|
|
});
|
2018-02-11 23:02:40 +01:00
|
|
|
return `<div class="description">${s}</div>`;
|
2017-08-24 23:54:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = function(state) {
|
|
|
|
const div = html`
|
|
|
|
<div id="page-one">
|
|
|
|
<div id="legal">
|
|
|
|
<div class="title">${state.translate('legalHeader')}</div>
|
2018-02-11 23:02:40 +01:00
|
|
|
${raw(
|
2017-08-24 23:54:02 +02:00
|
|
|
replaceLinks(state.translate('legalNoticeTestPilot'), [
|
|
|
|
'https://testpilot.firefox.com/terms',
|
|
|
|
'https://testpilot.firefox.com/privacy',
|
|
|
|
'https://testpilot.firefox.com/experiments/send'
|
|
|
|
])
|
|
|
|
)}
|
2018-02-11 23:02:40 +01:00
|
|
|
${raw(
|
2017-08-24 23:54:02 +02:00
|
|
|
replaceLinks(state.translate('legalNoticeMozilla'), [
|
|
|
|
'https://www.mozilla.org/privacy/websites/',
|
|
|
|
'https://www.mozilla.org/about/legal/terms/mozilla/'
|
|
|
|
])
|
|
|
|
)}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
`;
|
|
|
|
return div;
|
|
|
|
};
|