diff options
author | (quasar) nebula <towerofnix@gmail.com> | 2021-04-10 22:28:17 -0300 |
---|---|---|
committer | (quasar) nebula <towerofnix@gmail.com> | 2021-04-10 22:28:17 -0300 |
commit | 0d0d38ce51ca02b7c3bd91317b5fa0bbff1f06de (patch) | |
tree | d78594d4b44bb806eccf7f2a3c4f8ec9707622d5 /upd8.js | |
parent | e99c48d128744a77c672cdf8f19dcf3cdc395b9b (diff) |
new Albums - by Date Added to Wiki listing
Diffstat (limited to 'upd8.js')
-rwxr-xr-x | upd8.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/upd8.js b/upd8.js index 732c35a1..66582f17 100755 --- a/upd8.js +++ b/upd8.js @@ -4136,6 +4136,38 @@ const listingSpec = [ }, { + directory: 'albusm/by-date-added', + title: ({strings}) => strings('listingPage.listAlbums.byDateAdded.title'), + + data() { + return chunkByProperties(albumData.slice().sort((a, b) => { + if (a.dateAdded < b.dateAdded) return -1; + if (a.dateAdded > b.dateAdded) return 1; + }), ['dateAdded']); + }, + + html(chunks, {strings, to}) { + return fixWS` + <dl> + ${chunks.map(({dateAdded, chunk: albums}) => fixWS` + <dt>${strings('listingPage.listAlbums.byDateAdded.date', { + date: strings.count.date(dateAdded) + })}</dt> + <dd><ul> + ${(albums + .map(album => strings('listingPage.listAlbums.byDateAdded.album', { + album: strings.link.album(album, {to}) + })) + .map(row => `<li>${row}</li>`) + .join('\n'))} + </ul></dd> + `).join('\n')} + </dl> + `; + } + }, + + { directory: 'artists/by-name', title: ({strings}) => strings('listingPage.listArtists.byName.title'), |