diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2025-06-04 20:45:36 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2025-06-04 20:45:36 -0300 |
commit | d7b5dc6296757de10dab64021e4663879177f316 (patch) | |
tree | 52deff4e9837aaeb82fb63333b5bba9834eb74e0 /src | |
parent | 19c146ee09c9cafac3dab3c0369f7335892077c8 (diff) |
content: gAIPArtworksChunkItem: sneak artwork labels in here
Diffstat (limited to 'src')
-rw-r--r-- | src/content/dependencies/generateArtistInfoPageArtworksChunkItem.js | 35 | ||||
-rw-r--r-- | src/strings-default.yaml | 10 |
2 files changed, 42 insertions, 3 deletions
diff --git a/src/content/dependencies/generateArtistInfoPageArtworksChunkItem.js b/src/content/dependencies/generateArtistInfoPageArtworksChunkItem.js index 4e55223c..cb436b0f 100644 --- a/src/content/dependencies/generateArtistInfoPageArtworksChunkItem.js +++ b/src/content/dependencies/generateArtistInfoPageArtworksChunkItem.js @@ -1,3 +1,5 @@ +import {empty} from '#sugar'; + export default { contentDependencies: [ 'generateArtistInfoPageChunkItem', @@ -41,6 +43,9 @@ export default { annotation: contrib.annotation, + + label: + contrib.thing.label, }), slots: { @@ -55,9 +60,33 @@ export default { otherArtistLinks: relations.otherArtistLinks, annotation: - (slots.filterEditsForWiki - ? data.annotation?.replace(/^edits for wiki(: )?/, '') - : data.annotation), + language.encapsulate('artistPage.creditList.entry.artwork.accent', workingCapsule => { + const workingOptions = {}; + + const artworkLabel = data.label; + + if (artworkLabel) { + workingCapsule += '.withLabel'; + workingOptions.label = + language.typicallyLowerCase(artworkLabel); + } + + const contribAnnotation = + (slots.filterEditsForWiki + ? data.annotation?.replace(/^edits for wiki(: )?/, '') + : data.annotation); + + if (contribAnnotation) { + workingCapsule += '.withAnnotation'; + workingOptions.annotation = contribAnnotation; + } + + if (empty(Object.keys(workingOptions))) { + return html.blank(); + } + + return language.$(workingCapsule, workingOptions); + }), content: language.encapsulate('artistPage.creditList.entry', capsule => diff --git a/src/strings-default.yaml b/src/strings-default.yaml index 0ce33a2c..0fcc88b6 100644 --- a/src/strings-default.yaml +++ b/src/strings-default.yaml @@ -1330,6 +1330,16 @@ artistPage: flash: _: "{FLASH}" + artwork.accent: + withLabel: >- + {LABEL} + + withAnnotation: >- + {ANNOTATION} + + withLabel.withAnnotation: >- + {LABEL}: {ANNOTATION} + # contributedDurationLine: # This is shown at the top of the artist's track list, provided # any of their tracks have durations at all. |