summaryrefslogtreecommitdiffstats
path: root/template/en/default/admin/users/list.html.tmpl
blob: db425b40dcba8735cc0d51551b9ac4dd77252fdb (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
[%# The contents of this file are subject to the Mozilla Public
  # License Version 1.1 (the "License"); you may not use this file
  # except in compliance with the License. You may obtain a copy of
  # the License at http://www.mozilla.org/MPL/
  #
  # Software distributed under the License is distributed on an "AS
  # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  # implied. See the License for the specific language governing
  # rights and limitations under the License.
  #
  # The Original Code is the Bugzilla Bug Tracking System.
  #
  # Contributor(s): Marc Schumann <wurblzap@gmail.com>
  #%]

[%# INTERFACE:
  #
  # listselectionvalues: selection values to recreate the current user list.
  # editusers:           is viewing user member of editusers?
  # users:               list of user information (id, login_name, realname,
  #                      disabledtext).
  #%]

[% PROCESS global/header.html.tmpl
  title = "Select user"
  style_urls = ['skins/standard/editusers.css']
  doc_section = "useradmin.html"
%]

[% PROCESS admin/users/listselectvars.html.tmpl
  listselectionvalues = listselectionvalues
%]

[% listselectionurlparams = INCLUDE listselectionurlparams %]

[% columns =
  [{name               => 'login_name'
    heading            => 'Edit user...'
    contentlink        => 'editusers.cgi?action=edit&amp;userid=%%userid%%' _
                          listselectionurlparams
   }
   {name               => 'realname'
    heading            => 'Real name'
   }
   {name               => 'last_seen_date'
    heading            => 'Last Login'
   }
  ]
%]

[% IF editusers %]
  [% columns.push({
    heading            => 'Account History'
    content            => 'View'
    contentlink        => 'editusers.cgi?action=activity' _
                                  '&amp;userid=%%userid%%' _
                                  listselectionurlparams
   }
   {
     heading     => 'Admin History'
     content     => 'View'
     contentlink => 'editusers.cgi?action=admin_activity' _
                            '&amp;userid=%%userid%%' _
                            listselectionurlparams
   })
  %]
[% END %]

[% IF Param('allowuserdeletion') && editusers %]
  [% columns.push({heading     => 'Action'
                   content     => 'Delete'
                   contentlink => 'editusers.cgi?action=del' _
                                  '&amp;userid=%%userid%%' _
                                  listselectionurlparams
                  }
                 )
  %]
[% END %]

[%# Disabled users are crossed out. Missing realnames are noticed in red. %]
[% overrides.login_name = {} %]
[% overrides.realname = {} %]

[% FOREACH thisuser = users %]
  [% IF !thisuser.realname %]
    [%# We cannot pass one class now and one class later. %]
    [% SET classes = (thisuser.is_enabled ? "missing" : "bz_inactive missing") %]
    [% overrides.realname.login_name.${thisuser.login_name} = {
           content          => "missing"
           override_content => 1
           class            => "$classes"
           override_class   => 1
       }
    %]
  [% ELSIF !thisuser.is_enabled %]
    [% overrides.realname.login_name.${thisuser.login_name} = {
           class          => "bz_inactive"
           override_class => 1
       }
    %]
  [% END %]

  [% IF !thisuser.is_enabled %]
    [% overrides.login_name.login_name.${thisuser.login_name} = {
           class          => "bz_inactive"
           override_class => 1
       }
    %]
  [% END %]
[% END %]

<p>[% users.size %] user[% "s" UNLESS users.size == 1 %] found.</p>

[% PROCESS admin/table.html.tmpl
  columns = columns
  data    = users
  overrides = overrides
%]

<p>
  If you do not wish to modify a user account at this time, you can
  <a href="editusers.cgi">find other users</a>
  [% IF editusers %]
    or
    <a href="editusers.cgi?action=add[% INCLUDE listselectionurlparams %]">add
    a new user</a>
  [% END %].
</p>

[% PROCESS global/footer.html.tmpl %]