diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2024-08-15 12:48:21 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2024-08-15 12:48:33 -0300 |
commit | 91dbbd7abb7fe526d775f4bc4958ad44938bc214 (patch) | |
tree | f667a421c0765adeb4a09164efb0339e5533132d /src/content/dependencies/generateReleaseInfoContributionsLineWikiEditsPart.js | |
parent | a2bf9ff61de1dcdc5406dc3c400aa4abc2dc0425 (diff) |
content, css: gRIContributionsLine: wiki edits tooltip
Diffstat (limited to 'src/content/dependencies/generateReleaseInfoContributionsLineWikiEditsPart.js')
-rw-r--r-- | src/content/dependencies/generateReleaseInfoContributionsLineWikiEditsPart.js | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/content/dependencies/generateReleaseInfoContributionsLineWikiEditsPart.js b/src/content/dependencies/generateReleaseInfoContributionsLineWikiEditsPart.js new file mode 100644 index 00000000..37f29b1c --- /dev/null +++ b/src/content/dependencies/generateReleaseInfoContributionsLineWikiEditsPart.js @@ -0,0 +1,52 @@ +export default { + contentDependencies: [ + 'generateTextWithTooltip', + 'generateTooltip', + 'linkContribution', + ], + + extraDependencies: ['html', 'language'], + + relations: (relation, contributions) => ({ + textWithTooltip: + relation('generateTextWithTooltip'), + + tooltip: + relation('generateTooltip'), + + contributionLinks: + contributions + .map(contrib => relation('linkContribution', contrib)), + }), + + generate: (relations, {html, language}) => + language.encapsulate('misc.artistLink.withEditsForWiki', capsule => + relations.textWithTooltip.slots({ + attributes: + {class: 'wiki-edits'}, + + text: + language.$(capsule, 'edits'), + + tooltip: + relations.tooltip.slots({ + attributes: + {class: 'wiki-edits-tooltip'}, + + content: + html.tags( + relations.contributionLinks.map(link => + language.$(capsule, 'editsLine', { + artist: + link.slots({ + showContribution: false, + showExternalLinks: false, + showChronology: false, + preventTooltip: true, + }), + })), + + {[html.joinChildren]: html.tag('br')}), + }), + })), +}; |