~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-25 03:18:21 UTC
  • Revision ID: grantw@unimelb.edu.au-20100225031821-mi9a2tm5679fht4d
Shuffle things around so that req.user and req.store only construct when actually retrieved, and ensure they're not retrieved for media files. Saves 50ms of DB connection time per request.

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 context.worksheets.count() > 0"
 
93
      <div py:if="'edit_worksheets' in permissions or len(worksheets) > 0"
94
94
           class="majorsection">
95
95
        <h2>Worksheets</h2>
96
 
        <py:choose test="context.worksheets.count()">
 
96
        <py:choose test="len(worksheets)">
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>
107
108
                  <py:if test="worksheet.assessable">
108
109
                    <ul>
109
110
                      <li class="${worksheet.complete_class}">
120
121
                  Total exercises completed: ${exercises_done}/${exercises_total} (${exercises_pct}%)
121
122
                </li>
122
123
              </ul> 
123
 
              <p>
 
124
              <p py:if="context.show_worksheet_marks">
124
125
                <span style="font-weight: bold;">Mark:</span> ${worksheet_mark}/${worksheet_max_mark}
125
126
              </p>
126
127
            </py:if>
128
129
              <a class="manageaction" href="${req.publisher.generate(context, None, ('+worksheets', '+edit'))}"> Manage worksheets</a>
129
130
              <a class="manageaction" href="/+exercises">Manage exercises</a>
130
131
            </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>
131
135
          </div>
132
136
        </py:choose>
133
137
      </div>