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

« back to all changes in this revision

Viewing changes to www/conf/apps.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:
5
5
# plugged in.
6
6
 
7
7
# Allow App objects
 
8
# Note: icon is a string of a file basename. The icon files are found in
 
9
# app_icon_dir, defined below.
8
10
class App:
9
 
    def __init__(self, dir, name, requireauth = True, hashelp = False):
 
11
    def __init__(self, dir, name, icon = None, requireauth = True,
 
12
        hashelp = False):
10
13
        self.dir = dir
11
14
        self.name = name
 
15
        self.icon = icon
12
16
        self.requireauth = requireauth
13
17
        self.hashelp = hashelp
14
18
    def __repr__(self):
15
19
        return ("App(dir=" + repr(self.dir) + ", name=" + repr(self.name) +
 
20
            ", icon=" + repr(self.icon) +
16
21
            ", requireauth=" + repr(self.requireauth) + ", hashelp="
17
22
            + repr(self.hashelp) + ")")
18
23
 
 
24
# Directory where app icons are stored, relative to the IVLE root.
 
25
app_icon_dir = "media/images/apps"
 
26
 
19
27
# Which application to load by default (if the user navigates to the top level
20
28
# of the site). This is the app's URL name.
21
29
# Note that if this app requires authentication, the user will first be
26
34
 
27
35
app_browser =   App(dir = "browser",
28
36
                    name = "File Browser",
 
37
                    icon = "browser.png",
29
38
                    requireauth = True,
30
39
                    hashelp = True)
31
40
 
32
41
app_editor =   App(dir = "editor",
33
42
                    name = "Text Editor",
 
43
                    icon = "editor.png",
34
44
                    requireauth = True,
35
45
                    hashelp = True)
36
46
 
41
51
 
42
52
app_console =     App(dir = "console",
43
53
                    name = "Console",
 
54
                    icon = "console.png",
44
55
                    requireauth = True,
45
56
                    hashelp = True)
46
57
 
47
58
app_tutorial =     App(dir = "tutorial",
48
59
                    name = "Tutorial",
 
60
                    icon = "tutorial.png",
49
61
                    requireauth = True,
50
62
                    hashelp = True)
51
63
 
61
73
 
62
74
app_help =      App(dir = "help",
63
75
                    name = "Help",
 
76
                    icon = "help.png",
64
77
                    requireauth = True,
65
78
                    hashelp = False)
66
79