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

« back to all changes in this revision

Viewing changes to www/apps/tutorial/__init__.py

  • Committer: mattgiuca
  • Date: 2008-01-30 05:09:03 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:331
Console: Configured console to display properly as a "floating" window in the
tutorial page.
The console now has two "modes" (normal mode and "windowpane" mode). This is
switched by the JavaScript, and enables different CSS styling (and will
further enable different behaviour).

Styled the console (black). In windowpane mode, there is an additional div at
the bottom which fills up the space, and the console is floated on top of it.
(With position:fixed). This lets it appear at the bottom of the screen no
matter where the user scrolls.

Added console_app.css and console_app.js, which are necessary for things
specific to the "Console" application but not all instances of the console.

Changed the styling and layout of tutorial HTML/CSS to accomodate the console
(it needed to go outside the padded box).

Show diffs side-by-side

added added

removed removed

Lines of Context:
109
109
    if req.uri[-1] != os.sep:
110
110
        req.throw_redirect(make_tutorial_path())
111
111
    req.write_html_head_foot = True
 
112
    req.write('<div id="tutorialbody">\n')
112
113
    req.write("<h1>IVLE Tutorials</h1>\n")
113
114
    req.write("""<p>Welcome to the IVLE tutorial system.
114
115
  Please select a subject from the list below to take a tutorial problem sheet
122
123
        req.write('  <li><a href="%s">%s</a></li>\n'
123
124
            % (urllib.quote(subject) + '/', cgi.escape(subject)))
124
125
    req.write("</ul>\n")
 
126
    req.write("</div>\n")   # tutorialbody
125
127
 
126
128
def is_valid_subjname(subject):
127
129
    m = re_ident.match(subject)
160
162
    # Now all the errors are out the way, we can begin writing
161
163
    req.title = "Tutorial - %s" % subject
162
164
    req.write_html_head_foot = True
 
165
    req.write('<div id="tutorialbody">\n')
163
166
    req.write("<h1>IVLE Tutorials - %s</h1>\n" % cgi.escape(subject))
164
167
    req.write("<h2>Worksheets</h2>\n<ul>\n")
165
168
    for worksheet in worksheets:
166
169
        req.write('  <li><a href="%s">%s</a></li>\n'
167
170
            % (urllib.quote(worksheet.id), cgi.escape(worksheet.name)))
168
171
    req.write("</ul>\n")
 
172
    req.write("</div>\n")   # tutorialbody
169
173
 
170
174
def handle_worksheet(req, subject, worksheet):
171
175
    # Subject and worksheet names must be valid identifiers
196
200
    # Now all the errors are out the way, we can begin writing
197
201
    req.title = "Tutorial - %s" % worksheetname
198
202
    req.write_html_head_foot = True
 
203
    req.write('<div id="tutorialbody">\n')
199
204
    req.write("<h1>IVLE Tutorials - %s</h1>\n<h2>%s</h2>\n"
200
205
        % (cgi.escape(subject), cgi.escape(worksheetname)))
201
206
    # Write each element
207
212
        else:
208
213
            # Just treat this as a normal HTML element
209
214
            req.write(elem.toxml() + '\n')
 
215
    req.write("</div>\n")   # tutorialbody
210
216
 
211
217
def innerXML(elem):
212
218
    """Given an element, returns its children as XML strings concatenated