2017-08-24 21:54:02 +00:00
|
|
|
const html = require('choo/html');
|
2018-02-11 22:02:40 +00:00
|
|
|
const raw = require('choo/html/raw');
|
2018-08-03 19:24:41 +00:00
|
|
|
const assets = require('../../common/assets');
|
|
|
|
const title = require('../templates/title');
|
2017-08-24 21:54:02 +00:00
|
|
|
|
|
|
|
module.exports = function(state) {
|
2018-02-16 20:56:53 +00:00
|
|
|
return html`
|
2018-02-22 00:40:52 +00:00
|
|
|
<div>
|
2018-08-03 19:24:41 +00:00
|
|
|
<a href="/" class="goBackButton">
|
|
|
|
<img src="${assets.get('back-arrow.svg')}"/>
|
|
|
|
</a>
|
|
|
|
${title(state)}
|
2018-02-13 19:32:59 +00:00
|
|
|
<div class="title">${state.translate('legalHeader')}</div>
|
|
|
|
${raw(
|
|
|
|
replaceLinks(state.translate('legalNoticeTestPilot'), [
|
|
|
|
'https://testpilot.firefox.com/terms',
|
|
|
|
'https://testpilot.firefox.com/privacy',
|
|
|
|
'https://testpilot.firefox.com/experiments/send'
|
|
|
|
])
|
|
|
|
)}
|
|
|
|
${raw(
|
|
|
|
replaceLinks(state.translate('legalNoticeMozilla'), [
|
|
|
|
'https://www.mozilla.org/privacy/websites/',
|
|
|
|
'https://www.mozilla.org/about/legal/terms/mozilla/'
|
|
|
|
])
|
|
|
|
)}
|
2017-08-24 21:54:02 +00:00
|
|
|
</div>
|
|
|
|
`;
|
|
|
|
};
|
2018-02-16 20:56:53 +00:00
|
|
|
|
|
|
|
function replaceLinks(str, urls) {
|
|
|
|
let i = 0;
|
|
|
|
const s = str.replace(
|
|
|
|
/<a>([^<]+)<\/a>/g,
|
|
|
|
(m, v) => `<a href="${urls[i++]}">${v}</a>`
|
|
|
|
);
|
|
|
|
return `<div class="description">${s}</div>`;
|
|
|
|
}
|