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

« back to all changes in this revision

Viewing changes to ivle/webapp/admin/templates/offering.html

  • Committer: William Grant
  • Date: 2010-02-18 03:31:47 UTC
  • Revision ID: grantw@unimelb.edu.au-20100218033147-z1es9tzrx7eg85gu
Ensure that we always close the DB connection at request termination, even in the case of an exception.

Show diffs side-by-side

added added

removed removed

Lines of Context:
90
90
        </a>
91
91
      </div>
92
92
 
93
 
      <div py:if="'edit_worksheets' in permissions or len(worksheets) > 0"
 
93
      <div py:if="'edit_worksheets' in permissions or context.worksheets.count() > 0"
94
94
           class="majorsection">
95
95
        <h2>Worksheets</h2>
96
 
        <py:choose test="len(worksheets)">
 
96
        <py:choose test="context.worksheets.count()">
97
97
          <p py:when="0">
98
98
            There are no worksheets for this offering.
99
99
            <a class="addaction" href="${req.publisher.generate(context, None, ('+worksheets', '+new'))}">Create one now</a>
104
104
                <li>
105
105
                  <!-- Can't generate a URL directly to the worksheet, since this is a fake worksheet. -->
106
106
                  <a href="${req.publisher.generate(context)}/+worksheets/${worksheet.id}">${worksheet.name}</a>
107
 
                  <span py:if="not worksheet.published">(unpublished &mdash; not visible to students)</span>
108
107
                  <py:if test="worksheet.assessable">
109
108
                    <ul>
110
109
                      <li class="${worksheet.complete_class}">
121
120
                  Total exercises completed: ${exercises_done}/${exercises_total} (${exercises_pct}%)
122
121
                </li>
123
122
              </ul> 
124
 
              <p py:if="context.show_worksheet_marks">
 
123
              <p>
125
124
                <span style="font-weight: bold;">Mark:</span> ${worksheet_mark}/${worksheet_max_mark}
126
125
              </p>
127
126
            </py:if>
129
128
              <a class="manageaction" href="${req.publisher.generate(context, None, ('+worksheets', '+edit'))}"> Manage worksheets</a>
130
129
              <a class="manageaction" href="/+exercises">Manage exercises</a>
131
130
            </div>
132
 
            <div class="horizontalactions" py:if="'view_worksheet_marks' in permissions">
133
 
              <a class="marksaction" href="${req.publisher.generate(context, None, ('+worksheets', '+marks'))}">View worksheet marks</a>
134
 
            </div>
135
131
          </div>
136
132
        </py:choose>
137
133
      </div>