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

« back to all changes in this revision

Viewing changes to www/dispatch/html.py

  • Committer: mattgiuca
  • Date: 2008-06-23 09:59:52 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:786
fileservice_lib/action.py: Fixed SVN error messages. No longer just give a
    simple "x failed" - now echo the full error message generated by SVN.
    (Not a security risk since we're in the jail).

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
# Does not include the login page. See login.py.
25
25
 
26
26
import cgi
 
27
import urllib
27
28
import os.path
28
29
 
29
30
import conf
58
59
        username = "null"
59
60
    req.write("""  <script type="text/javascript">
60
61
    root_dir = %s;
 
62
    public_host = %s;
61
63
    username = %s;
62
64
  </script>
63
 
""" % (repr(conf.root_dir), username))
 
65
""" % (repr(conf.root_dir), repr(conf.public_host), username))
64
66
    iconurl = get_icon_url(req.app, small=True)
65
67
    if iconurl:
66
68
        req.write("""  <link rel="shortcut icon" href="%s" />
89
91
    if req.user:
90
92
        # Get the user's nickname from the request session
91
93
        nickname = req.user.nick
92
 
        req.write('  <p class="userhello">%s (<span '
93
 
            'class="username">%s</span>) |\n'
 
94
        req.write('  <p class="userhello"><span id="usernick">%s</span> '
 
95
            '(<span class="username">%s</span>) |\n'
94
96
            '    <a href="%s">Settings</a> |\n'
95
97
            '    <a href="%s">Help</a> |\n'
96
98
            '    <a href="%s">Sign out</a>\n'
108
110
    # If the "debuginfo" app is installed, display a warning to the admin to
109
111
    # make sure it is removed in production.
110
112
    if "debuginfo" in conf.apps.app_url:
111
 
        req.write("  <p><small>Warning: debuginfo is enabled. Remove this "
112
 
            "app from conf.apps.app_url when placed into production."
113
 
            "</small></p>\n")
 
113
        req.write("  <p><small>Warning: debuginfo is enabled. Set "
 
114
            "enable_debuginfo = False in lib/conf/apps.py, when placing IVLE "
 
115
            "into production.</small></p>\n")
114
116
 
115
117
    # If req has a "no_agreement" attribute, then it is because the user has
116
118
    # not signed the agreement; therefore we are displaying the TOS page.
175
177
        file.write('    <li%s>' % li_attr)
176
178
        if app.icon:
177
179
            file.write('<img src="%s" alt="" /> '
178
 
                % cgi.escape(get_icon_url(urlname)))
179
 
        file.write('<a href="%s">%s</a></li>\n'
180
 
            % (cgi.escape(util.make_path(urlname)), cgi.escape(app.name)))
 
180
                % urllib.quote(get_icon_url(urlname)))
 
181
        file.write('<a href="%s" title="%s">%s</a></li>\n'
 
182
            % (urllib.quote(util.make_path(urlname)), cgi.escape(app.desc),
 
183
                cgi.escape(app.name)))
181
184
 
182
185
    file.write('  </ul>\n')