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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:py="http://genshi.edgewall.org/">
  <head>
    <title>${context.subject.name} (${context.semester.year} semester ${context.semester.semester})</title>
  </head>
  <body>
    <h1>${context.subject.name}</h1>
    <div id="ivle_padding">
      <div class="contextactions">
        <a py:if="'edit' in permissions"
           class="editaction"
           href="${req.publisher.generate(context, OfferingEdit)}">
           Change details
        </a>
        <a py:if="req.user.admin"
           class="subjectaction"
           href="${req.publisher.generate(context, OfferingCloneWorksheets)}">
           Clone worksheets
        </a>
        <a py:if="'enrol' in permissions"
           class="groupaction"
           href="${req.publisher.generate(context, EnrolmentsView)}">
          Administer enrolments
        </a>
      </div>

      <div py:if="context.description" style="margin-bottom: 1em;">
        <div style="margin-bottom: 0.5em;">${context.description}</div>
        <a py:if="context.url" class="webaction" href="${context.url}">Home page</a>
      </div>

      <div py:if="'edit' in permissions or context.projects.count() > 0"
           class="majorsection">
        <h2>Projects</h2>
        <py:choose test="context.projects.count()">
          <p py:when="0">
            There are no projects for this offering.
          </p>
          <py:otherwise>
            <ul class="paddedlist">
              <li py:for="project in context.projects"
                  py:attrs="{'class': 'project closed'}
                            if project.has_deadline_passed(req.user)
                            else {'class': 'project'}"
                  py:with="principal = project.project_set.get_submission_principal(req.user)">
                <py:choose test="project.url not in (None, '')">
                  <a py:when="True" href="${project.url}">${project.name}</a>
                  <span py:otherwise="">${project.name}</span> 
                </py:choose>
                &ndash;
                <span py:content="format_submission_principal(req.user, principal)" /> &ndash;
                <!-- XXX This deadline does not take the student's extensions into account. -->
                <span title="${'Closed' if project.has_deadline_passed(req.user) else 'Due'}: ${format_datetime(project.deadline)}">
                  ${'closed' if project.has_deadline_passed(req.user) else 'due'} ${format_datetime_short(project.deadline)}
                </span>
                <py:if test="principal is not None"
                       py:with="submissions = project.get_submissions_for_principal(principal)">
                  &ndash;
                  <py:choose test="submissions.count()">
                    <span py:when="0">
                      not yet submitted
                    </span>
                    <span py:otherwise=""
                          py:with="latest = submissions.last()"
                          title="Submitted: ${format_datetime(latest.date_submitted)}">
                      last submitted ${format_datetime_short(latest.date_submitted)}
                      <a class="verifyaction" href="${latest.get_verify_url(req.user)}">Verify</a>
                    </span>
                  </py:choose>
                </py:if>
                <br />
                ${project.synopsis}
                <div class="horizontalactions" py:if="'view_project_submissions' in permissions">
                  <a class="verifyaction" href="${req.publisher.generate(project)}">View submissions</a>
                  <a py:if="project.project_set.is_group" class="groupaction"
                     href="${req.publisher.generate(project.project_set, GroupsView)}">Manage groups</a>
                </div>
              </li>
            </ul>
            <p py:if="context.get_open_projects_for_user(req.user).count() > 0">
              <a class="helpaction" href="/+help/Submitting%20a%20project">Help submitting a project</a>
            </p>
          </py:otherwise>
        </py:choose>

        <a py:if="'edit' in permissions"
           class="manageaction"
           href="${req.publisher.generate(context, None, '+projects')}">
          Manage projects
        </a>
      </div>

      <div py:if="'edit_worksheets' in permissions or context.worksheets.count() > 0"
           class="majorsection">
        <h2>Worksheets</h2>
        <py:choose test="context.worksheets.count()">
          <p py:when="0">
            There are no worksheets for this offering.
            <a class="addaction" href="${req.publisher.generate(context, None, ('+worksheets', '+new'))}">Create one now</a>
          </p>
          <div py:otherwise="">
            <ul id="tutorial-toc">
              <py:for each="worksheet in worksheets">
                <li>
                  <!-- Can't generate a URL directly to the worksheet, since this is a fake worksheet. -->
                  <a href="${req.publisher.generate(context)}/+worksheets/${worksheet.id}">${worksheet.name}</a>
                  <py:if test="worksheet.assessable">
                    <ul>
                      <li class="${worksheet.complete_class}">
                        Completed ${worksheet.mand_done}/${worksheet.total}${worksheet.optional_message}
                      </li>
                    </ul>
                  </py:if>
                </li>
              </py:for>
            </ul>
            <py:if test="exercises_total > 0">
              <ul>
                <li class="${worksheets_complete_class}">
                  Total exercises completed: ${exercises_done}/${exercises_total} (${exercises_pct}%)
                </li>
              </ul> 
              <p>
                <span style="font-weight: bold;">Mark:</span> ${worksheet_mark}/${worksheet_max_mark}
              </p>
            </py:if>
            <div class="horizontalactions" py:if="'edit_worksheets' in permissions">
              <a class="manageaction" href="${req.publisher.generate(context, None, ('+worksheets', '+edit'))}"> Manage worksheets</a>
              <a class="manageaction" href="/+exercises">Manage exercises</a>
            </div>
          </div>
        </py:choose>
      </div>
    </div>
  </body>
</html>