~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 11:27:34 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:191
dispatch.html, ivle.css, browser.css: Major restyling of the IVLE website.
    The header section is condensed, tabs display properly, introduced colour,
    everything goes all the way to the edge.

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
 
67
67
    # Open the body element and write a bunch of stuff there (the header)
68
68
    req.write("""<body>
69
 
<h1>IVLE - Informatics Virtual Learning Environment</h1>
 
69
<div id="ivleheader">
 
70
  <h1>IVLE - Informatics Virtual Learning Environment</h1>
70
71
""")
71
72
 
72
73
    if req.username:
73
 
        req.write('<p class="userhello">Hello, %s. '
74
 
            '<a href="%s">Logout</a></p>\n' %
 
74
        req.write('  <p class="userhello">Welcome, <span '
 
75
            'class="username">%s</span>. '
 
76
            '<a href="%s">Logout</a>.</p>\n' %
75
77
            (req.username, util.make_path('logout')))
76
78
    else:
77
 
        req.write('<p class="userhello">Not logged in.</p>')
78
 
 
79
 
    print_apps_list(req)
 
79
        req.write('  <p class="userhello">Not logged in.</p>')
80
80
 
81
81
    # If the "debuginfo" app is installed, display a warning to the admin to
82
82
    # make sure it is removed in production.
83
83
    if "debuginfo" in conf.apps.app_url:
84
 
        req.write("<p><small>Warning: debuginfo is enabled. Remove this app "
85
 
            "from conf.apps.app_url when placed into production."
 
84
        req.write("  <p><small>Warning: debuginfo is enabled. Remove this "
 
85
            "app from conf.apps.app_url when placed into production."
86
86
            "</small></p>\n")
87
87
 
 
88
    print_apps_list(req, req.app)
 
89
    req.write('</div>\n<div id="ivlebody">\n')
 
90
 
88
91
def write_html_foot(req):
89
92
    """Writes the HTML footer, given a request object.
90
93
 
91
94
    req: An IVLE request object. Written to.
92
95
    """
93
 
    req.write("</body>\n</html>\n")
 
96
    req.write("</div>\n</body>\n</html>\n")
94
97
 
95
 
def print_apps_list(file):
 
98
def print_apps_list(file, thisapp):
96
99
    """Prints all app tabs, as a UL. Prints a list item for each app that has
97
100
    a tab.
98
101
 
99
102
    file: Object with a "write" method - ie. the request object.
100
103
    Reads from: conf
101
104
    """
102
 
    file.write('<ul class="apptabs">\n')
 
105
    file.write('  <ul class="apptabs">\n')
103
106
 
104
107
    for urlname in conf.apps.apps_in_tabs:
105
108
        app = conf.apps.app_url[urlname]
106
 
        file.write('  <li><a href="%s">%s</a></li>\n'
107
 
            % (util.make_path(urlname), app.name))
 
109
        if urlname == thisapp:
 
110
            li_attr = ' class="thisapp"'
 
111
        else:
 
112
            li_attr = ''
 
113
        file.write('    <li%s><a href="%s">%s</a></li>\n'
 
114
            % (li_attr, util.make_path(urlname), app.name))
108
115
 
109
 
    file.write('</ul>\n')
 
116
    file.write('  </ul>\n')