~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to www/apps/settings/__init__.py

  • Committer: chadnickbok
  • Date: 2009-02-02 04:00:25 UTC
  • Revision ID: svn-v4:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:1189
Adding the changes from my genshi branch into trunk.

Most apps now use the Genshi templating engine, in preparation
for future changes to dispatch

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 
25
25
from ivle import util
26
26
 
 
27
import genshi
 
28
import genshi.template
 
29
 
27
30
def handle(req):
28
31
    """Handler for the Settings application."""
29
32
 
44
47
    ]
45
48
    req.write_html_head_foot = True     # Have dispatch print head and foot
46
49
 
47
 
    # Start writing data
48
 
    req.write("""<div id="ivle_padding">
49
 
 
50
 
  <h2>User Profile</h2>
51
 
  <p><span id="login"></span></p>
52
 
  <p id="role"></p>
53
 
  <h3>Change settings</h3>
54
 
  <form action="">
55
 
    <table>
56
 
      <tr><td>Display name:</td><td><input type="text"
57
 
            name="nick" id="nick" size="40" /></td></tr>
58
 
      <tr><td>Email address:</td><td><input type="text"
59
 
            name="email" id="email" size="40" /></td></tr>
60
 
    </table>
61
 
    <div id="changepassword"></div>
62
 
    <p id="result"></p>
63
 
    <p>
64
 
      <input value="Save" onclick="return save_settings()" id="save"
65
 
          type="submit" />
66
 
      <input value="Revert" onclick="return revert_settings()" id="revert"
67
 
          type="reset" />
68
 
    </p>
69
 
  </form>
70
 
 
71
 
  <div id="notices"></div>
72
 
</div>
73
 
""")
 
50
    loader = genshi.template.TemplateLoader(".", auto_reload=True)
 
51
    tmpl = loader.load(util.make_local_path("apps/settings/template.html"))
 
52
    req.write(tmpl.generate().render('html')) #'xhtml', doctype='xhtml'))