diff options
Diffstat (limited to 'src/content/dependencies')
-rw-r--r-- | src/content/dependencies/generateChronologyLinks.js | 23 | ||||
-rw-r--r-- | src/content/dependencies/generateScopedTrackChronologyLinks.js | 2 |
2 files changed, 22 insertions, 3 deletions
diff --git a/src/content/dependencies/generateChronologyLinks.js b/src/content/dependencies/generateChronologyLinks.js index 8ec6ee0a..0158ffd5 100644 --- a/src/content/dependencies/generateChronologyLinks.js +++ b/src/content/dependencies/generateChronologyLinks.js @@ -4,6 +4,11 @@ export default { extraDependencies: ['html', 'language'], slots: { + showOnly: { + type: 'boolean', + default: false, + }, + chronologyInfoSets: { validate: v => v.strictArrayOf( @@ -24,9 +29,17 @@ export default { return html.blank(); } + let infoSets = slots.chronologyInfoSets; + + if (!slots.showOnly) { + infoSets = infoSets + .filter(({nextLink, previousLink}) => + nextLink || previousLink); + } + const totalContributionCount = accumulateSum( - slots.chronologyInfoSets, + infoSets, ({contributions}) => contributions.length); if (totalContributionCount === 0) { @@ -39,7 +52,7 @@ export default { } return html.tags( - slots.chronologyInfoSets.map(({ + infoSets.map(({ headingString, contributions, }) => @@ -52,7 +65,11 @@ export default { const heading = html.tag('span', {class: 'heading'}, language.$(headingString, { - index: language.formatIndex(index), + index: + (previousLink || nextLink + ? language.formatIndex(index) + : language.formatString('misc.chronology.heading.onlyIndex')), + artist: artistLink, })); diff --git a/src/content/dependencies/generateScopedTrackChronologyLinks.js b/src/content/dependencies/generateScopedTrackChronologyLinks.js index fb43203b..7cb9ee63 100644 --- a/src/content/dependencies/generateScopedTrackChronologyLinks.js +++ b/src/content/dependencies/generateScopedTrackChronologyLinks.js @@ -96,6 +96,8 @@ export default { })), relations.chronologyLinks.slots({ + showOnly: true, + chronologyInfoSets: [ { headingString: 'misc.chronology.heading.track', |