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

« back to all changes in this revision

Viewing changes to ivle/webapp/admin/templates/offering.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:
12
12
           href="${req.publisher.generate(context, OfferingEdit)}">
13
13
           Change details
14
14
        </a>
 
15
        <a py:if="req.user.admin"
 
16
           class="subjectaction"
 
17
           href="${req.publisher.generate(context, OfferingCloneWorksheets)}">
 
18
           Clone worksheets
 
19
        </a>
15
20
        <a py:if="'enrol' in permissions"
16
21
           class="groupaction"
17
 
           href="${req.publisher.generate(context, None, ('+enrolments', '+new'))}">
18
 
          Enrol users
 
22
           href="${req.publisher.generate(context, EnrolmentsView)}">
 
23
          Administer enrolments
19
24
        </a>
20
25
      </div>
21
26
 
33
38
          </p>
34
39
          <py:otherwise>
35
40
            <ul class="paddedlist">
36
 
              <li py:for="project in context.projects"
 
41
              <li py:for="project in context.projects.order_by(Project.deadline)"
37
42
                  py:attrs="{'class': 'project closed'}
38
43
                            if project.has_deadline_passed(req.user)
39
44
                            else {'class': 'project'}"
65
70
                </py:if>
66
71
                <br />
67
72
                ${project.synopsis}
68
 
                <py:if test="'view_project_submissions' in permissions">
69
 
                  <br />
 
73
                <div class="horizontalactions" py:if="'view_project_submissions' in permissions">
70
74
                  <a class="verifyaction" href="${req.publisher.generate(project)}">View submissions</a>
71
 
                  <a py:if="project.project_set.is_group" class="manageaction"
 
75
                  <a py:if="project.project_set.is_group" class="groupaction"
72
76
                     href="${req.publisher.generate(project.project_set, GroupsView)}">Manage groups</a>
73
 
                </py:if>
 
77
                </div>
74
78
              </li>
75
79
            </ul>
76
 
            <py:if test="context.get_open_projects_for_user(req.user).count() > 0">
77
 
              <p>
78
 
                To submit to a project that has not yet closed, use the file
79
 
                browser to navigate to the file or directory that you wish to
80
 
                submit, click &ldquo;More actions...&rdquo;,
81
 
                &ldquo;Submit&rdquo;, and then select the correct project.
82
 
              </p>
83
 
              <p>
84
 
                If the project to which you intend to submit is not listed,
85
 
                ensure that you are in the correct directory, or a subdirectory
86
 
                thereof. For solo projects, you must be inside the subject's
87
 
                &ldquo;mywork&rdquo; directory. For group projects, you must be
88
 
                inside the directory for the assigned group.
89
 
              </p>
90
 
              <p>
91
 
                You may resubmit a project as you wish until the deadline, but
92
 
                a new submission will overwrite any made earlier.
93
 
              </p>
94
 
            </py:if>
 
80
            <p py:if="context.get_open_projects_for_user(req.user).count() > 0">
 
81
              <a class="helpaction" href="/+help/Submitting%20a%20project">Help submitting a project</a>
 
82
            </p>
95
83
          </py:otherwise>
96
84
        </py:choose>
97
85
 
102
90
        </a>
103
91
      </div>
104
92
 
105
 
      <div py:if="'edit_worksheets' in permissions or context.worksheets.count() > 0"
 
93
      <div py:if="'edit_worksheets' in permissions or len(worksheets) > 0"
106
94
           class="majorsection">
107
95
        <h2>Worksheets</h2>
108
 
        <py:choose test="context.worksheets.count()">
 
96
        <py:choose test="len(worksheets)">
109
97
          <p py:when="0">
110
98
            There are no worksheets for this offering.
111
99
            <a class="addaction" href="${req.publisher.generate(context, None, ('+worksheets', '+new'))}">Create one now</a>
116
104
                <li>
117
105
                  <!-- Can't generate a URL directly to the worksheet, since this is a fake worksheet. -->
118
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>
119
108
                  <py:if test="worksheet.assessable">
120
109
                    <ul>
121
110
                      <li class="${worksheet.complete_class}">
132
121
                  Total exercises completed: ${exercises_done}/${exercises_total} (${exercises_pct}%)
133
122
                </li>
134
123
              </ul> 
135
 
              <p>
 
124
              <p py:if="context.show_worksheet_marks">
136
125
                <span style="font-weight: bold;">Mark:</span> ${worksheet_mark}/${worksheet_max_mark}
137
126
              </p>
138
127
            </py:if>
139
 
            <span py:if="'edit_worksheets' in permissions">
 
128
            <span py:if="context.worksheet_cutoff is not None"
 
129
              title="${'Closed' if context.has_worksheet_cutoff_passed(req.user) else 'Due'}: ${format_datetime(context.worksheet_cutoff)}">
 
130
              Worksheet submissions ${'closed' if context.has_worksheet_cutoff_passed(req.user) else 'are due'} ${format_datetime_short(context.worksheet_cutoff)}.
 
131
              <br />
 
132
              <py:choose test="context.has_worksheet_cutoff_passed(req.user)">
 
133
              <py:when test="True">You can still submit, but it will not count towards your mark.</py:when>
 
134
              <py:when test="False">After this time, you can still submit, but it will not count towards your mark.</py:when>
 
135
              </py:choose>
 
136
            </span>
 
137
            <div class="horizontalactions" py:if="'edit_worksheets' in permissions">
140
138
              <a class="manageaction" href="${req.publisher.generate(context, None, ('+worksheets', '+edit'))}"> Manage worksheets</a>
141
 
              <br />
142
139
              <a class="manageaction" href="/+exercises">Manage exercises</a>
143
 
            </span>
 
140
            </div>
 
141
            <div class="horizontalactions" py:if="'view_worksheet_marks' in permissions">
 
142
              <a class="marksaction" href="${req.publisher.generate(context, None, ('+worksheets', '+marks'))}">View worksheet marks</a>
 
143
            </div>
144
144
          </div>
145
145
        </py:choose>
146
146
      </div>