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

« back to all changes in this revision

Viewing changes to www/dispatch/html.py

  • Committer: mattgiuca
  • Date: 2008-01-12 12:41:39 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:196
Added application icons, displayed in the tabs at the top of the IVLE page.
conf.apps: Added a new optional property "icon" to the App class.
    All the apps with tabs now have an icon set.
Added directory: media/images/apps, containing PNG icons (from Nuvola) for
    each of the 5 apps.
dispatch.html: Reads the icon property and writes <img> tags into the tabs,
    displaying the icons.

On a personal note, this looks really awesome! It was a complete accident that
the icons pop up out of the top of the tabs, but I love the look of it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
129
129
            li_attr = ' class="thisapp"'
130
130
        else:
131
131
            li_attr = ''
132
 
        file.write('    <li%s><a href="%s">%s</a></li>\n'
133
 
            % (li_attr, util.make_path(urlname), app.name))
 
132
        file.write('    <li%s>' % li_attr)
 
133
        if app.icon:
 
134
            file.write('<img src="%s" alt="" /> ' %
 
135
                util.make_path(os.path.join(conf.apps.app_icon_dir,
 
136
                app.icon)))
 
137
        file.write('<a href="%s">%s</a></li>\n'
 
138
            % (util.make_path(urlname), app.name))
134
139
 
135
140
    file.write('  </ul>\n')