« get me outta code hell

generateSearchSidebarBox.js « dependencies « content « src - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateSearchSidebarBox.js
blob: c534c49277a20311affaa54f08bc1b524b3637a8 (plain)
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
export default {
  contentDependencies: ['generatePageSidebarBox'],
  extraDependencies: ['html', 'language'],

  relations: (relation) => ({
    sidebarBox:
      relation('generatePageSidebarBox'),
  }),

  generate: (relations, {html, language}) =>
    relations.sidebarBox.slots({
      attributes: {class: 'wiki-search-sidebar-box'},
      collapsible: false,

      content: [
        html.tag('input', {class: 'wiki-search-input'},
          {
            placeholder:
              language.$('misc.search.placeholder').toString(),
          },
          {type: 'search'}),

        html.tag('template', {class: 'wiki-search-no-results-string'},
          language.$('misc.search.noResults')),

        html.tag('template', {class: 'wiki-search-current-result-string'},
          language.$('misc.search.currentResult')),

        html.tag('template', {class: 'wiki-search-end-search-string'},
          language.$('misc.search.endSearch')),
      ],
    }),
};