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

1442.1.2 by William Grant
Add basic (ie. pretty much empty) offering index.
1
<html xmlns="http://www.w3.org/1999/xhtml"
2
      xmlns:py="http://genshi.edgewall.org/">
3
  <head>
1822.1.1 by William Grant
Replace semester.semester with semester.{code,url_name,display_name}.
4
    <title>${context.subject.name} (${context.semester.year} ${context.semester.display_name})</title>
1442.1.2 by William Grant
Add basic (ie. pretty much empty) offering index.
5
  </head>
6
  <body>
7
    <h1>${context.subject.name}</h1>
8
    <div id="ivle_padding">
9
      <div class="contextactions">
1451.1.7 by William Grant
Add a 'Change details' link on the offering index, pointing to +edit.
10
        <a py:if="'edit' in permissions"
11
           class="editaction"
12
           href="${req.publisher.generate(context, OfferingEdit)}">
13
           Change details
14
        </a>
1603 by William Grant
Add UI to clone worksheets between offerings -- replacing ivle-cloneworksheets.
15
        <a py:if="req.user.admin"
16
           class="subjectaction"
17
           href="${req.publisher.generate(context, OfferingCloneWorksheets)}">
18
           Clone worksheets
19
        </a>
1442.1.5 by William Grant
Improve worksheet management experience from the offering index.
20
        <a py:if="'enrol' in permissions"
1442.1.6 by William Grant
Enrolment is now a groupaction, and project management a manageaction.
21
           class="groupaction"
1610 by William Grant
Replace OfferingView's link to EnrolView with one to EnrolmentsView, and link from there to EnrolView.
22
           href="${req.publisher.generate(context, EnrolmentsView)}">
23
          Administer enrolments
1442.1.2 by William Grant
Add basic (ie. pretty much empty) offering index.
24
        </a>
1442.1.8 by William Grant
Add an empty projects section.
25
      </div>
26
1451.1.2 by William Grant
Move Subject.url to Offering, and add Offering.description. Show these on the offering index.
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
1442.1.9 by William Grant
Add some extra margin between the projects and worksheets sections.
32
      <div py:if="'edit' in permissions or context.projects.count() > 0"
33
           class="majorsection">
1442.1.8 by William Grant
Add an empty projects section.
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>
1442.1.21 by William Grant
Add submission instructions under the list of projects.
39
          <py:otherwise>
40
            <ul class="paddedlist">
1725 by Matt Giuca
Subject offering page: Sort projects by deadline (for student view).
41
              <li py:for="project in context.projects.order_by(Project.deadline)"
1442.1.21 by William Grant
Add submission instructions under the list of 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)">
1473 by William Grant
Don't render an offering's projects as <a>s unless they actually have a URL.
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;
1442.1.21 by William Grant
Add submission instructions under the list of projects.
51
                <span py:content="format_submission_principal(req.user, principal)" /> &ndash;
1510 by Matt Giuca
All checks if a project deadline has passed call Project.has_deadline_passed, rather than manually checking with the current time. Important if the abstracted function changes to respect extensions.
52
                <!-- XXX This deadline does not take the student's extensions into account. -->
1528 by Matt Giuca
Subject page: The tooltips on project due/submitted times, added the text 'Due', 'Closed' or 'Submitted', so it's clear what time you are looking at.
53
                <span title="${'Closed' if project.has_deadline_passed(req.user) else 'Due'}: ${format_datetime(project.deadline)}">
1442.1.21 by William Grant
Add submission instructions under the list of projects.
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()"
1528 by Matt Giuca
Subject page: The tooltips on project due/submitted times, added the text 'Due', 'Closed' or 'Submitted', so it's clear what time you are looking at.
65
                          title="Submitted: ${format_datetime(latest.date_submitted)}">
1442.1.21 by William Grant
Add submission instructions under the list of projects.
66
                      last submitted ${format_datetime_short(latest.date_submitted)}
1522 by Matt Giuca
Subject page: Added Verify links on the subject pages to any projects with
67
                      <a class="verifyaction" href="${latest.get_verify_url(req.user)}">Verify</a>
1442.1.21 by William Grant
Add submission instructions under the list of projects.
68
                    </span>
69
                  </py:choose>
70
                </py:if>
71
                <br />
72
                ${project.synopsis}
1590 by William Grant
Add a horizontalactions class, which spaces horizontal actions nicely. Use it.
73
                <div class="horizontalactions" py:if="'view_project_submissions' in permissions">
1557 by William Grant
Display a link on the offering index to view each project's submissions.
74
                  <a class="verifyaction" href="${req.publisher.generate(project)}">View submissions</a>
1587 by William Grant
The 'Manage groups' link on the offering index now uses a group icon.
75
                  <a py:if="project.project_set.is_group" class="groupaction"
