2017-08-24 23:54:02 +02:00
|
|
|
const html = require('choo/html');
|
|
|
|
const assets = require('../../common/assets');
|
|
|
|
const { bytes } = require('../utils');
|
|
|
|
|
2018-01-24 19:23:13 +01:00
|
|
|
module.exports = function(state, pageAction) {
|
2017-08-24 23:54:02 +02:00
|
|
|
const fileInfo = state.fileInfo;
|
2017-08-31 18:43:36 +02:00
|
|
|
const size = fileInfo.size
|
|
|
|
? state.translate('downloadFileSize', { size: bytes(fileInfo.size) })
|
|
|
|
: '';
|
2018-01-24 19:23:13 +01:00
|
|
|
|
2017-08-31 18:43:36 +02:00
|
|
|
const title = fileInfo.name
|
|
|
|
? state.translate('downloadFileName', { filename: fileInfo.name })
|
|
|
|
: state.translate('downloadFileTitle');
|
2017-08-24 23:54:02 +02:00
|
|
|
const div = html`
|
|
|
|
<div id="page-one">
|
|
|
|
<div id="download">
|
|
|
|
<div id="download-page-one">
|
|
|
|
<div class="title">
|
|
|
|
<span id="dl-file"
|
2017-08-31 18:43:36 +02:00
|
|
|
data-nonce="${fileInfo.nonce}"
|
2018-01-24 19:23:13 +01:00
|
|
|
data-requires-password="${fileInfo.requiresPassword}"
|
|
|
|
>${title}</span>
|
2017-08-31 18:43:36 +02:00
|
|
|
<span id="dl-filesize">${' ' + size}</span>
|
2017-08-24 23:54:02 +02:00
|
|
|
</div>
|
|
|
|
<div class="description">${state.translate('downloadMessage')}</div>
|
2018-01-24 19:23:13 +01:00
|
|
|
<img
|
|
|
|
src="${assets.get('illustration_download.svg')}"
|
|
|
|
id="download-img"
|
|
|
|
alt="${state.translate('downloadAltText')}"/>
|
|
|
|
${pageAction}
|
2017-08-24 23:54:02 +02:00
|
|
|
</div>
|
|
|
|
<a class="send-new" href="/">${state.translate('sendYourFilesLink')}</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
`;
|
|
|
|
return div;
|
|
|
|
};
|