1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
import {getTotalDuration} from '#wiki-data';
export default {
extraDependencies: ['html', 'language'],
data(album) {
return {
name: album.name,
date: album.date,
duration: getTotalDuration(album.tracks),
numTracks: album.tracks.length,
};
},
generate(data, {html, language}) {
const parts = ['albumGalleryPage.statsLine'];
const options = {};
options.tracks =
html.tag('b',
language.countTracks(data.numTracks, {unit: true}));
options.duration =
html.tag('b',
language.formatDuration(data.duration, {unit: true}));
if (data.date) {
parts.push('withDate');
options.date =
html.tag('b',
language.formatDate(data.date));
}
return (
html.tag('p', {class: 'quick-info'},
language.formatString(...parts, options)));
},
};
|