« get me outta code hell

generateCoverArtworkArtistDetails.js « dependencies « content « src - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateCoverArtworkArtistDetails.js
blob: 3ead80ab51d87967bb07c85a65f5e764bd469504 (plain)
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
export default {
  contentDependencies: ['linkArtistGallery'],
  extraDependencies: ['html', 'language'],

  relations: (relation, artwork) => ({
    artistLinks:
      artwork.artistContribs
        .map(contrib => contrib.artist)
        .map(artist =>
          relation('linkArtistGallery', artist)),
  }),

  generate: (relations, {html, language}) =>
    html.tag('p', {class: 'image-details'},
      {[html.onlyIfContent]: true},

      {class: 'illustrator-details'},

      language.$('misc.coverGrid.details.coverArtists', {
        [language.onlyIfOptions]: ['artists'],

        artists:
          language.formatConjunctionList(relations.artistLinks),
      })),
};