|
@@ -1,10 +1,14 @@
|
|
|
+import {stitchArrays} from '#sugar';
|
|
|
+
|
|
|
export default {
|
|
|
contentDependencies: [
|
|
|
+ 'generateColorStyleAttribute',
|
|
|
'generateGroupInfoPageAlbumsSection',
|
|
|
'generateGroupNavLinks',
|
|
|
'generateGroupSecondaryNav',
|
|
|
'generateGroupSidebar',
|
|
|
'generatePageLayout',
|
|
|
+ 'linkArtist',
|
|
|
'linkExternal',
|
|
|
'transformContent',
|
|
|
],
|
|
@@ -14,9 +18,24 @@ export default {
|
|
|
sprawl: ({wikiInfo}) => ({
|
|
|
enableGroupUI:
|
|
|
wikiInfo.enableGroupUI,
|
|
|
+
|
|
|
+ wikiColor:
|
|
|
+ wikiInfo.color,
|
|
|
+ }),
|
|
|
+
|
|
|
+ query: (_sprawl, group) => ({
|
|
|
+ aliasLinkedArtists:
|
|
|
+ group.closelyLinkedArtists
|
|
|
+ .filter(({annotation}) =>
|
|
|
+ annotation === 'alias'),
|
|
|
+
|
|
|
+ generalLinkedArtists:
|
|
|
+ group.closelyLinkedArtists
|
|
|
+ .filter(({annotation}) =>
|
|
|
+ annotation !== 'alias'),
|
|
|
}),
|
|
|
|
|
|
- relations: (relation, sprawl, group) => ({
|
|
|
+ relations: (relation, query, sprawl, group) => ({
|
|
|
layout:
|
|
|
relation('generatePageLayout'),
|
|
|
|
|
@@ -33,6 +52,19 @@ export default {
|
|
|
? relation('generateGroupSidebar', group)
|
|
|
: null),
|
|
|
|
|
|
+ wikiColorAttribute:
|
|
|
+ relation('generateColorStyleAttribute', sprawl.wikiColor),
|
|
|
+
|
|
|
+ closeArtistLinks:
|
|
|
+ query.generalLinkedArtists
|
|
|
+ .map(({thing: artist}) =>
|
|
|
+ relation('linkArtist', artist)),
|
|
|
+
|
|
|
+ aliasArtistLinks:
|
|
|
+ query.aliasLinkedArtists
|
|
|
+ .map(({thing: artist}) =>
|
|
|
+ relation('linkArtist', artist)),
|
|
|
+
|
|
|
visitLinks:
|
|
|
group.urls
|
|
|
.map(url => relation('linkExternal', url)),
|
|
@@ -44,12 +76,16 @@ export default {
|
|
|
relation('generateGroupInfoPageAlbumsSection', group),
|
|
|
}),
|
|
|
|
|
|
- data: (_sprawl, group) => ({
|
|
|
+ data: (query, _sprawl, group) => ({
|
|
|
name:
|
|
|
group.name,
|
|
|
|
|
|
color:
|
|
|
group.color,
|
|
|
+
|
|
|
+ closeArtistAnnotations:
|
|
|
+ query.generalLinkedArtists
|
|
|
+ .map(({annotation}) => annotation),
|
|
|
}),
|
|
|
|
|
|
generate: (data, relations, {html, language}) =>
|
|
@@ -62,6 +98,58 @@ export default {
|
|
|
mainContent: [
|
|
|
html.tag('p',
|
|
|
{[html.onlyIfContent]: true},
|
|
|
+ {[html.joinChildren]: html.tag('br')},
|
|
|
+
|
|
|
+ language.encapsulate(pageCapsule, 'closelyLinkedArtists', capsule => [
|
|
|
+ language.encapsulate(capsule, capsule => {
|
|
|
+ const [workingCapsule, option] =
|
|
|
+ (relations.closeArtistLinks.length === 0
|
|
|
+ ? [null, null]
|
|
|
+ : relations.closeArtistLinks.length === 1
|
|
|
+ ? [language.encapsulate(capsule, 'one'), 'artist']
|
|
|
+ : [language.encapsulate(capsule, 'multiple'), 'artists']);
|
|
|
+
|
|
|
+ if (!workingCapsule) return html.blank();
|
|
|
+
|
|
|
+ return language.$(workingCapsule, {
|
|
|
+ [option]:
|
|
|
+ language.formatUnitList(
|
|
|
+ stitchArrays({
|
|
|
+ link: relations.closeArtistLinks,
|
|
|
+ annotation: data.closeArtistAnnotations,
|
|
|
+ }).map(({link, annotation}) =>
|
|
|
+ language.encapsulate(capsule, 'artist', workingCapsule => {
|
|
|
+ const workingOptions = {};
|
|
|
+
|
|
|
+ workingOptions.artist =
|
|
|
+ link.slots({
|
|
|
+ attributes: [relations.wikiColorAttribute],
|
|
|
+ });
|
|
|
+
|
|
|
+ if (annotation) {
|
|
|
+ workingCapsule += '.withAnnotation';
|
|
|
+ workingOptions.annotation = annotation;
|
|
|
+ }
|
|
|
+
|
|
|
+ return language.$(workingCapsule, workingOptions);
|
|
|
+ }))),
|
|
|
+ });
|
|
|
+ }),
|
|
|
+
|
|
|
+ language.$(capsule, 'aliases', {
|
|
|
+ [language.onlyIfOptions]: ['aliases'],
|
|
|
+
|
|
|
+ aliases:
|
|
|
+ language.formatConjunctionList(
|
|
|
+ relations.aliasArtistLinks.map(link =>
|
|
|
+ link.slots({
|
|
|
+ attributes: [relations.wikiColorAttribute],
|
|
|
+ }))),
|
|
|
+ }),
|
|
|
+ ])),
|
|
|
+
|
|
|
+ html.tag('p',
|
|
|
+ {[html.onlyIfContent]: true},
|
|
|
|
|
|
language.$('releaseInfo.visitOn', {
|
|
|
[language.onlyIfOptions]: ['links'],
|