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

« back to all changes in this revision

Viewing changes to ivle/webapp/groups/template.html

  • Committer: mattgiuca
  • Date: 2008-02-22 00:53:35 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:540
Refactored error handling and reporting. Much friendlier error messages, for
both developers and users.

Note that PythonDebug is now going to be ignored. IVLE itself selects when to
display a traceback. (So IVLE will display tracebacks even in a production
environment, for internal server errors).

common/util.py: Added class IVLEError, which is now used for throwing
user-readable errors inside IVLE instead of throwing apache SERVER_RETURN
exceptions.

dispatch/request: throw_error now throws an IVLEError instead of a
SERVER_RETURN. It also takes a new argument, "message", which can be used to
place an optional message inside the exception which will be displayed to the
user.
Finally, added a method get_http_codename which returns the name and
description of common HTTP error codes. (Used to report errors which don't
have a message supplied).

dispatch/__init__: Added a wrapper around handler which catches all exceptions
thrown out of IVLE.
The handler for this selectively handles exceptions.
4xx level exceptions thrown are user errors, so these are reported in a very
friendly way, with no traceback, and in the familiar IVLE environment.
5xx level exceptions and any other exceptions are reported in a minimal
environment (to avoid cascading errors) with a traceback and a request for the
user to report it to the administrators.

As many calls to req.throw_error as possible should now have a message
included, to make identifying errors easier.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<html xmlns="http://www.w3.org/1999/xhtml"
2
 
      xmlns:py="http://genshi.edgewall.org/">
3
 
  <head>
4
 
    <title>Groups</title>
5
 
  </head>
6
 
  <body>
7
 
    <div id="ivle_padding">
8
 
      <p py:if="not enrolments">Error: You are not currently enrolled in any subjects.</p>
9
 
      <py:for each="enrolment in enrolments">
10
 
        <div id="subject${enrolment.offering.id}" class="subject">
11
 
          <h1>${enrolment.offering.subject.name}</h1>
12
 
          <py:for each="group in get_user_groups(enrolment.offering)">
13
 
            <h2>${group.nick} (${group.name})</h2>
14
 
            <!-- Need proper test (for invite/membership). -->
15
 
            <!-- <py:choose test="group">
16
 
              <py:when test="True"> -->
17
 
                <p>You are a member of this group.</p>
18
 
              <!--</py:when>
19
 
              <py:otherwise>
20
 
                <p>You have been invited to this group.</p>
21
 
                <p>
22
 
                  <input type="button" 
23
 
                      onclick="accept(&quot;${group.name}&quot;)" 
24
 
                      value="Accept" />
25
 
                  <input type="button"
26
 
                      onclick="decline(&quot;${group.name}&quot;)"
27
 
                      value="Decline" />
28
 
                </p>
29
 
              </py:otherwise>
30
 
            </py:choose>-->
31
 
            <h3>Members</h3>
32
 
            <ul>
33
 
              <py:for each="member in group.members">
34
 
                <li>${member.fullname} (${member.login})</li>
35
 
              </py:for>
36
 
            </ul>
37
 
          </py:for>
38
 
        </div>
39
 
      </py:for>
40
 
      <py:if test="manage_subjects">
41
 
        <hr />
42
 
        <h1>Group Administration</h1>
43
 
        <label for="subject_select">Subject:</label>
44
 
        <select id="subject_select">
45
 
          <py:for each="subject in manage_subjects">
46
 
            <option value="${subject.id}">${subject.name} (${subject.code})</option>
47
 
          </py:for>
48
 
        </select>
49
 
        <input type="button" value="Manage" onclick="manage_subject()" />
50
 
        <div id="subject_div"></div>
51
 
      </py:if>
52
 
    </div>
53
 
  </body>
54
 
</html>