~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: 2009-12-17 05:37:21 UTC
  • mfrom: (1442.1.33 offering-home)
  • Revision ID: me@williamgrant.id.au-20091217053721-cesek4r55zbsyj4b
Replace the offering worksheets page with an offering index, including project information.

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>${context.subject.name} (${context.semester.year} semester ${context.semester.semester})</title>
 
5
  </head>
 
6
  <body>
 
7
    <h1>${context.subject.name}</h1>
 
8
    <div id="ivle_padding">
 
9
      <div class="contextactions">
 
10
        <a py:if="'enrol' in permissions"
 
11
           class="groupaction"
 
12
           href="${req.publisher.generate(context, None, ('+enrolments', '+new'))}">
 
13
          Enrol users
 
14
        </a>
 
15
      </div>
 
16
 
 
17
      <div py:if="'edit' in permissions or context.projects.count() > 0"
 
18
           class="majorsection">
 
19
        <h2>Projects</h2>
 
20
        <py:choose test="context.projects.count()">
 
21
          <p py:when="0">
 
22
            There are no projects for this offering.
 
23
          </p>
 
24
          <py:otherwise>
 
25
            <ul class="paddedlist">
 
26
              <li py:for="project in context.projects"
 
27
                  py:attrs="{'class': 'project closed'}
 
28
                            if project.has_deadline_passed(req.user)
 
29
                            else {'class': 'project'}"
 
30
                  py:with="principal = project.project_set.get_submission_principal(req.user)">
 
31
                <a href="${project.url}">${project.name}</a> &ndash;
 
32
                <span py:content="format_submission_principal(req.user, principal)" /> &ndash;
 
33
                <span title="${format_datetime(project.deadline)}">
 
34
                  ${'closed' if project.has_deadline_passed(req.user) else 'due'} ${format_datetime_short(project.deadline)}
 
35
                </span>
 
36
                <py:if test="principal is not None"
 
37
                       py:with="submissions = project.get_submissions_for_principal(principal)">
 
38
                  &ndash;
 
39
                  <py:choose test="submissions.count()">
 
40
                    <span py:when="0">
 
41
                      not yet submitted
 
42
                    </span>
 
43
                    <span py:otherwise=""
 
44
                          py:with="latest = submissions.last()"
 
45
                          title="${format_datetime(latest.date_submitted)}">
 
46
                      last submitted ${format_datetime_short(latest.date_submitted)}
 
47
                    </span>
 
48
                  </py:choose>
 
49
                </py:if>
 
50
                <br />
 
51
                ${project.synopsis}
 
52
              </li>
 
53
            </ul>
 
54
            <py:if test="context.get_open_projects_for_user(req.user).count() > 0">
 
55
              <p>
 
56
                To submit to a project that has not yet closed, use the file
 
57
                browser to navigate to the file or directory that you wish to
 
58
                submit, click &ldquo;More actions...&rdquo;,
 
59
                &ldquo;Submit&rdquo;, and then select the correct project.
 
60
              </p>
 
61
              <p>
 
62
                If the project to which you intend to submit is not listed,
 
63
                ensure that you are in the correct directory, or a subdirectory
 
64
                thereof. For solo projects, you must be inside the subject's
 
65
                &ldquo;mywork&rdquo; directory. For group projects, you must be
 
66
                inside the directory for the assigned group.
 
67
              </p>
 
68
              <p>
 
69
                You may resubmit a project as you wish until the deadline, but
 
70
                a new submission will overwrite any made earlier.
 
71
              </p>
 
72
            </py:if>
 
73
          </py:otherwise>
 
74
        </py:choose>
 
75
 
 
76
        <a py:if="'edit' in permissions"
 
77
           class="manageaction"
 
78
           href="${req.publisher.generate(context, None, '+projects')}">
 
79
          Manage projects
 
80
        </a>
 
81
      </div>
 
82
 
 
83
      <div py:if="'edit' in permissions or context.worksheets.count() > 0"
 
84
           class="majorsection">
 
85
        <h2>Worksheets</h2>
 
86
        <py:choose test="context.worksheets.count()">
 
87
          <p py:when="0">
 
88
            There are no worksheets for this offering.
 
89
            <a class="addaction" href="${req.publisher.generate(context, None, ('+worksheets', '+new'))}">Create one now</a>
 
90
          </p>
 
91
          <div py:otherwise="">
 
92
            <ul id="tutorial-toc">
 
93
              <py:for each="worksheet in worksheets">
 
94
                <li>
 
95
                  <!-- Can't generate a URL directly to the worksheet, since this is a fake worksheet. -->
 
96
                  <a href="${req.publisher.generate(context)}/+worksheets/${worksheet.name}">${worksheet.name}</a>
 
97
                  <py:if test="worksheet.assessable">
 
98
                    <ul>
 
99
                      <li class="${worksheet.complete_class}">
 
100
                        Completed ${worksheet.mand_done}/${worksheet.total}${worksheet.optional_message}
 
101
                      </li>
 
102
                    </ul>
 
103
                  </py:if>
 
104
                </li>
 
105
              </py:for>
 
106
            </ul>
 
107
            <py:if test="exercises_total > 0">
 
108
              <ul>
 
109
                <li class="${worksheets_complete_class}">
 
110
                  Total exercises completed: ${exercises_done}/${exercises_total} (${exercises_pct}%)
 
111
                </li>
 
112
              </ul> 
 
113
              <p>
 
114
                <span style="font-weight: bold;">Mark:</span> ${worksheet_mark}/${worksheet_max_mark}
 
115
              </p>
 
116
            </py:if>
 
117
            <a py:if="'edit' in permissions"
 
118
               class="manageaction"
 
119
               href="${req.publisher.generate(context, None, ('+worksheets', '+edit'))}">
 
120
              Manage worksheets
 
121
            </a>
 
122
          </div>
 
123
        </py:choose>
 
124
      </div>
 
125
    </div>
 
126
  </body>
 
127
</html>
 
128
    
 
129