1558 by William Grant
Allow tutors to manage groups.
76
                     href="${req.publisher.generate(project.project_set, GroupsView)}">Manage groups</a>
1590 by William Grant
Add a horizontalactions class, which spaces horizontal actions nicely. Use it.
77
                </div>
1442.1.21 by William Grant
Add submission instructions under the list of projects.
78
              </li>
79
            </ul>
1562 by Matt Giuca
Removed submission advice from the subjects page, instead linking to the help page (which contained the same text). Also linked to this page from the submit page. Minor tweaks to the text relating to the submission advice. Fixes Launchpad Bug #520284.
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>
1442.1.21 by William Grant
Add submission instructions under the list of projects.
83
          </py:otherwise>
1442.1.8 by William Grant
Add an empty projects section.
84
        </py:choose>
85
1442.1.5 by William Grant
Improve worksheet management experience from the offering index.
86
        <a py:if="'edit' in permissions"
1442.1.6 by William Grant
Enrolment is now a groupaction, and project management a manageaction.
87
           class="manageaction"
1442.1.2 by William Grant
Add basic (ie. pretty much empty) offering index.
88
           href="${req.publisher.generate(context, None, '+projects')}">
89
          Manage projects
90
        </a>
1442.1.5 by William Grant
Improve worksheet management experience from the offering index.
91
      </div>
1442.1.8 by William Grant
Add an empty projects section.
92
1695.1.6 by William Grant
Hide unpublished worksheets if edit_worksheets is not held.
93
      <div py:if="'edit_worksheets' in permissions or len(worksheets) > 0"
1442.1.9 by William Grant
Add some extra margin between the projects and worksheets sections.
94
           class="majorsection">
1442.1.5 by William Grant
Improve worksheet management experience from the offering index.
95
        <h2>Worksheets</h2>
1695.1.6 by William Grant
Hide unpublished worksheets if edit_worksheets is not held.
96
        <py:choose test="len(worksheets)">
1442.1.5 by William Grant
Improve worksheet management experience from the offering index.
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="">
1442.1.31 by William Grant
Show the worksheet listing with marks and schtuff on the offering index.
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. -->
1462 by William Grant
Fix worksheet links.
106
                  <a href="${req.publisher.generate(context)}/+worksheets/${worksheet.id}">${worksheet.name}</a>
1695.1.7 by William Grant
Indicate unpublished worksheets on the offering index.
107
                  <span py:if="not worksheet.published">(unpublished &mdash; not visible to students)</span>
1442.1.31 by William Grant
Show the worksheet listing with marks and schtuff on the offering index.
108
                  <py:if test="worksheet.assessable">
109
                    <ul>
110
                      <li class="${worksheet.complete_class}">
111
                        Completed ${worksheet.mand_done}/${worksheet.total}${worksheet.optional_message}
112
                      </li>
113
                    </ul>
114
                  </py:if>
115
                </li>
116
              </py:for>
117
            </ul>
118
            <py:if test="exercises_total > 0">
119
              <ul>
120
                <li class="${worksheets_complete_class}">
121
                  Total exercises completed: ${exercises_done}/${exercises_total} (${exercises_pct}%)
122
                </li>
123
              </ul> 
1695.1.5 by William Grant
Hide marks (out of five) unless enabled by the offering.
124
              <p py:if="context.show_worksheet_marks">
1442.1.31 by William Grant
Show the worksheet listing with marks and schtuff on the offering index.
125
                <span style="font-weight: bold;">Mark:</span> ${worksheet_mark}/${worksheet_max_mark}
126
              </p>
127
            </py:if>
1737 by Matt Giuca
Offering page: Display the worksheet cutoff to students, if there is one.
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>
1590 by William Grant
Add a horizontalactions class, which spaces horizontal actions nicely. Use it.
137
            <div class="horizontalactions" py:if="'edit_worksheets' in permissions">
1538 by Matt Giuca
offering.html: Minor change to manages buttons. A bit neater, and avoids a stray <br /> if you aren't a tutor.
138
              <a class="manageaction" href="${req.publisher.generate(context, None, ('+worksheets', '+edit'))}"> Manage worksheets</a>
139
              <a class="manageaction" href="/+exercises">Manage exercises</a>
1590 by William Grant
Add a horizontalactions class, which spaces horizontal actions nicely. Use it.
140
            </div>
1689.1.3 by Matt Giuca
Offering page: Added link to worksheet marks at the bottom of the page, for lecturers and admins.
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>
1442.1.5 by William Grant
Improve worksheet management experience from the offering index.
144
          </div>
145
        </py:choose>
1442.1.2 by William Grant
Add basic (ie. pretty much empty) offering index.
146
      </div>
147
    </div>
148
  </body>
149
</html>
150
    
151