~ubuntu-branches/ubuntu/natty/prewikka/natty

« back to all changes in this revision

Viewing changes to prewikka/templates/UserSettings.py

  • Committer: Bazaar Package Importer
  • Author(s): Pierre Chifflier
  • Date: 2008-07-02 16:49:06 UTC
  • mfrom: (6.1.2 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080702164906-q2bkfn6i40hd95tt
Tags: 0.9.14-2
* Update watch file
* Bump Standards version to 3.8.0 (no changes)

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
VFSL=valueFromSearchList
33
33
VFN=valueForName
34
34
currentTime=time.time
35
 
__CHEETAH_version__ = '2.0rc7'
36
 
__CHEETAH_versionTuple__ = (2, 0, 0, 'candidate', 7)
37
 
__CHEETAH_genTime__ = 1180479709.7318771
38
 
__CHEETAH_genTimestamp__ = 'Wed May 30 01:01:49 2007'
 
35
__CHEETAH_version__ = '2.0.1'
 
36
__CHEETAH_versionTuple__ = (2, 0, 1, 'final', 0)
 
37
__CHEETAH_genTime__ = 1207124027.4311581
 
38
__CHEETAH_genTimestamp__ = 'Wed Apr  2 10:13:47 2008'
39
39
__CHEETAH_src__ = 'prewikka/templates/UserSettings.tmpl'
40
 
__CHEETAH_srcLastModified__ = 'Wed May 16 11:30:04 2007'
 
40
__CHEETAH_srcLastModified__ = 'Tue Mar  4 10:31:58 2008'
41
41
__CHEETAH_docstring__ = 'Autogenerated by CHEETAH: The Python-Powered Template Engine'
42
42
 
43
43
if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple:
66
66
            self._initCheetahInstance(**cheetahKWArgs)
67
67
        
68
68
 
 
69
    def layout_start_hook(self, **KWS):
 
70
 
 
71
 
 
72
 
 
73
        ## CHEETAH: generated from #def layout_start_hook at line 3, col 1.
 
74
        trans = KWS.get("trans")
 
75
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
 
76
            trans = self.transaction # is None unless self.awake() was called
 
77
        if not trans:
 
78
            trans = DummyTransaction()
 
79
            _dummyTrans = True
 
80
        else: _dummyTrans = False
 
81
        write = trans.response().write
 
82
        SL = self._CHEETAH__searchList
 
83
        _filter = self._CHEETAH__currentFilter
 
84
        
 
85
        ########################################
 
86
        ## START - generated method body
 
87
        
 
88
        write('''
 
89
<script type="text/javascript">
 
90
 
 
91
<!--
 
92
 
 
93
$(document).ready(function() {
 
94
  $("#allbox").click(function(){
 
95
    $(\'input[@name=permissions]\').check($(this).attr(\'checked\'));
 
96
  });
 
97
});
 
98
 
 
99
//--></script>
 
100
''')
 
101
        
 
102
        ########################################
 
103
        ## END - generated method body
 
104
        
 
105
        return _dummyTrans and trans.response().getvalue() or ""
 
106
        
 
107
 
69
108
    def main_content(self, **KWS):
70
109
 
71
110
 
72
111
 
73
 
        ## CHEETAH: generated from #block main_content at line 3, col 1.
 
112
        ## CHEETAH: generated from #block main_content at line 18, col 1.
74
113
        trans = KWS.get("trans")
75
114
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
76
115
            trans = self.transaction # is None unless self.awake() was called
85
124
        ########################################
86
125
        ## START - generated method body
87
126
        
88
 
        _orig_filter_33063197 = _filter
 
127
        _orig_filter_61592990 = _filter
89
128
        filterName = 'CleanOutput'
90
129
        if self._CHEETAH__filters.has_key("CleanOutput"):
91
130
            _filter = self._CHEETAH__currentFilter = self._CHEETAH__filters[filterName]
95
134
        write('''
96
135
<div id="fieldset_page" style="width: 430px;">
97
136
 
98
 
<form action="?" method="post">
99
 
''')
100
 
        if VFFSL(SL,"user.login",True): # generated from line 9, col 1
101
 
            write('<input type="hidden" name="view" value="user_settings_modify"/>\n')
102
 
        else: # generated from line 11, col 1
103
 
            write('<input type="hidden" name="view" value="user_settings_add"/>\n')
104
 
        write('\n<input type="hidden" name="login" value="')
105
 
        _v = VFFSL(SL,"user.login",True) # '$user.login' on line 15, col 42
106
 
        if _v is not None: write(_filter(_v, rawExpr='$user.login')) # from line 15, col 42.
107
 
        write('''"/>
108
 
 
 
137
<form id="usersettings" action="?" method="post">
 
138
''')
 
139
        if VFFSL(SL,"user.login",True): # generated from line 24, col 1
 
140
            write('''<input type="hidden" name="login" value="''')
 
141
            _v = VFFSL(SL,"user.login",True) # '$user.login' on line 25, col 42
 
142
            if _v is not None: write(_filter(_v, rawExpr='$user.login')) # from line 25, col 42.
 
143
            write('''"/>
 
144
<input type="hidden" name="view" value="user_settings_modify"/>
 
145
''')
 
146
        else: # generated from line 27, col 1
 
147
            write('''<input type="hidden" name="view" value="user_settings_add"/>
 
148
''')
 
149
        write('''
 
150
''')
 
151
        if VFFSL(SL,"user.origin",True): # generated from line 31, col 1
 
152
            write('''<input type="hidden" name="origin" value="''')
 
153
            _v = VFFSL(SL,"user.origin",True) # '$user.origin' on line 32, col 43
 
154
            if _v is not None: write(_filter(_v, rawExpr='$user.origin')) # from line 32, col 43.
 
155
            write('''" />
 
156
''')
 
157
        write('''
109
158
<fieldset class="fieldset_heading">
110
159
 <legend>''')
111
160
        if False:
112
161
            _("Account information")
113
 
        _v = VFFSL(SL,"_",False)("Account information") # '$_("Account information")' on line 18, col 10
114
 
        if _v is not None: write(_filter(_v, rawExpr='$_("Account information")')) # from line 18, col 10.
 
162
        _v = VFFSL(SL,"_",False)("Account information") # '$_("Account information")' on line 36, col 10
 
163
        if _v is not None: write(_filter(_v, rawExpr='$_("Account information")')) # from line 36, col 10.
115
164
        write('''</legend>
116
165
 
117
166
  <table>
118
167
''')
119
 
        if VFFSL(SL,"user.login",True): # generated from line 21, col 1
120
 
            write('   <tr>\n    <th style="vertical-align: middle;">')
 
168
        if VFFSL(SL,"user.login",True): # generated from line 39, col 1
 
169
            write('''   <tr>
 
170
    <th style="vertical-align: middle;">''')
121
171
            if False:
122
172
                _("Login:")
123
 
            _v = VFFSL(SL,"_",False)("Login:") # '$_("Login:")' on line 23, col 41
124
 
            if _v is not None: write(_filter(_v, rawExpr='$_("Login:")')) # from line 23, col 41.
125
 
            write('</th>\n    <td style="text-align:right; vertical-align: middle;">\n     <h2 style="vertical-align: middle; padding:0px; margin:0px;"><b>')
126
 
            _v = VFFSL(SL,"user.login",True) # '$user.login' on line 25, col 70
127
 
            if _v is not None: write(_filter(_v, rawExpr='$user.login')) # from line 25, col 70.
 
173
            _v = VFFSL(SL,"_",False)("Login:") # '$_("Login:")' on line 41, col 41
 
174
            if _v is not None: write(_filter(_v, rawExpr='$_("Login:")')) # from line 41, col 41.
 
175
            write('''</th>
 
176
    <td style="text-align:right; vertical-align: middle;">
 
177
     <h2 style="vertical-align: middle; padding:0px; margin:0px;"><b>''')
 
178
            _v = VFFSL(SL,"user.login",True) # '$user.login' on line 43, col 70
 
179
            if _v is not None: write(_filter(_v, rawExpr='$user.login')) # from line 43, col 70.
128
180
            write('''</b></h2>
129
181
    </td>
130
182
   </tr>
131
183
''')
132
 
        else: # generated from line 28, col 1
133
 
            write('\n')
134
 
            if VFFSL(SL,"errmsg",True): # generated from line 30, col 4
135
 
                write('   <tr>\n\t<td colspan=2><font style="color: red;">')
136
 
                _v = VFFSL(SL,"errmsg",True) # '$errmsg' on line 32, col 42
137
 
                if _v is not None: write(_filter(_v, rawExpr='$errmsg')) # from line 32, col 42.
138
 
                write('</font></td>\n   </tr>\n')
 
184
        else: # generated from line 46, col 1
 
185
            write('''
 
186
''')
 
187
            if VFFSL(SL,"errmsg",True): # generated from line 48, col 4
 
188
                write('''   <tr>
 
189
\t<td colspan=2><font style="color: red;">''')
 
190
                _v = VFFSL(SL,"errmsg",True) # '$errmsg' on line 50, col 42
 
191
                if _v is not None: write(_filter(_v, rawExpr='$errmsg')) # from line 50, col 42.
 
192
                write('''</font></td>
 
193
   </tr>
 
194
''')
139
195
            write('''
140
196
   <tr>
141
197
    <th>Login:</th>
142
198
    <td style="text-align: right;"><input type="text" name="login"/></td>
143
199
   </tr>
144
200
''')
145
 
        write('\n   <tr>\n    <th style="vertical-align: middle;">')
 
201
        write('''
 
202
   <tr>
 
203
    <th style="vertical-align: middle;">''')
146
204
        if False:
147
205
            _("Language:")
148
 
        _v = VFFSL(SL,"_",False)("Language:") # '$_("Language:")' on line 43, col 41
149
 
        if _v is not None: write(_filter(_v, rawExpr='$_("Language:")')) # from line 43, col 41.
 
206
        _v = VFFSL(SL,"_",False)("Language:") # '$_("Language:")' on line 61, col 41
 
207
        if _v is not None: write(_filter(_v, rawExpr='$_("Language:")')) # from line 61, col 41.
150
208
        write('''</th>
151
209
    <td style="text-align:right; vertical-align: middle;">
152
210
     <select name="language">
153
211
''')
154
 
        for lang, identifier in VFFSL(SL,"available_languages",True): # generated from line 46, col 1
155
 
            if VFFSL(SL,"user.language",True) == VFFSL(SL,"identifier",True): # generated from line 47, col 1
 
212
        for lang, identifier in VFFSL(SL,"available_languages",True): # generated from line 64, col 1
 
213
            if VFFSL(SL,"user.language",True) == VFFSL(SL,"identifier",True): # generated from line 65, col 1
156
214
                selected = " selected=true"
157
 
            else: # generated from line 49, col 1
 
215
            else: # generated from line 67, col 1
158
216
                selected = ""
159
 
            write('     <option value="')
160
 
            _v = VFFSL(SL,"identifier",True) # '$identifier' on line 52, col 21
161
 
            if _v is not None: write(_filter(_v, rawExpr='$identifier')) # from line 52, col 21.
162
 
            write('"')
163
 
            _v = VFFSL(SL,"selected",True) # '$selected' on line 52, col 33
164
 
            if _v is not None: write(_filter(_v, rawExpr='$selected')) # from line 52, col 33.
165
 
            write('>')
166
 
            _v = VFFSL(SL,"lang",True) # '$lang' on line 52, col 43
167
 
            if _v is not None: write(_filter(_v, rawExpr='$lang')) # from line 52, col 43.
168
 
            write('</option>\n')
 
217
            write('''     <option value="''')
 
218
            _v = VFFSL(SL,"identifier",True) # '$identifier' on line 70, col 21
 
219
            if _v is not None: write(_filter(_v, rawExpr='$identifier')) # from line 70, col 21.
 
220
            write('''"''')
 
221
            _v = VFFSL(SL,"selected",True) # '$selected' on line 70, col 33
 
222
            if _v is not None: write(_filter(_v, rawExpr='$selected')) # from line 70, col 33.
 
223
            write('''>''')
 
224
            _v = VFFSL(SL,"lang",True) # '$lang' on line 70, col 43
 
225
            if _v is not None: write(_filter(_v, rawExpr='$lang')) # from line 70, col 43.
 
226
            write('''</option>
 
227
''')
169
228
        write('''     </select>
170
229
    </td>
171
230
   </tr>
173
232
 
174
233
''')
175
234
        row_classes = ("table_row_even", "table_row_odd")
176
 
        write('\n<tr class="nodash" style="padding:0; margin:0;">\n <th class="nodash">')
 
235
        write('''
 
236
<tr class="nodash" style="padding:0; margin:0;">
 
237
 <th class="nodash">''')
177
238
        if False:
178
239
            _("Permissions:")
179
 
        _v = VFFSL(SL,"_",False)("Permissions:") # '$_("Permissions:")' on line 62, col 21
180
 
        if _v is not None: write(_filter(_v, rawExpr='$_("Permissions:")')) # from line 62, col 21.
 
240
        _v = VFFSL(SL,"_",False)("Permissions:") # '$_("Permissions:")' on line 80, col 21
 
241
        if _v is not None: write(_filter(_v, rawExpr='$_("Permissions:")')) # from line 80, col 21.
181
242
        write('''</th>
182
243
 <td class="nodash"></td>
183
244
</tr>
189
250
''')
190
251
        cnt = 0
191
252
        checked_cnt = 0
192
 
        write('\n')
193
 
        if VFFSL(SL,"can_manage_user",True): # generated from line 73, col 1
 
253
        write('''
 
254
''')
 
255
        if VFFSL(SL,"can_manage_user",True): # generated from line 91, col 1
194
256
            disabled = ""
195
 
        else: # generated from line 75, col 1
 
257
        else: # generated from line 93, col 1
196
258
            disabled = "disabled=\"disabled\""
197
 
        write('\n')
198
 
        for perm, value in VFFSL(SL,"user.permissions",True): # generated from line 79, col 7
199
 
            write('      <tr class="')
200
 
            _v = VFFSL(SL,"row_classes",True)[VFFSL(SL,"cnt",True)%2] # '$row_classes[$cnt%2]' on line 80, col 18
201
 
            if _v is not None: write(_filter(_v, rawExpr='$row_classes[$cnt%2]')) # from line 80, col 18.
202
 
            write('">\n       <td style="text-align: left;">')
203
 
            _v = VFFSL(SL,"perm",True) # '$perm' on line 81, col 38
204
 
            if _v is not None: write(_filter(_v, rawExpr='$perm')) # from line 81, col 38.
205
 
            write('</td>\n       <td style="text-align: right;">\n')
206
 
            if VFFSL(SL,"value",True): # generated from line 83, col 9
 
259
        write('''
 
260
''')
 
261
        for perm, value in VFFSL(SL,"user.permissions",True): # generated from line 97, col 7
 
262
            write('''      <tr class="''')
 
263
            _v = VFFSL(SL,"row_classes",True)[VFFSL(SL,"cnt",True)%2] # '$row_classes[$cnt%2]' on line 98, col 18
 
264
            if _v is not None: write(_filter(_v, rawExpr='$row_classes[$cnt%2]')) # from line 98, col 18.
 
265
            write('''">
 
266
       <td style="text-align: left;">''')
 
267
            _v = VFFSL(SL,"perm",True) # '$perm' on line 99, col 38
 
268
            if _v is not None: write(_filter(_v, rawExpr='$perm')) # from line 99, col 38.
 
269
            write('''</td>
 
270
       <td style="text-align: right;">
 
271
''')
 
272
            if VFFSL(SL,"value",True): # generated from line 101, col 9
207
273
                checked_cnt += 1
208
274
                checked = "checked=\"checked\""
209
 
            else: # generated from line 86, col 9
 
275
            else: # generated from line 104, col 9
210
276
                checked = ""
211
 
            write('        <input class="checkbox" type="checkbox" name="permissions" value="')
212
 
            _v = VFFSL(SL,"perm",True) # '$perm' on line 89, col 75
213
 
            if _v is not None: write(_filter(_v, rawExpr='$perm')) # from line 89, col 75.
214
 
            write('" ')
215
 
            _v = VFFSL(SL,"checked",True) # '$checked' on line 89, col 82
216
 
            if _v is not None: write(_filter(_v, rawExpr='$checked')) # from line 89, col 82.
217
 
            write(' ')
218
 
            _v = VFFSL(SL,"disabled",True) # '$disabled' on line 89, col 91
219
 
            if _v is not None: write(_filter(_v, rawExpr='$disabled')) # from line 89, col 91.
 
277
            write('''        <input class="checkbox" type="checkbox" name="permissions" value="''')
 
278
            _v = VFFSL(SL,"perm",True) # '$perm' on line 107, col 75
 
279
            if _v is not None: write(_filter(_v, rawExpr='$perm')) # from line 107, col 75.
 
280
            write('''" ''')
 
281
            _v = VFFSL(SL,"checked",True) # '$checked' on line 107, col 82
 
282
            if _v is not None: write(_filter(_v, rawExpr='$checked')) # from line 107, col 82.
 
283
            write(''' ''')
 
284
            _v = VFFSL(SL,"disabled",True) # '$disabled' on line 107, col 91
 
285
            if _v is not None: write(_filter(_v, rawExpr='$disabled')) # from line 107, col 91.
220
286
            write(''' />
221
287
       </td>
222
288
      </tr>
226
292
 <td class="nodash">&nbsp;</td>
227
293
 
228
294
''')
229
 
        if VFFSL(SL,"cnt",True) == VFFSL(SL,"checked_cnt",True): # generated from line 97, col 1
 
295
        if VFFSL(SL,"cnt",True) == VFFSL(SL,"checked_cnt",True): # generated from line 115, col 1
230
296
            checked = "checked=\"checked\""
231
 
        else: # generated from line 99, col 1
 
297
        else: # generated from line 117, col 1
232
298
            checked = ""
233
 
        write('\n <td class="nodash"style="text-align: right;"><b>')
 
299
        write('''
 
300
 <td class="nodash"style="text-align: right;"><b>''')
234
301
        if False:
235
302
            _("Check All")
236
 
        _v = VFFSL(SL,"_",False)("Check All") # '$_("Check All")' on line 103, col 50
237
 
        if _v is not None: write(_filter(_v, rawExpr='$_("Check All")')) # from line 103, col 50.
238
 
        write('</b>\n  <input ')
239
 
        _v = VFFSL(SL,"checked",True) # '$checked' on line 104, col 10
240
 
        if _v is not None: write(_filter(_v, rawExpr='$checked')) # from line 104, col 10.
241
 
        write(' ')
242
 
        _v = VFFSL(SL,"disabled",True) # '$disabled' on line 104, col 19
243
 
        if _v is not None: write(_filter(_v, rawExpr='$disabled')) # from line 104, col 19.
244
 
        write(''' class="checkbox" type="checkbox" id="allbox" onclick="checkBoxByName('permissions', document.forms[0].allbox.checked);"/>
 
303
        _v = VFFSL(SL,"_",False)("Check All") # '$_("Check All")' on line 121, col 50
 
304
        if _v is not None: write(_filter(_v, rawExpr='$_("Check All")')) # from line 121, col 50.
 
305
        write('''</b>
 
306
  <input ''')
 
307
        _v = VFFSL(SL,"checked",True) # '$checked' on line 122, col 10
 
308
        if _v is not None: write(_filter(_v, rawExpr='$checked')) # from line 122, col 10.
 
309
        write(''' ''')
 
310
        _v = VFFSL(SL,"disabled",True) # '$disabled' on line 122, col 19
 
311
        if _v is not None: write(_filter(_v, rawExpr='$disabled')) # from line 122, col 19.
 
312
        write(''' class="checkbox" type="checkbox" id="allbox"/>
245
313
 </td>
246
314
</tr>
247
315
 
253
321
<br/>
254
322
 
255
323
''')
256
 
        if VFFSL(SL,"can_change_password",True): # generated from line 115, col 1
257
 
            write('<fieldset>\n  <legend>')
 
324
        if VFFSL(SL,"can_change_password",True): # generated from line 133, col 1
 
325
            write('''<fieldset>
 
326
  <legend>''')
258
327
            if False:
259
328
                _("Change password")
260
 
            _v = VFFSL(SL,"_",False)("Change password") # '$_("Change password")' on line 117, col 11
261
 
            if _v is not None: write(_filter(_v, rawExpr='$_("Change password")')) # from line 117, col 11.
262
 
            write('</legend>\n  <table>\n')
263
 
            if VFFSL(SL,"ask_current_password",True): # generated from line 119, col 5
264
 
                write('    <tr>\n      <th>')
 
329
            _v = VFFSL(SL,"_",False)("Change password") # '$_("Change password")' on line 135, col 11
 
330
            if _v is not None: write(_filter(_v, rawExpr='$_("Change password")')) # from line 135, col 11.
 
331
            write('''</legend>
 
332
  <table>
 
333
''')
 
334
            if VFFSL(SL,"ask_current_password",True): # generated from line 137, col 5
 
335
                write('''    <tr>
 
336
      <th>''')
265
337
                if False:
266
338
                    _("Current password:")
267
 
                _v = VFFSL(SL,"_",False)("Current password:") # '$_("Current password:")' on line 121, col 11
268
 
                if _v is not None: write(_filter(_v, rawExpr='$_("Current password:")')) # from line 121, col 11.
 
339
                _v = VFFSL(SL,"_",False)("Current password:") # '$_("Current password:")' on line 139, col 11
 
340
                if _v is not None: write(_filter(_v, rawExpr='$_("Current password:")')) # from line 139, col 11.
269
341
                write('''</th>
270
342
      <td><input type="password" name="password_current"/></td>
271
343
    </tr>
272
344
''')
273
 
            write('    <tr>\n      <th>')
 
345
            write('''    <tr>
 
346
      <th>''')
274
347
            if False:
275
348
                _("New password:")
276
 
            _v = VFFSL(SL,"_",False)("New password:") # '$_("New password:")' on line 126, col 11
277
 
            if _v is not None: write(_filter(_v, rawExpr='$_("New password:")')) # from line 126, col 11.
 
349
            _v = VFFSL(SL,"_",False)("New password:") # '$_("New password:")' on line 144, col 11
 
350
            if _v is not None: write(_filter(_v, rawExpr='$_("New password:")')) # from line 144, col 11.
278
351
            write('''</th>
279
352
      <td><input type="password" name="password_new"/></td>
280
353
    </tr>
282
355
      <th>''')
283
356
            if False:
284
357
                _("Confirm new password:")
285
 
            _v = VFFSL(SL,"_",False)("Confirm new password:") # '$_("Confirm new password:")' on line 130, col 11
286
 
            if _v is not None: write(_filter(_v, rawExpr='$_("Confirm new password:")')) # from line 130, col 11.
 
358
            _v = VFFSL(SL,"_",False)("Confirm new password:") # '$_("Confirm new password:")' on line 148, col 11
 
359
            if _v is not None: write(_filter(_v, rawExpr='$_("Confirm new password:")')) # from line 148, col 11.
287
360
            write('''</th>
288
361
      <td><input type="password" name="password_new_confirmation"/></td>
289
362
    </tr>
291
364
</fieldset>
292
365
<br/>
293
366
''')
294
 
        write('\n<input type="submit" value="')
 
367
        write('''
 
368
<input type="submit" value="''')
295
369
        if False:
296
370
            _("Submit Changes")
297
 
        _v = VFFSL(SL,"_",False)("Submit Changes") # '$_("Submit Changes")' on line 138, col 29
298
 
        if _v is not None: write(_filter(_v, rawExpr='$_("Submit Changes")')) # from line 138, col 29.
 
371
        _v = VFFSL(SL,"_",False)("Submit Changes") # '$_("Submit Changes")' on line 156, col 29
 
372
        if _v is not None: write(_filter(_v, rawExpr='$_("Submit Changes")')) # from line 156, col 29.
299
373
        write('''"/>
300
374
 
301
375
</form>
302
376
</div>
303
377
 
304
378
''')
305
 
        _filter = _orig_filter_33063197
 
379
        _filter = self._CHEETAH__currentFilter = _orig_filter_61592990
306
380
        
307
381
        ########################################
308
382
        ## END - generated method body
329
403
        ########################################
330
404
        ## START - generated method body
331
405
        
332
 
        write('\n')
 
406
        write('''
 
407
 
 
408
''')
333
409
        self.main_content(trans=trans)
334
410
        
335
411
        ########################################