summaryrefslogtreecommitdiffstats
path: root/extensions/BugModal/template/en/default/bug_modal/module.html.tmpl
blob: e322cba0ea3bb011c62982c69069c59261f37df7 (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
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
[%# This Source Code Form is subject to the terms of the Mozilla Public
  # License, v. 2.0. If a copy of the MPL was not distributed with this
  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
  #
  # This Source Code Form is "Incompatible With Secondary Licenses", as
  # defined by the Mozilla Public License, v. 2.0.
  #%]

[%#
  # title: (string, optional) main title of module
  # collapse: (boolean) if true, show as collapsed by default (default false)
  # subtitle: (optional) any of:
  #   a string
  #   an array of: (will be joined with ", ")
  #     string (will be filtered)
  #     { unfiltered: html } (will not be filtered)
  # content: (string, required) module's content (use WRAPPER module..)
  # hide_on_view: (boolean) if true, the module won't be visible in view mode
  # hide_on_edit: (boolean) if true, the module won't be visible in edit mode
  # no_collapse_persist: (boolean) if true, the module's collapsed state will
  #   not be remembered between page loads
  #%]

<section class="module
    [%~ " edit-hide" IF hide_on_edit %]
    [%~ " edit-show" IF hide_on_view && !hide_on_edit %]"
    [% IF hide_on_view +%] style="display:none"[% END %]
    [% IF title %] id="module-[% title.replace FILTER id %]"[% END %]
    [%~ ' data-non-stick="1"' IF no_collapse_persist %]
>
  [% IF title %]
    <header id="module-[% title.replace FILTER id %]-header" class="module-header">
      <div class="module-latch"
           data-label-expanded="Collapse [% title FILTER html %] section"
           data-label-collapsed="Expand [% title FILTER html %] section">
        <div class="module-spinner" role="button" tabindex="0"
             aria-controls="module-[% title.replace FILTER id %]-content"
             aria-expanded="[% collapsed ? "false" : "true" %]"
             aria-labeledby="module-[% title.replace FILTER id %]-title"
             aria-describedby="module-[% title.replace FILTER id %]-subtitle"></div>
        <h2 class="module-title" id="module-[% title.replace FILTER id %]-title">[% title FILTER html %]</h2>
        [% IF subtitle != "" && subtitle.size %]
          <h3 class="module-subtitle" id="module-[% title.replace FILTER id %]-subtitle">
            ([% FOREACH st IN subtitle.list %]
              [% IF st.unfiltered.defined %]
                [% st.unfiltered FILTER none %]
              [% ELSE %]
                [% st FILTER html %]
              [% END %]
              [% ", " UNLESS loop.last %]
            [% END %])
          </h3>
        [% END %]
      </div>
    </header>
  [% END %]
  <div class="module-content"
      [%~ IF title %] id="module-[% title.replace FILTER id %]-content"[% END %]
      [%~ ' style="display:none"' IF collapsed %]
  >
    [% content FILTER none %]
  </div>
</section>