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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
|
export default {
contentDependencies: [
'generateAdditionalNamesBox',
'generateAlbumAdditionalFilesList',
'generateAlbumBanner',
'generateAlbumCoverArtwork',
'generateAlbumNavAccent',
'generateAlbumReleaseInfo',
'generateAlbumSecondaryNav',
'generateAlbumSidebar',
'generateAlbumSocialEmbed',
'generateAlbumStyleRules',
'generateAlbumTrackList',
'generateCommentarySection',
'generateContentHeading',
'generatePageLayout',
'linkAlbumCommentary',
'linkAlbumGallery',
],
extraDependencies: ['html', 'language'],
relations: (relation, album) => ({
layout:
relation('generatePageLayout'),
albumStyleRules:
relation('generateAlbumStyleRules', album, null),
socialEmbed:
relation('generateAlbumSocialEmbed', album),
albumNavAccent:
relation('generateAlbumNavAccent', album, null),
secondaryNav:
relation('generateAlbumSecondaryNav', album),
sidebar:
relation('generateAlbumSidebar', album, null),
additionalNamesBox:
relation('generateAdditionalNamesBox', album.additionalNames),
cover:
(album.hasCoverArt
? relation('generateAlbumCoverArtwork', album)
: null),
banner:
(album.hasBannerArt
? relation('generateAlbumBanner', album)
: null),
contentHeading:
relation('generateContentHeading'),
releaseInfo:
relation('generateAlbumReleaseInfo', album),
galleryLink:
(album.tracks.some(t => t.hasUniqueCoverArt)
? relation('linkAlbumGallery', album)
: null),
commentaryLink:
(album.commentary || album.tracks.some(t => t.commentary)
? relation('linkAlbumCommentary', album)
: null),
trackList:
relation('generateAlbumTrackList', album),
additionalFilesList:
relation('generateAlbumAdditionalFilesList',
album,
album.additionalFiles),
artistCommentarySection:
relation('generateCommentarySection', album.commentary),
creditSourcesSection:
relation('generateCommentarySection', album.creditSources),
}),
data: (album) => ({
name:
album.name,
color:
album.color,
dateAddedToWiki:
album.dateAddedToWiki,
}),
generate: (data, relations, {html, language}) =>
language.encapsulate('albumPage', pageCapsule =>
relations.layout.slots({
title:
language.$(pageCapsule, 'title', {
album: data.name,
}),
color: data.color,
headingMode: 'sticky',
styleRules: [relations.albumStyleRules],
additionalNames: relations.additionalNamesBox,
cover: relations.cover,
mainContent: [
relations.releaseInfo,
html.tag('p',
{[html.onlyIfContent]: true},
{[html.joinChildren]: html.tag('br')},
language.encapsulate('releaseInfo', capsule => [
!html.isBlank(relations.additionalFilesList) &&
language.$(capsule, 'additionalFiles.shortcut', {
link: html.tag('a',
{href: '#additional-files'},
language.$(capsule, 'additionalFiles.shortcut.link')),
}),
(relations.galleryLink && relations.commentaryLink
? language.encapsulate(capsule, 'viewGalleryOrCommentary', capsule =>
language.$(capsule, {
gallery:
relations.galleryLink
.slot('content', language.$(capsule, 'gallery')),
commentary:
relations.commentaryLink
.slot('content', language.$(capsule, 'commentary')),
}))
: relations.galleryLink
? language.encapsulate(capsule, 'viewGallery', capsule =>
language.$(capsule, {
link:
relations.galleryLink
.slot('content', language.$(capsule, 'link')),
}))
: relations.commentaryLink
? language.encapsulate(capsule, 'viewCommentary', capsule =>
language.$(capsule, {
link:
relations.commentaryLink
.slot('content', language.$(capsule, 'link')),
}))
: html.blank()),
!html.isBlank(relations.creditSourcesSection) &&
language.encapsulate(capsule, 'readCreditSources', capsule =>
language.$(capsule, {
link:
html.tag('a',
{href: '#credit-sources'},
language.$(capsule, 'link')),
})),
])),
relations.trackList,
html.tag('p',
{[html.onlyIfContent]: true},
{[html.joinChildren]: html.tag('br')},
language.encapsulate('releaseInfo', capsule => [
language.$(capsule, 'addedToWiki', {
[language.onlyIfOptions]: ['date'],
date: language.formatDate(data.dateAddedToWiki),
}),
])),
language.encapsulate('releaseInfo.additionalFiles', capsule =>
html.tags([
relations.contentHeading.clone()
.slots({
attributes: {id: 'additional-files'},
title: language.$(capsule, 'heading'),
}),
relations.additionalFilesList,
])),
relations.artistCommentarySection,
relations.creditSourcesSection.slots({
id: 'credit-sources',
title: language.$('misc.creditSources'),
}),
],
navLinkStyle: 'hierarchical',
navLinks: [
{auto: 'home'},
{
auto: 'current',
accent:
relations.albumNavAccent.slots({
showTrackNavigation: true,
showExtraLinks: true,
}),
},
],
banner: relations.banner ?? null,
bannerPosition: 'top',
secondaryNav: relations.secondaryNav,
leftSidebar: relations.sidebar,
socialEmbed: relations.socialEmbed,
})),
};
|