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

« back to all changes in this revision

Viewing changes to ivle/dispatch/html.py

Remove the old framework's tab-printing ability.

This lets us clean up ivle.conf.apps a lot, so do it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
123
123
            "enable_debuginfo = False in ivle/conf/apps.py, when placing IVLE "
124
124
            "into production.</small></p>\n")
125
125
 
126
 
    # If req has a "no_agreement" attribute, then it is because the user has
127
 
    # not signed the agreement; therefore we are displaying the TOS page.
128
 
    # Do not show apps (see dispatch.login).
129
 
    if req.user and not req.user.state == 'no_agreement':
130
 
        # Only print app tabs if logged in
131
 
        print_apps_list(req, req.app)
132
126
    req.write('</div>\n<div id="ivlebody">\n')
133
127
 
134
128
def write_html_foot(req):
168
162
        icon_dir = ivle.conf.apps.app_icon_dir
169
163
    if app.icon is None: return None
170
164
    return util.make_path(os.path.join(icon_dir, app.icon))
171
 
 
172
 
def print_apps_list(file, thisapp):
173
 
    """Prints all app tabs, as a UL. Prints a list item for each app that has
174
 
    a tab.
175
 
 
176
 
    file: Object with a "write" method - ie. the request object.
177
 
    Reads from: ivle.conf
178
 
    """
179
 
    file.write('  <ul id="apptabs">\n')
180
 
 
181
 
    for urlname in ivle.conf.apps.apps_in_tabs:
182
 
        app = ivle.conf.apps.app_url[urlname]
183
 
        if urlname == thisapp:
184
 
            li_attr = ' class="thisapp"'
185
 
        else:
186
 
            li_attr = ''
187
 
        file.write('    <li%s>' % li_attr)
188
 
        if app.icon:
189
 
            file.write('<img src="%s" alt="" /> '
190
 
                % urllib.quote(get_icon_url(urlname)))
191
 
        file.write('<a href="%s" title="%s">%s</a></li>\n'
192
 
            % (urllib.quote(util.make_path(urlname)), cgi.escape(app.desc),
193
 
                cgi.escape(app.name)))
194
 
 
195
 
    file.write('  </ul>\n')