« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/page/group.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/page/group.js')
-rw-r--r--src/page/group.js69
1 files changed, 35 insertions, 34 deletions
diff --git a/src/page/group.js b/src/page/group.js
index ef3813f..0ff04ae 100644
--- a/src/page/group.js
+++ b/src/page/group.js
@@ -55,42 +55,43 @@ export function write(group, {wikiData}) {
             html.tag('blockquote',
               transformMultiline(group.description)),
 
-          ...group.albums ? [
-            html.tag('h2',
-              language.$('groupInfoPage.albumList.title')),
-
-            html.tag('p',
-              language.$('groupInfoPage.viewAlbumGallery', {
-                link: link.groupGallery(group, {
-                  text: language.$('groupInfoPage.viewAlbumGallery.link'),
-                }),
-              })),
+          ...html.fragment(
+            group.albums && [
+              html.tag('h2',
+                language.$('groupInfoPage.albumList.title')),
+
+              html.tag('p',
+                language.$('groupInfoPage.viewAlbumGallery', {
+                  link: link.groupGallery(group, {
+                    text: language.$('groupInfoPage.viewAlbumGallery.link'),
+                  }),
+                })),
 
-            html.tag('ul',
-              albumLines.map(({album, otherGroup}) => {
-                const item = album.date
-                  ? language.$('groupInfoPage.albumList.item', {
-                      year: album.date.getFullYear(),
-                      album: link.album(album),
-                    })
-                  : language.$('groupInfoPage.albumList.item.withoutYear', {
-                      album: link.album(album),
-                    });
-                return html.tag('li',
-                  otherGroup
-                    ? language.$('groupInfoPage.albumList.item.withAccent', {
-                        item,
-                        accent: html.tag('span',
-                          {class: 'other-group-accent'},
-                          language.$('groupInfoPage.albumList.item.otherGroupAccent', {
-                            group: link.groupInfo(otherGroup, {
-                              color: false,
-                            }),
-                          })),
+              html.tag('ul',
+                albumLines.map(({album, otherGroup}) => {
+                  const item = album.date
+                    ? language.$('groupInfoPage.albumList.item', {
+                        year: album.date.getFullYear(),
+                        album: link.album(album),
                       })
-                    : item);
-              })),
-          ] : [],
+                    : language.$('groupInfoPage.albumList.item.withoutYear', {
+                        album: link.album(album),
+                      });
+                  return html.tag('li',
+                    otherGroup
+                      ? language.$('groupInfoPage.albumList.item.withAccent', {
+                          item,
+                          accent: html.tag('span',
+                            {class: 'other-group-accent'},
+                            language.$('groupInfoPage.albumList.item.otherGroupAccent', {
+                              group: link.groupInfo(otherGroup, {
+                                color: false,
+                              }),
+                            })),
+                        })
+                      : item);
+                })),
+            ]),
         ],
       },