~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:
 
1
# IVLE Configuration File
 
2
# conf/apps.py
 
3
# Configuration of plugin applications for IVLE
 
4
# These should not need to be modified by admins unless new applications are
 
5
# plugged in.
 
6
 
 
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.
 
10
class App:
 
11
    def __init__(self, dir, name, icon = None, requireauth = True,
 
12
        hashelp = False):
 
13
        self.dir = dir
 
14
        self.name = name
 
15
        self.icon = icon
 
16
        self.requireauth = requireauth
 
17
        self.hashelp = hashelp
 
18
    def __repr__(self):
 
19
        return ("App(dir=" + repr(self.dir) + ", name=" + repr(self.name) +
 
20
            ", icon=" + repr(self.icon) +
 
21
            ", requireauth=" + repr(self.requireauth) + ", hashelp="
 
22
            + repr(self.hashelp) + ")")
 
23
 
 
24
# Directory where app icons are stored, relative to the IVLE root.
 
25
app_icon_dir = "media/images/apps"
 
26
 
 
27
# Which application to load by default (if the user navigates to the top level
 
28
# of the site). This is the app's URL name.
 
29
# Note that if this app requires authentication, the user will first be
 
30
# presented with the login screen.
 
31
default_app = "files"
 
32
 
 
33
# Application definitions
 
34
 
 
35
app_browser =   App(dir = "browser",
 
36
                    name = "File Browser",
 
37
                    icon = "browser.png",
 
38
                    requireauth = True,
 
39
                    hashelp = True)
 
40
 
 
41
app_editor =   App(dir = "editor",
 
42
                    name = "Text Editor",
 
43
                    icon = "editor.png",
 
44
                    requireauth = True,
 
45
                    hashelp = True)
 
46
 
 
47
app_fileservice = App(dir = "fileservice",
 
48
                    name = "File Service (AJAX server)",
 
49
                    requireauth = True,
 
50
                    hashelp = False)
 
51
 
 
52
app_console =     App(dir = "console",
 
53
                    name = "Console",
 
54
                    icon = "console.png",
 
55
                    requireauth = True,
 
56
                    hashelp = True)
 
57
 
 
58
app_tutorial =     App(dir = "tutorial",
 
59
                    name = "Tutorial",
 
60
                    icon = "tutorial.png",
 
61
                    requireauth = True,
 
62
                    hashelp = True)
 
63
 
 
64
app_server =    App(dir = "server",
 
65
                    name = "Server",
 
66
                    requireauth = False,
 
67
                    hashelp = False)
 
68
 
 
69
app_download =  App(dir = "download",
 
70
                    name = "Download",
 
71
                    requireauth = True,
 
72
                    hashelp = False)
 
73
 
 
74
app_help =      App(dir = "help",
 
75
                    name = "Help",
 
76
                    icon = "help.png",
 
77
                    requireauth = True,
 
78
                    hashelp = False)
 
79
 
 
80
app_debuginfo = App(dir = "debuginfo",
 
81
                    name = "Debug Information",
 
82
                    requireauth = False,
 
83
                    hashelp = False)
 
84
 
 
85
# Mapping URL names to apps
 
86
 
 
87
app_url = {
 
88
    "files" : app_browser,
 
89
    "edit" : app_editor,
 
90
    "fileservice" : app_fileservice,
 
91
    "console" : app_console,
 
92
    "tutorial" : app_tutorial,
 
93
    "serve" : app_server,
 
94
    "download" : app_download,
 
95
    "help" : app_help,
 
96
    #"debuginfo" : app_debuginfo,
 
97
}
 
98
 
 
99
# List of apps that go in the tabs at the top
 
100
# (The others are hidden unless they are linked to)
 
101
# Note: The values in this list are the URL names as seen in app_url.
 
102
 
 
103
apps_in_tabs = ["files", "edit", "console", "tutorial", "help"]