diff --git a/app/ui/archiveTile.js b/app/ui/archiveTile.js index fd9df365..eb0dd679 100644 --- a/app/ui/archiveTile.js +++ b/app/ui/archiveTile.js @@ -112,12 +112,25 @@ function fileInfo(file, action) {
${bytes( file.size )}
-

${action} `; } +function archiveInfo(archive, action) { + return html` +

+ +

+

${archive.name}

+
${bytes( + archive.size + )}
+

+ ${action} +

`; +} + function archiveDetails(translate, archive) { if (archive.manifest.files.length > 1) { return html` @@ -191,33 +204,33 @@ module.exports = function(state, emit, archive) {
`; return html` - -

- - -

${archive.name}

-
${bytes( - archive.size - )}
-

-
- ${expiryInfo(state.translate, archive)} -
- ${archiveDetails(state.translate, archive)} -
-
- ${dl} - ${copyOrShare} -
-
`; + + ${archiveInfo( + archive, + html` + + ` + )} +
+ ${expiryInfo(state.translate, archive)} +
+ ${archiveDetails(state.translate, archive)} +
+
+ ${dl} ${copyOrShare} +
+
+ `; function copy(event) { event.stopPropagation(); @@ -258,7 +271,7 @@ module.exports.wip = function(state, emit) { > -

- -

${archive.name}

-
${bytes( - archive.size - )}
-

-
- ${expiryInfo(state.translate, { - dlimit: state.archive.dlimit, - dtotal: 0, - expiresAt: Date.now() + 500 + state.archive.timeLimit * 1000 - })} -
-
${progressPercent}
- ${progressPercent} - - `; + + ${archiveInfo(archive)} +
+ ${expiryInfo(state.translate, { + dlimit: state.archive.dlimit, + dtotal: 0, + expiresAt: Date.now() + 500 + state.archive.timeLimit * 1000 + })} +
+
+ ${progressPercent} +
+ ${progressPercent} + +
+ `; function cancel(event) { event.stopPropagation(); @@ -420,7 +432,7 @@ module.exports.empty = function(state, emit) { `; return html` - -
-

- -

${archive.name}

-
${bytes( - archive.size - )}
-

- ${details} -
- -
`; + +
+ ${archiveInfo(archive)} ${details} +
+ +
+ `; function download(event) { event.preventDefault(); @@ -509,15 +516,14 @@ module.exports.downloading = function(state) { const progress = state.transfer.progressRatio; const progressPercent = percent(progress); return html` - -

- -

${archive.name}

-
${bytes( - archive.size - )}
-

-
${progressPercent}
- ${progressPercent} -
`; + + ${archiveInfo(archive)} +
+ ${progressPercent} +
+ ${progressPercent} +
+ `; };