summaryrefslogtreecommitdiffstats
path: root/extensions/BugModal/template/en/default/bug_modal/user.html.tmpl
blob: 9eda7b9367d2694e9072b8a8596be2d24a585154 (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
[%# 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.
  #%]

[%#
  # u : user object
  # simple : boolean, if true an unadorned name will be displayed (no gravatar, no menu) (default: false)
  # gravatar_size : size of the gravator icon (default 0, which disables the gravatar)
  # gravatar_only : boolean, if true output just the gravatar (not-simple only)
  # nick_only : boolean, if true, the nickname will be used instead of the full name
  # id : string, if provided the id of the vcard div
  #%]

[%
IF !u.id;
  "---";
  RETURN;
END;
DEFAULT gravatar_size = 0;
IF user.settings.show_gravatars.value != 'On';
  gravatar_size = 0;
END;
%]
<div class="vcard vcard_[% u.id FILTER none %]" [% IF id %]id="[% id FILTER html %]"[% END %]>
  [% FILTER collapse %]

    [% IF simple %]
      [% IF user.id %]
        <span class="fn" title="[% u.identity FILTER html %]">[% u.moz_nick FILTER html %]</span>
      [% ELSE %]
        <span class="fn">[% u.moz_nick FILTER html %]</span>
      [% END %]

    [% ELSE %]
      [% IF gravatar_size %]
        <img src="[% u.gravatar(gravatar_size * 2) FILTER none %]" class="gravatar"
          width="[% gravatar_size FILTER none %]" height="[% gravatar_size FILTER none %]">
      [% END %]
      [% UNLESS gravatar_only %]
        <a class="email [%= "disabled" UNLESS u.is_enabled %] [% " show_usermenu" IF user.id %]"
          [% IF user.id %]
            href="mailto:[% u.email FILTER html %]"
            data-user-email="[% u.email FILTER html %]"
            data-user-id="[% u.id FILTER html %]"
            data-show-edit="[% user.in_group('editusers') || user.in_group('disableusers') || user.bless_groups.size > 0 ? 1 : 0 %]"
            title="[% u.identity FILTER html %]"
          [% ELSE %]
            href="user_profile?user_id=[% u.id FILTER none %]"
          [% END %]
          >
          <span class="[% user.id ? 'fn' : 'fna' %]">[% nick_only ? u.moz_nick : (u.name || u.nick) FILTER html %]</span>
          [%~~%]
        </a>
      [% END %]
    [% END %]
  [% END %]
</div>