~ubuntu-branches/ubuntu/oneiric/prewikka/oneiric

« back to all changes in this revision

Viewing changes to prewikka/templates/UserSettings.py

  • Committer: Bazaar Package Importer
  • Author(s): Alessio Treglia
  • Date: 2009-07-06 08:39:07 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20090706083907-59qlpova8dvyvm8a
Tags: 0.9.16-1ubuntu1
* Merge from debian unstable, Ubuntu remaining changes:
  - Append --install-layout=deb to setup.py install arguments.
* debian/control:
  - Bump python-all-dev, python-central, debhelper build dependencies as
    per Debian Python New Policy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
import sys
9
9
import os
10
10
import os.path
 
11
import __builtin__
11
12
from os.path import getmtime, exists
12
13
import time
13
14
import types
14
 
import __builtin__
15
15
from Cheetah.Version import MinCompatibleVersion as RequiredCheetahVersion
16
16
from Cheetah.Version import MinCompatibleVersionTuple as RequiredCheetahVersionTuple
17
17
from Cheetah.Template import Template
18
 
from Cheetah.DummyTransaction import DummyTransaction
 
18
from Cheetah.DummyTransaction import *
19
19
from Cheetah.NameMapper import NotFound, valueForName, valueFromSearchList, valueFromFrameOrSearchList
20
20
from Cheetah.CacheRegion import CacheRegion
21
21
import Cheetah.Filters as Filters
24
24
 
25
25
##################################################
26
26
## MODULE CONSTANTS
27
 
try:
28
 
    True, False
29
 
except NameError:
30
 
    True, False = (1==1), (1==0)
31
27
VFFSL=valueFromFrameOrSearchList
32
28
VFSL=valueFromSearchList
33
29
VFN=valueForName
34
30
currentTime=time.time
35
 
__CHEETAH_version__ = '2.0.1'
36
 
__CHEETAH_versionTuple__ = (2, 0, 1, 'final', 0)
37
 
__CHEETAH_genTime__ = 1244966471.226032
38
 
__CHEETAH_genTimestamp__ = 'Sun Jun 14 10:01:11 2009'
 
31
__CHEETAH_version__ = '2.2.1'
 
32
__CHEETAH_versionTuple__ = (2, 2, 1, 'final', 0)
 
33
__CHEETAH_genTime__ = 1244715457.6474349
 
34
__CHEETAH_genTimestamp__ = 'Thu Jun 11 12:17:37 2009'
39
35
__CHEETAH_src__ = 'prewikka/templates/UserSettings.tmpl'
40
36
__CHEETAH_srcLastModified__ = 'Wed Jun 10 11:40:28 2009'
41
 
__CHEETAH_docstring__ = 'Autogenerated by CHEETAH: The Python-Powered Template Engine'
 
37
__CHEETAH_docstring__ = 'Autogenerated by Cheetah: The Python-Powered Template Engine'
42
38
 
