refactored dl-file html

This commit is contained in:
Danny Coates 2018-01-31 16:26:59 -08:00
parent 232911f725
commit 11cbb4df23
No known key found for this signature in database
GPG Key ID: 4C442633C62E00CB

View File

@ -9,23 +9,23 @@ module.exports = function(state, pageAction) {
? state.translate('downloadFileSize', { size: bytes(fileInfo.size) })
: '';
const name = fileInfo.name
const title = fileInfo.name
? state.translate('downloadFileName', { filename: fileInfo.name })
: '';
const title = html`
<span id="dl-file"
data-nonce="${fileInfo.nonce}"
data-requires-password="${fileInfo.requiresPassword}">${name}</span>`;
: state.translate('downloadFileTitle');
const info = html`
<div id="dl-file"
data-nonce="${fileInfo.nonce}"
data-requires-password="${fileInfo.requiresPassword}"></div>`;
if (!pageAction) {
return title;
return info;
}
const div = html`
<div id="page-one">
<div id="download">
<div id="download-page-one">
<div class="title">
${title}
<span>${title}</span>
<span id="dl-filesize">${' ' + size}</span>
</div>
<div class="description">${state.translate('downloadMessage')}</div>
@ -37,6 +37,7 @@ module.exports = function(state, pageAction) {
</div>
<a class="send-new" href="/">${state.translate('sendYourFilesLink')}</a>
</div>
${info}
</div>
`;
return div;