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

« back to all changes in this revision

Viewing changes to ivle/webapp/base/ivle-headings.html

  • Committer: David Coles
  • Date: 2010-07-27 04:52:14 UTC
  • Revision ID: coles.david@gmail.com-20100727045214-p32h1kc0gcv48dpr
Worksheets: Strip off whitespace from the end of exercise attempts.

This solves an issue where accidental whitespace in an attempt will cause 
"IndentationError" syntax error (which don't occur when run in console).

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
      xmlns:xi="http://www.w3.org/2001/XInclude"
4
4
      py:strip="">
5
5
  <py:match path="head[@status!='done']" once="true">
6
 
    <head status='done' py:attrs="select('@*')">
 
6
    <head>
7
7
      <title py:with="title = list(select('title/text()'))">
8
8
        <py:if test="title">${title} - </py:if>IVLE
9
9
      </title>
10
10
 
11
11
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
12
12
 
13
 
      <script py:if="write_javascript_settings" type="text/javascript">
 
13
      <script py:if="not publicmode and write_javascript_settings" type="text/javascript">
14
14
        root_dir = "${root_dir}";
15
15
        public_host = "${public_host}";
 
16
        svn_base = "${svn_base}";
16
17
        username = "${login}";
17
18
      </script>
18
19
 
19
20
      <link py:if="favicon" rel="shortcut icon" href="${favicon}" />
20
21
 
21
 
      <link rel="stylesheet" type="text/css" href="/media/common/ivle.css" />
22
 
 
23
 
      <script type="text/javascript" src="/media/common/util.js"></script>
24
 
      <script type="text/javascript" src="/media/common/json2.js"></script>
25
 
      <script type="text/javascript" src="/media/common/md5.js"></script>
26
 
      <script type="text/javascript" src="/media/common/tos.js"></script>
27
 
 
28
 
      <!-- Plugin style sheets and JavaScript -->
29
 
      <py:for each="style in app_styles">
30
 
        <link rel="stylesheet" type="text/css" href="${style}" />
 
22
      <py:for each="style in styles">
 
23
      <link rel="stylesheet" type="text/css" href="${style}" />
31
24
      </py:for>
32
25
 
33
26
      <py:for each="script in scripts">
34
 
        <script type="text/javascript" src="${script}"></script>
 
27
      <script type="text/javascript" src="${script}"></script>
35
28
      </py:for>
36
29
 
37
30
      <!-- Plugin JavaScript to be run on page load -->
38
31
      <script type="text/javascript">
39
32
        <py:for each="init_script in scripts_init">
40
 
          window.addEventListener("load", ${init_script}, false);
 
33
          $(document).ready(${init_script});
41
34
        </py:for>
42
35
      </script>
43
36
      ${select('*[local-name()!="title"]')}
44
37
    </head>
45
38
  </py:match>    
46
39
  <py:match path="body[@status!='done']" once="true">
47
 
    <body status='done'>
48
 
      <div id="ivleheader"></div>
49
 
      <div id="ivleheader_text">
50
 
        <h1>IVLE</h1>
51
 
        <h2>Informatics Virtual Learning Environment</h2>
52
 
        <py:choose>
53
 
          <p py:when="publicmode" class="userhello">Running in public mode.</p>
54
 
          <p py:when="logged_in" class="userhello">
55
 
            <span id="usernick">${nick}</span>
56
 
            (<span class="username">${login}</span>) |
57
 
            <a href="/settings">Settings</a> |
58
 
            <a href="/help">Help</a> |
59
 
            <a href="/logout">Sign out</a>
60
 
          </p>
61
 
          <p py:otherwise="">Not logged in.</p>
62
 
        </py:choose>
63
 
      </div>
64
 
      <div id="ivleheader_tabs">
65
 
        <ul id="apptabs">
66
 
          <py:for each="app in apps_in_tabs">
67
 
            <li py:if="app['this_app']" class="thisapp"><py:if test="app['has_icon']"><img src="${app['icon_url']}" alt="" /> </py:if><a href="${app['path']}" title="${app['desc']}">${app['name']}</a></li>
68
 
            <li py:if="not app['this_app']"><py:if test="app['has_icon']"><img src="${app['icon_url']}" alt="" /> </py:if><a href="${app['path']}" title="${app['desc']}">${app['name']}</a></li>
69
 
          </py:for>
 
40
    <body>
 
41
      <div id="ivleheader">
 
42
        <ul id="ivle_breadcrumbs">
 
43
          <li py:attrs="{'class': 'breadcrumb crumbmenu' if logged_in else 'breadcrumb'}">
 
44
            <a href="/">
 
45
              <img src="${title_img}" alt="Informatics Virtual Learning Environment" />
 
46
            </a>
 
47
            <ul py:if="logged_in">
 
48
              <li py:for="app in apps_in_tabs">
 
49
                <a py:attrs="{'style': 'background: url(%s) no-repeat; padding-left: 30px' % app['icon_url']} if app['has_icon'] else {}" href="${app['path']}" title="${app['desc']}">${app['name']}</a>
 
50
              </li>
 
51
            </ul>
 
52
          </li>
 
53
          <li py:for="thiscrumb in breadcrumbs"
 
54
              py:if="thiscrumb"
 
55
              py:attrs="{True:{'class':'crumbmenu'}, False: None}[hasattr(thiscrumb, 'menu')]">
 
56
            <py:choose test="getattr(thiscrumb, 'url', None)">
 
57
              <py:when test="None">
 
58
                <span>${thiscrumb.text}</span>
 
59
              </py:when>
 
60
              <py:otherwise>
 
61
                <a href="${thiscrumb.url}">
 
62
                  ${thiscrumb.text}
 
63
                </a>
 
64
              </py:otherwise>
 
65
            </py:choose>
 
66
            <ul py:if="hasattr(thiscrumb, 'menu')">
 
67
              <li py:for="item in thiscrumb.menu"><a href="${thiscrumb.menu[item]}">${item}</a></li>
 
68
            </ul>
 
69
          </li>
70
70
        </ul>
 
71
        <div id="ivleheader_text">
 
72
          <py:choose>
 
73
            <p py:when="publicmode" class="userhello">Public access mode</p>
 
74
            <p py:when="logged_in" class="userhello">
 
75
              <span id="usernick">${nick}</span>
 
76
              (<span class="username">${login}</span>) |
 
77
              <a href="/~${login}">Settings</a> |
 
78
              <py:choose>
 
79
                <a py:when="defined('help_path')" href="/+help/${help_path}">Help</a>
 
80
                <a py:otherwise="" href="/+help/">Help</a>
 
81
              |</py:choose>
 
82
              <a href="/+logout">Log out</a>
 
83
            </p>
 
84
            <p py:otherwise="" class="userhello">Not logged in.</p>
 
85
          </py:choose>
 
86
        </div>
71
87
      </div>
72
88
      <div id="ivlebody">
73
 
      ${select('*')}
 
89
        <div id="ivleview">
 
90
          ${select('*')}
 
91
        </div>
 
92
        <div id="ivleoverlays">
 
93
          <py:for each="overlay in overlays">
 
94
            ${overlay}
 
95
          </py:for>
 
96
        </div>     
74
97
      </div>
75
98
    </body>
76
99
  </py:match>