summaryrefslogtreecommitdiffstats
path: root/extensions/Review/template/en/default/hook/global/header-badge.html.tmpl
blob: df3dd82becf4dabe162d3847810965ebc567e334 (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
[%# 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.
  #%]

[% IF user.id %]
  [% request_count = user.review_request_count + user.feedback_request_count + user.needinfo_request_count %]
  <div id="header-requests" class="dropdown">
    <button type="button" id="header-requests-menu-button" class="dropdown-button minor"
            title="Requests for you[%- IF request_count -%]:
              [%- " review (" _ user.review_request_count _ ")" IF user.review_request_count -%]
              [%- " feedback (" _ user.feedback_request_count _ ")" IF user.feedback_request_count -%]
              [%- " needinfo (" _ user.needinfo_request_count _ ")" IF user.needinfo_request_count -%][%- END -%]"
            aria-label="Requests for you" aria-expanded="false" aria-haspopup="true" aria-controls="header-requests-menu">
      [%- IF request_count -%]
        <span class="badge">[% request_count FILTER html %]</span>
      [%- ELSE -%]
        <span class="icon" aria-hidden="true"></span>
      [%- END -%]
    </button>
    <section class="dropdown-content dropdown-panel left" id="header-requests-menu" role="menu" style="display:none;">
      <header>
        <h2>Requests</h2>
      </header>
      [%- IF request_count -%]
        <div class="loading">Loading…</div>
        <ul class="notifications" role="none" hidden></ul>
      [%- ELSE -%]
        <div class="empty">You’re all caught up!</div>
      [%- END -%]
      <footer>
        <div><a href="request.cgi?action=queue&amp;requestee=[% user.login FILTER uri %]&amp;group=requestee"
                role="menuitem" tabindex="-1">See All</a></div>
      </footer>
    </section>
  </div>
[% END %]