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

« back to all changes in this revision

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

  • Committer: Matt Giuca
  • Date: 2010-02-23 07:46:34 UTC
  • Revision ID: matt.giuca@gmail.com-20100223074634-r08p14zoy3u5atoc
browser.js: Fixed check for whether to use specialhome -- now works if the path ends in a '/'. This fixes Launchpad Bug #492510.

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="'edit' in permissions"
 
11
           class="editaction"
 
12
           href="${req.publisher.generate(context, OfferingEdit)}">
 
13
           Change details
 
14
        </a>
 
15
        <a py:if="req.user.admin"
 
16
           class="subjectaction"
 
17
           href="${req.publisher.generate(context, OfferingCloneWorksheets)}">
 
18
           Clone worksheets
 
19
        </a>
 
20
        <a py:if="'enrol' in permissions"
 
21
           class="groupaction"
 
22
           href="${req.publisher.generate(context, EnrolmentsView)}">
 
23
          Administer enrolments
 
24
        </a>
 
25
      </div>
 
26
 
 
27
      <div py:if="context.description" style="margin-bottom: 1em;">
 
28
        <div style="margin-bottom: 0.5em;">${context.description}</div>
 
29
        <a py:if="context.url" class="webaction" href="${context.url}">Home page</a>
 
30
      </div>
 
31
 
 
32
      <div py:if="'edit' in permissions or context.projects.count() > 0"
 
33
           class="majorsection">
 
34
        <h2>Projects</h2>
 
35
        <py:choose test="context.projects.count()">
 
36
          <p py:when="0">
 
37
            There are no projects for this offering.
 
38
          </p>
 
39
          <py:otherwise>
 
40
            <ul class="paddedlist">
 
41
              <li py:for="project in context.projects"
 
42
                  py:attrs="{'class': 'project closed'}
 
43
                            if project.has_deadline_passed(req.user)
 
44
                            else {'class': 'project'}"
 
45
                  py:with="principal = project.project_set.get_submission_principal(req.user)">
 
46
                <py:choose test="project.url not in (None, '')">
 
47
                  <a py:when="True" href="${project.url}">${project.name}</a>
 
48
                  <span py:otherwise="">${project.name}</span> 
 
49
                </py:choose>
 
50
                &ndash;
 
51
                <span py:content="format_submission_principal(req.user, principal)" /> &ndash;
 
52
                <!-- XXX This deadline does not take the student's extensions into account. -->
 
53
                <span title="${'Closed' if project.has_deadline_passed(req.user) else 'Due'}: ${format_datetime(project.deadline)}">
 
54
                  ${'closed' if project.has_deadline_passed(req.user) else 'due'} ${format_datetime_short(project.deadline)}
 
55
                </span>
 
56
                <py:if test="principal is not None"
 
57
                       py:with="submissions = project.get_submissions_for_principal(principal)">
 
58
                  &ndash;
 
59
                  <py:choose test="submissions.count()">
 
60
                    <span py:when="0">
 
61
                      not yet submitted
 
62
                    </span>
 
63
                    <span py:otherwise=""
 
64
                          py:with="latest = submissions.last()"
 
65
                          title="Submitted: ${format_datetime(latest.date_submitted)}">
 
66
                      last submitted ${format_datetime_short(latest.date_submitted)}
 
67
                      <a class="verifyaction" href="${latest.get_verify_url(req.user)}">Verify</a>
 
68
                    </span>
 
69
                  </py:choose>
 
70
                </py:if>
 
71
                <br />
 
72
                ${project.synopsis}
 
73
                <div class="horizontalactions" py:if="'view_project_submissions' in permissions">
 
74
                  <a class="verifyaction" href="${req.publisher.generate(project)}">View submissions</a>
 
75
                  <a py:if="project.project_set.is_group" class="groupaction"
 
76
                     href="${req.publisher.generate(project.project_set, GroupsView)}">Manage groups</a>
 
77
                </div>
 
78
              </li>
 
79
            </ul>
 
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>
 
83
          </py:otherwise>
 
84
        </py:choose>
 
85
 
 
86
        <a py:if="'edit' in permissions"
 
87
           class="manageaction"
 
88
           href="${req.publisher.generate(context, None, '+projects')}">
 
89
          Manage projects
 
90
        </a>
 
91
      </div>
 
92
 
 
93
      <div py:if="'edit_worksheets' in permissions or context.worksheets.count() > 0"
 
94
           class="majorsection">
 
95
        <h2>Worksheets</h2>
 
96
        <py:choose test="context.worksheets.count()">
 
97
          <p py:when="0">
 
98
            There are no worksheets for this offering.
 
99
            <a class="addaction" href="${req.publisher.generate(context, None, ('+worksheets', '+new'))}">Create one now</a>
 
100
          </p>
 
101
          <div py:otherwise="">
 
102
            <ul id="tutorial-toc">
 
103
              <py:for each="worksheet in worksheets">
 
104
                <li>
 
105
                  <!-- Can't generate a URL directly to the worksheet, since this is a fake worksheet. -->
 
106
                  <a href="${req.publisher.generate(context)}/+worksheets/${worksheet.id}">${worksheet.name}</a>
 
107
                  <py:if test="worksheet.assessable">
 
108
                    <ul>
 
109
                      <li class="${worksheet.complete_class}">
 
110
                        Completed ${worksheet.mand_done}/${worksheet.total}${worksheet.optional_message}
 
111
                      </li>
 
112
                    </ul>
 
113
                  </py:if>
 
114
                </li>
 
115
              </py:for>
 
116
            </ul>
 
117
            <py:if test="exercises_total > 0">
 
118
              <ul>
 
119
                <li class="${worksheets_complete_class}">
 
120
                  Total exercises completed: ${exercises_done}/${exercises_total} (${exercises_pct}%)
 
121
                </li>
 
122
              </ul> 
 
123
              <p>
 
124
                <span style="font-weight: bold;">Mark:</span> ${worksheet_mark}/${worksheet_max_mark}
 
125
              </p>
 
126
            </py:if>
 
127
            <div class="horizontalactions" py:if="'edit_worksheets' in permissions">
 
128
              <a class="manageaction" href="${req.publisher.generate(context, None, ('+worksheets', '+edit'))}"> Manage worksheets</a>
 
129
              <a class="manageaction" href="/+exercises">Manage exercises</a>
 
130
            </div>
 
131
          </div>
 
132
        </py:choose>
 
133
      </div>
 
134
    </div>
 
135
  </body>
 
136
</html>
 
137
    
 
138