43
39
if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple:
44
40
    raise AssertionError(
57
53
 
58
54
    def __init__(self, *args, **KWs):
59
55
 
60
 
        ClassicLayout.__init__(self, *args, **KWs)
 
56
        super(UserSettings, self).__init__(*args, **KWs)
61
57
        if not self._CHEETAH__instanceInitialized:
62
58
            cheetahKWArgs = {}
63
59
            allowedKWs = 'searchList namespaces filter filtersLib errorCatcher'.split()
85
81
        ########################################
86
82
        ## START - generated method body
87
83
        
88
 
        write('''
 
84
        write(u'''
89
85
<script type="text/javascript">
90
86
 
91
87
<!--
124
120
        ########################################
125
121
        ## START - generated method body
126
122
        
127
 
        _orig_filter_19157899 = _filter
128
 
        filterName = 'CleanOutput'
 
123
        _orig_filter_52673673 = _filter
 
124
        filterName = u'CleanOutput'
129
125
        if self._CHEETAH__filters.has_key("CleanOutput"):
130
126
            _filter = self._CHEETAH__currentFilter = self._CHEETAH__filters[filterName]
131
127
        else:
132
128
            _filter = self._CHEETAH__currentFilter = \
133
129
                        self._CHEETAH__filters[filterName] = getattr(self._CHEETAH__filtersLib, filterName)(self).filter
134
 
        write('''
 
130
        write(u'''
135
131
<div id="fieldset_page" style="width: 430px;">
136
132
 
137
133
<form id="usersettings" action="?" method="post">
138
134
''')
139
135
        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('''"/>
 
136
            write(u'''<input type="hidden" name="login" value="''')
 
137
            _v = VFFSL(SL,"user.login",True) # u'$user.login' on line 25, col 42
 
138
            if _v is not None: write(_filter(_v, rawExpr=u'$user.login')) # from line 25, col 42.
 
139
            write(u'''"/>
144
140
<input type="hidden" name="view" value="user_settings_modify"/>
145
141
''')
146
142
        else: # generated from line 27, col 1
147
 
            write('''<input type="hidden" name="view" value="user_settings_add"/>
 
143
            write(u'''<input type="hidden" name="view" value="user_settings_add"/>
148
144
''')
149
 
        write('''
 
145
        write(u'''
150
146
''')
151
147
        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('''" />
 
148
            write(u'''<input type="hidden" name="origin" value="''')
 
149
            _v = VFFSL(SL,"user.origin",True) # u'$user.origin' on line 32, col 43
 
150
            if _v is not None: write(_filter(_v, rawExpr=u'$user.origin')) # from line 32, col 43.
 
151
            write(u'''" />
156
152
''')
157
 
        write('''
 
153
        write(u'''
158
154
<fieldset class="fieldset_heading">
159
155
 <legend>''')
160
156
        if False:
161
157
            _("Account information")
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.
164
 
        write('''</legend>
 
158
        _v = VFFSL(SL,"_",False)("Account information") # u'$_("Account information")' on line 36, col 10
 
159
        if _v is not None: write(_filter(_v, rawExpr=u'$_("Account information")')) # from line 36, col 10.
 
160
        write(u'''</legend>
165
161
 
166
162
  <table>
167
163
''')
168
164
        if VFFSL(SL,"user.login",True): # generated from line 39, col 1
169
 
            write('''   <tr>
 
165
            write(u'''   <tr>
170
166
    <th style="vertical-align: middle;">''')
171
167
            if False:
172
168
                _("Login:")
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>
 
169
            _v = VFFSL(SL,"_",False)("Login:") # u'$_("Login:")' on line 41, col 41
 
170
            if _v is not None: write(_filter(_v, rawExpr=u'$_("Login:")')) # from line 41, col 41.
 
171
            write(u'''</th>
176
172
    <td style="text-align:right; vertical-align: middle;">
177
173
     <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.
180
 
            write('''</b></h2>
 
174
            _v = VFFSL(SL,"user.login",True) # u'$user.login' on line 43, col 70
 
175
            if _v is not None: write(_filter(_v, rawExpr=u'$user.login')) # from line 43, col 70.
 
176
            write(u'''</b></h2>
181
177
    </td>
182
178
   </tr>
183
179
''')
184
180
        else: # generated from line 46, col 1
185
 
            write('''
 
181
            write(u'''
186
182
''')
187
183
            if VFFSL(SL,"errmsg",True): # generated from line 48, col 4
188
 
                write('''   <tr>
 
184
                write(u'''   <tr>
189
185
\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>
 
186
                _v = VFFSL(SL,"errmsg",True) # u'$errmsg' on line 50, col 42
 
187
                if _v is not None: write(_filter(_v, rawExpr=u'$errmsg')) # from line 50, col 42.
 
188
                write(u'''</font></td>
193
189
   </tr>
194
190
''')
195
 
            write('''
 
191
            write(u'''
196
192
   <tr>
197
193
    <th>Login:</th>
198
194
    <td style="text-align: right;"><input type="text" name="login"/></td>
199
195
   </tr>
200
196
''')
201
 
        write('''
 
197
        write(u'''
202
198
   <tr>
203
199
    <th style="vertical-align: middle;">''')
204
200
        if False:
205
201
            _("Language:")
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.
208
 
        write('''</th>
 
202
        _v = VFFSL(SL,"_",False)("Language:") # u'$_("Language:")' on line 61, col 41
 
203
        if _v is not None: write(_filter(_v, rawExpr=u'$_("Language:")')) # from line 61, col 41.
 
204
        write(u'''</th>
209
205
    <td style="text-align:right; vertical-align: middle;">
210
206
     <select name="language">
211
207
''')
214
210
                selected = " selected=true"
215
211
            else: # generated from line 67, col 1
216
212
                selected = ""
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>
 
213
            write(u'''     <option value="''')
 
214
            _v = VFFSL(SL,"identifier",True) # u'$identifier' on line 70, col 21
 
215
            if _v is not None: write(_filter(_v, rawExpr=u'$identifier')) # from line 70, col 21.
 
216
            write(u'''"''')
 
217
            _v = VFFSL(SL,"selected",True) # u'$selected' on line 70, col 33
 
218
            if _v is not None: write(_filter(_v, rawExpr=u'$selected')) # from line 70, col 33.
 
219
            write(u'''>''')
 
220
            _v = VFFSL(SL,"lang",True) # u'$lang' on line 70, col 43
 
221
            if _v is not None: write(_filter(_v, rawExpr=u'$lang')) # from line 70, col 43.
 
222
            write(u'''</option>
227
223
''')
228
 
        write('''     </select>
 
224
        write(u'''     </select>
229
225
    </td>
230
226
   </tr>
231
227
   
232
228
 
233
229
''')
234
230
        row_classes = ("table_row_even", "table_row_odd")
235
 
        write('''
 
231
        write(u'''
236
232
<tr class="nodash" style="padding:0; margin:0;">
237
233
 <th class="nodash">''')
238
234
        if False:
239
235
            _("Permissions:")
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.
242
 
        write('''</th>
 
236
        _v = VFFSL(SL,"_",False)("Permissions:") # u'$_("Permissions:")' on line 80, col 21
 
237
        if _v is not None: write(_filter(_v, rawExpr=u'$_("Permissions:")')) # from line 80, col 21.
 
238
        write(u'''</th>
243
239
 <td class="nodash"></td>
244
240
</tr>
245
241
 
250
246
''')
251
247
        cnt = 0
252
248
        checked_cnt = 0
253
 
        write('''
 
249
        write(u'''
254
250
''')
255
251
        if VFFSL(SL,"can_manage_user",True): # generated from line 91, col 1
256
252
            disabled = ""
257
253
        else: # generated from line 93, col 1
258
254
            disabled = "disabled=\"disabled\""
259
 
        write('''
 
255
        write(u'''
260
256
''')
261
257
        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('''">
 
258
            write(u'''      <tr class="''')
 
259
            _v = VFFSL(SL,"row_classes",True)[VFFSL(SL,"cnt",True)%2] # u'$row_classes[$cnt%2]' on line 98, col 18
 
260
            if _v is not None: write(_filter(_v, rawExpr=u'$row_classes[$cnt%2]')) # from line 98, col 18.
 
261
            write(u'''">
266
262
       <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>
 
263
            _v = VFFSL(SL,"perm",True) # u'$perm' on line 99, col 38
 
264
            if _v is not None: write(_filter(_v, rawExpr=u'$perm')) # from line 99, col 38.
 
265
            write(u'''</td>
270
266
       <td style="text-align: right;">
271
267
''')
272
268
            if VFFSL(SL,"value",True): # generated from line 101, col 9
274
270
                checked = "checked=\"checked\""
275
271
            else: # generated from line 104, col 9
276
272
                checked = ""
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.
286
 
            write(''' />
 
273
            write(u'''        <input class="checkbox" type="checkbox" name="permissions" value="''')
 
274
            _v = VFFSL(SL,"perm",True) # u'$perm' on line 107, col 75
 
275
            if _v is not None: write(_filter(_v, rawExpr=u'$perm')) # from line 107, col 75.
 
276
            write(u'''" ''')
 
277
            _v = VFFSL(SL,"checked",True) # u'$checked' on line 107, col 82
 
278
            if _v is not None: write(_filter(_v, rawExpr=u'$checked')) # from line 107, col 82.
 
279
            write(u''' ''')
 
280
            _v = VFFSL(SL,"disabled",True) # u'$disabled' on line 107, col 91
 
281
            if _v is not None: write(_filter(_v, rawExpr=u'$disabled')) # from line 107, col 91.
 
282
            write(u''' />
287
283
       </td>
288
284
      </tr>
289
285
''')
290
286
            cnt += 1
291
 
        write('''<tr class="nodash">
 
287
        write(u'''<tr class="nodash">
292
288
 <td class="nodash">&nbsp;</td>
293
289
 
294
290
''')
296
292
            checked = "checked=\"checked\""
297
293
        else: # generated from line 117, col 1
298
294
            checked = ""
299
 
        write('''
 
295
        write(u'''
300
296
 <td class="nodash"style="text-align: right;"><b>''')
301
297
        if False:
302
298
            _("Check All")
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>
 
299
        _v = VFFSL(SL,"_",False)("Check All") # u'$_("Check All")' on line 121, col 50
 
300
        if _v is not None: write(_filter(_v, rawExpr=u'$_("Check All")')) # from line 121, col 50.
 
301
        write(u'''</b>
306
302
  <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"/>
 
303
        _v = VFFSL(SL,"checked",True) # u'$checked' on line 122, col 10
 
304
        if _v is not None: write(_filter(_v, rawExpr=u'$checked')) # from line 122, col 10.
 
305
        write(u''' ''')
 
306
        _v = VFFSL(SL,"disabled",True) # u'$disabled' on line 122, col 19
 
307
        if _v is not None: write(_filter(_v, rawExpr=u'$disabled')) # from line 122, col 19.
 
308
        write(u''' class="checkbox" type="checkbox" id="allbox"/>
313
309
 </td>
314
310
</tr>
315
311
 
322
318
 
323
319
''')
324
320
        if VFFSL(SL,"can_change_password",True): # generated from line 133, col 1
325
 
            write('''<fieldset>
 
321
            write(u'''<fieldset>
326
322
  <legend>''')
327
323
            if False:
328
324
                _("Change password")
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>
 
325
            _v = VFFSL(SL,"_",False)("Change password") # u'$_("Change password")' on line 135, col 11
 
326
            if _v is not None: write(_filter(_v, rawExpr=u'$_("Change password")')) # from line 135, col 11.
 
327
            write(u'''</legend>
332
328
  <table>
333
329
''')
334
330
            if VFFSL(SL,"ask_current_password",True): # generated from line 137, col 5
335
 
                write('''    <tr>
 
331
                write(u'''    <tr>
336
332
      <th>''')
337
333
                if False:
338
334
                    _("Current password:")
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.
341
 
                write('''</th>
 
335
                _v = VFFSL(SL,"_",False)("Current password:") # u'$_("Current password:")' on line 139, col 11
 
336
                if _v is not None: write(_filter(_v, rawExpr=u'$_("Current password:")')) # from line 139, col 11.
 
337
                write(u'''</th>
342
338
      <td><input type="password" name="password_current"/></td>
343
339
    </tr>
344
340
''')
345
 
            write('''    <tr>
 
341
            write(u'''    <tr>
346
342
      <th>''')
347
343
            if False:
348
344
                _("New password:")
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.
351
 
            write('''</th>
 
345
            _v = VFFSL(SL,"_",False)("New password:") # u'$_("New password:")' on line 144, col 11
 
346
            if _v is not None: write(_filter(_v, rawExpr=u'$_("New password:")')) # from line 144, col 11.
 
347
            write(u'''</th>
352
348
      <td><input type="password" name="password_new"/></td>
353
349
    </tr>
354
350
    <tr>
355
351
      <th>''')
356
352
            if False:
357
353
                _("Confirm new password:")
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.
360
 
            write('''</th>
 
354
            _v = VFFSL(SL,"_",False)("Confirm new password:") # u'$_("Confirm new password:")' on line 148, col 11
 
355
            if _v is not None: write(_filter(_v, rawExpr=u'$_("Confirm new password:")')) # from line 148, col 11.
 
356
            write(u'''</th>
361
357
      <td><input type="password" name="password_new_confirmation"/></td>
362
358
    </tr>
363
359
  </table>
364
360
</fieldset>
365
361
<br/>
366
362
''')
367
 
        write('''
 
363
        write(u'''
368
364
<input type="submit" value="''')
369
365
        if False:
370
366
            _("Submit Changes")
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.
373
 
        write('''"/>
 
367
        _v = VFFSL(SL,"_",False)("Submit Changes") # u'$_("Submit Changes")' on line 156, col 29
 
368
        if _v is not None: write(_filter(_v, rawExpr=u'$_("Submit Changes")')) # from line 156, col 29.
 
369
        write(u'''"/>
374
370
 
375
371
</form>
376
372
</div>
377
373
 
378
374
''')
379
 
        _filter = self._CHEETAH__currentFilter = _orig_filter_19157899
 
375
        _filter = self._CHEETAH__currentFilter = _orig_filter_52673673
380
376
        
381
377
        ########################################
382
378
        ## END - generated method body
403
399
        ########################################
404
400
        ## START - generated method body
405
401
        
406
 
        write('''
 
402
        write(u'''
407
403
 
408
404
''')
409
405
        self.main_content(trans=trans)