~samba-team/swat/unstable

« back to all changes in this revision

Viewing changes to swat/templates/default/derived/account.mako

  • Committer: Jelmer Vernooij
  • Date: 2010-06-19 00:39:43 UTC
  • mfrom: (216.2.262)
  • Revision ID: jelmer@samba.org-20100619003943-mylkv680m6dq94u0
Merge newer upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
<%namespace name="toolbar" file="/default/component/toolbar.mako" />
20
20
<%namespace name="pagination" file="/default/component/pagination.mako" />
21
21
 
 
22
<script type="text/javascript">
 
23
    window.addEvent("domready", function() {
 
24
        formSubmission = new FormSubmit({formId: 'account-list'});
 
25
    });
 
26
</script>
 
27
 
22
28
${parent.action_title(c.config.get_action_info('friendly_name'))}
23
29
${toolbar.write(c.config.get_toolbar_items())}
24
30
${options(c.config.get_action())}
40
46
<%doc>TODO make tabs or mix them up?</%doc>
41
47
<%def name="user_table(users, table_id='user-list', table_class='')">
42
48
 
 
49
${h.form('', method="post", id="account-list", class_="")}
 
50
 
43
51
    % if len(users) > 0:
44
52
        <% table_class = table_class + " not-empty" %>
45
53
    % endif
47
55
    % if c.list_groups == True:
48
56
        <h3>${_("User List")}</h3>
49
57
    % endif
50
 
    
 
58
 
51
59
    <table id="${table_id}" class="list ${table_class}">
52
60
        <thead>
53
61
            <tr>
56
64
                <td class="user-gid">${_('UID')}</td>
57
65
                <td class="user-name">${_('Username')}</td>
58
66
                <td class="user-description">${_('Description')}</td>
 
67
                <td class="user-account-status">${_('Enabled')}</td>
59
68
                <td class="user-quick-operations"></td>
60
69
            </tr>
61
70
        </thead>
83
92
        %>
84
93
        
85
94
        % for user in users[begin:end]:
86
 
            <% tr_class = '' %>
 
95
            <%
 
96
            
 
97
            tr_class = ''
 
98
            disabled_class = ''
 
99
            
 
100
            %>
87
101
            
88
102
            % if i % 2 == 0:
89
103
                <% tr_class = " alternate-row " %>
90
104
            % endif
 
105
            
 
106
            % if user.account_disabled and c.filter_status == -1:
 
107
                <% disabled_class = " disabled-row" %>
 
108
            % endif
91
109
        
92
 
            <tr id="row-user-${i}" title="${_('Edit User')}" class="${tr_class}">
93
 
                <td><input value="${user.username}" onchange="selectShareRow(this);" name="name" type="checkbox" id="check-row-user-${i}" /></td>
94
 
                <td onclick="clickableRow('${h.url_for(controller = 'account', action = 'edituser', id = user.rid)}');">${i}</td>
95
 
                <td onclick="clickableRow('${h.url_for(controller = 'account', action = 'edituser', id = user.rid)}');">${user.rid}</td>
96
 
                <td onclick="clickableRow('${h.url_for(controller = 'account', action = 'edituser', id = user.rid)}');">${user.username}</td>
97
 
                <td onclick="clickableRow('${h.url_for(controller = 'account', action = 'edituser', id = user.rid)}');">${user.description}</td>
98
 
                <td onclick="clickableRow('${h.url_for(controller = 'account', action = 'edituser', id = user.rid)}');">${quick_tasks(user.rid, "User", False)}</td>
 
110
            <tr id="row-user-${i}" title="${_('Edit User')}" class="${tr_class} ${disabled_class}">
 
111
                <td><input value="${user.username}" onchange="selectShareRow(this);" name="uid" type="checkbox" id="check-row-user-${i}" /></td>
 
112
                <td onclick="clickableRow('${h.url_for('account_action', controller='account', action='user', subaction='edit', name=user.username)}');">${i}</td>
 
113
                <td onclick="clickableRow('${h.url_for('account_action', controller='account', action='user', subaction='edit', name=user.username)}');">${user.rid}</td>
 
114
                <td onclick="clickableRow('${h.url_for('account_action', controller='account', action='user', subaction='edit', name=user.username)}');">${user.username}</td>
 
115
                <td onclick="clickableRow('${h.url_for('account_action', controller='account', action='user', subaction='edit', name=user.username)}');">${user.description}</td>
 
116
                <td onclick="clickableRow('${h.url_for('account_action', controller='account', action='user', subaction='edit', name=user.username)}');">
 
117
                    % if user.account_disabled:
 
118
                        ${_("No")}
 
119
                    % else:
 
120
                        ${_("Yes")}
 
121
                    % endif
 
122
                </td>
 
123
                <td onclick="clickableRow('${h.url_for('account_action', controller='account', action='user', subaction='edit', name=user.username)}');">${quick_tasks(user.username, "User", user.account_disabled)}</td>
99
124
            </tr>
100
125
            
101
126
            <% i = i + 1 %>
102
127
        % endfor
103
128
    </table>
 
129
${h.end_form()}
104
130
</%def>
105
131
 
106
132
<%def name="group_table(groups, table_id='group-list', table_class='')">
 
133
${h.form('', method="post", id="account-list", class_="")}
107
134
    % if len(groups) > 0:
