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

« back to all changes in this revision

Viewing changes to www/dispatch/html.py

  • Committer: drtomc
  • Date: 2008-02-04 23:18:34 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:405
Version 0 of the file manipulation tools to allow us to get the permissions right.

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
        req.write('  <link rel="stylesheet" type="text/css" href="%s" />\n'
74
74
            % cgi.escape(util.make_path(style)))
75
75
    for script in req.scripts:
76
 
        req.write('  <script type="text/javascript" src="%s"></script>\n'
 
76
        req.write('  <script type="text/javascript" src="%s" />\n'
77
77
            % cgi.escape(util.make_path(script)))
78
78
 
79
79
    req.write("</head>\n\n")
110
110
            "app from conf.apps.app_url when placed into production."
111
111
            "</small></p>\n")
112
112
 
113
 
    # If req has a "no_agreement" attribute, then it is because the user has
114
 
    # not signed the agreement; therefore we are displaying the TOS page.
115
 
    # Do not show apps (see dispatch.login).
116
 
    if req.username and not hasattr(req, 'no_agreement'):
 
113
    if req.username:
117
114
        # Only print app tabs if logged in
118
115
        print_apps_list(req, req.app)
119
116
    req.write('</div>\n<div id="ivlebody">\n')
128
125
def get_help_url(req):
129
126
    """Gets the help URL most relevant to this page, to place as the
130
127
    "help" link at the top of the page."""
131
 
    reqapp = req.app if hasattr(req, 'app') else None
132
 
    if reqapp == 'help':
 
128
    if req.app == 'help':
133
129
        # We're already in help. Link to the exact current page
134
130
        # instead of the generic help page.
135
131
        return req.uri
136
 
    if reqapp is not None and conf.apps.app_url[reqapp].hashelp:
137
 
        help_path = os.path.join('help', reqapp)
 
132
    if conf.apps.app_url[req.app].hashelp:
 
133
        help_path = os.path.join('help', req.app)
138
134
    else:
139
135
        help_path = 'help'
140
136
    return util.make_path(help_path)