108
135
        <% table_class = table_class + " not-empty" %>
109
136
    % endif
155
182
            % endif
156
183
        
157
184
            <tr id="row-group-${i}" title="${_('Edit Group')}" class="${tr_class}">
158
 
                <td><input value="${group.name}" onchange="selectShareRow(this);" name="name" type="checkbox" id="check-row-group-${i}" /></td>
159
 
                <td onclick="clickableRow('${h.url_for(controller = 'account', action = 'editgroup', id = group.rid)}');">${i}</td>
160
 
                <td onclick="clickableRow('${h.url_for(controller = 'account', action = 'editgroup', id = group.rid)}');">${group.rid}</td>
161
 
                <td onclick="clickableRow('${h.url_for(controller = 'account', action = 'editgroup', id = group.rid)}');">${group.name}</td>
162
 
                <td onclick="clickableRow('${h.url_for(controller = 'account', action = 'editgroup', id = group.rid)}');">${group.description}</td>
163
 
                <td>${quick_tasks(group.rid, "Group", False)}</td>
 
185
                <td><input value="${group.name}" onchange="selectShareRow(this);" name="gid" type="checkbox" id="check-row-group-${i}" /></td>
 
186
                <td onclick="clickableRow('${h.url_for('account_action', controller='account', action='group', subaction='edit', name = group.name)}');">${i}</td>
 
187
                <td onclick="clickableRow('${h.url_for('account_action', controller='account', action='group', subaction='edit', name = group.name)}');">${group.rid}</td>
 
188
                <td onclick="clickableRow('${h.url_for('account_action', controller='account', action='group', subaction='edit', name = group.name)}');">${group.name}</td>
 
189
                <td onclick="clickableRow('${h.url_for('account_action', controller='account', action='group', subaction='edit', name = group.name)}');">${group.description}</td>
 
190
                <td style="min-width:35px;">${quick_tasks(group.name, "Group", False)}</td>
164
191
            </tr>
165
192
            
166
193
            <% i = i + 1 %>
167
194
        % endfor
168
195
    </table>
 
196
${h.end_form()}
169
197
</%def>
170
198
    
171
199
<%def name="quick_tasks(id, type, is_disabled=False)">
172
200
    <ul class="quick-tasks">
173
 
        <li><a href="${h.url_for(controller = 'account', action = 'edit' + type.lower(), id = id)}" title="${_('Edit %s' % (type))}"><img src="/default/images/icons/folder-pencil.png" alt="${_('Edit %s Icon' % (type))}"/></a></li>
174
 
        <li><a href="${h.url_for(controller = 'account', action = 'remove' + type.lower(), id = id)}" title="${_('Remove %s' % (type))}"><img src="/default/images/icons/folder-minus.png" alt="${_('Remove %s Icon' % (type))}"/></a></li>
 
201
        <li><a href="${h.url_for('account_action', action=type.lower(), subaction='edit', name=id)}" title="${_('Edit %s' % (type))}"><img src="/default/images/icons/user-pencil.png" alt="${_('Edit %s Icon' % (type))}"/></a></li>
 
202
        <li><a href="${h.url_for('account_action', action=type.lower(), subaction='remove', name=id)}" title="${_('Remove %s' % (type))}"><img src="/default/images/icons/user-minus.png" alt="${_('Remove %s Icon' % (type))}"/></a></li>
 
203
        
 
204
        % if type.lower() == "user":
 
205
            <li><a href="${h.url_for('account_action', action=type.lower(), subaction='toggle', name=id)}" title="${_('Toggle this %s' % (type))}">
 
206
                % if is_disabled == True:
 
207
                    <img src="/default/images/icons/lock-unlock.png" alt="${_('Toggle (Enable) %s Icon' % (type))}"/>
 
208
                % else:
 
209
                    <img src="/default/images/icons/lock.png" alt="${_('Toggle (Disable) %s Icon' % (type))}"/>
 
210
                % endif
 
211
            </a></li>
 
212
        % endif
175
213
    </ul>
176
214
</%def>
177
215
 
188
226
            % endif
189
227
            
190
228
            <span style="float:right;">
191
 
                <label for="items_per_page">${_('Per Page')}:</label>
 
229
                % if action_name == "user":
 
230
                    <label for="show-only-status">${_("Show")}:</label>
 
231
                    <select name="filter_status" id="show-only-status" onchange="submitForm('options');">
 
232
                        <option
 
233
                                % if c.filter_status == -1:
 
234
                                    selected="selected"
 
235
                                % endif
 
236
                                
 
237
                                value="-1">${_("All")}</option>
 
238
                        <option
 
239
                                % if c.filter_status == 1:
 
240
                                    selected="selected"
 
241
                                % endif
 
242
                                
 
243
                                value="1">${_("Enabled")}</option>
 
244
                        <option
 
245
                                % if c.filter_status == 0:
 
246
                                    selected="selected"
 
247
                                % endif
 
248
                                
 
249
                                value="0">${_("Disabled")}</option>
 
250
                    </select>
 
251
                % endif
 
252
 
 
253
                <label style="margin-left:15px;" for="items_per_page">${_('Per Page')}:</label>
192
254
                <select name="per_page" id="items_per_page" onchange="submitForm('options');">
193
255
                    % for i in range(5, 30, 5):
194
256
                        <option