-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathassignment.ftl
62 lines (56 loc) · 3.4 KB
/
assignment.ftl
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
<#function escapeAmp str>
<#-- returns a URI-encoded "&"
because we are passing XML in the URI, we have to escape this way -->
<#return str?replace('&', '%26amp%3B')>
</#function>
<#assign itemUuid = xml.get('item/@id')>
<#assign itemversion = xml.get('item/@version')>
<#assign attachments = xml.getAllSubtrees('item/attachments/attachment')>
<#assign powerSearch = 'Pafcc42be-462c-483e-b2ed-98ffcd15ff3d'>
<#if xml.get('local/courseWorkWrapper/submissionType') == "Assignment">
<dl>
<#assign department = xml.get('local/department')>
<#assign division = xml.get('local/division')>
<dt class="hide">Division</dt>
<#assign divisionUrl = "/access/searching.do?in=C1ca1ba6f-e327-4557-9b7e-25e1bba1b359&q=&dr=AFTER">
<dd class="collection">
<#if department != "">
<#assign departmentUrl = '/access/searching.do?doc=%3Cxml%3E%3Clocal%3E%3Cdepartment%3E${department}%3C%2Fdepartment%3E%3C%2Flocal%3E%3C%2Fxml%3E&in=${powerSearch}'>
<a href="${departmentUrl}">${department}</a> |
</#if>
<a href="${divisionUrl}">${division}</a>
</dd>
<#assign title = xml.get('mods/titleInfo/title')>
<h2 id="title">${title}</h2>
<#list xml.getAllSubtrees('local/courseInfo') as courseInfo>
<#assign department = courseInfo.get('department')>
<#assign semester = courseInfo.get('semester')>
<#assign course = courseInfo.get('course')>
<#assign faculty = courseInfo.get('faculty')>
<#assign section = courseInfo.get('section')>
<#assign courseCategory = courseInfo.get('courseCategory')>
<#assign XList = courseInfo.get('XList')>
<#assign courseUrl = "/access/searching.do?doc=%3Cxml%3E%3Clocal%3E%3CcourseInfo%3E%3Ccourse%3E${escapeAmp(course)}%3C%2Fcourse%3E%3C%2FcourseInfo%3E%3C%2Flocal%3E%3C%2Fxml%3E&in=${powerSearch}&q=&dr=AFTER" />
<#assign departmentUrl = "/access/searching.do?doc=%3Cxml%3E%3Clocal%3E%3CcourseInfo%3E%3Cdepartment%3E${department}%3C%2Fdepartment%3E%3C%2FcourseInfo%3E%3C%2Flocal%3E%3C%2Fxml%3E&in=${powerSearch}&q=&dr=AFTER" />
<#assign semesterUrl = "/access/searching.do?doc=%3Cxml%3E%3Clocal%3E%3CcourseInfo%3E%3Csemester%3E${semester}%3C%2Fsemester%3E%3C%2FcourseInfo%3E%3C%2Flocal%3E%3C%2Fxml%3E&in=${powerSearch}&q=&dr=AFTER" />
<#assign facultyUrl = "/access/searching.do?doc=%3Cxml%3E%3Clocal%3E%3CcourseInfo%3E%3Cfaculty%3E${faculty}%3C%2Ffaculty%3E%3C%2FcourseInfo%3E%3C%2Flocal%3E%3C%2Fxml%3E&in=${powerSearch}&q=&dr=AFTER" />
<#assign sectionUrl = "/access/searching.do?doc=%3Cxml%3E%3Clocal%3E%3CcourseInfo%3E%3Csection%3E${section}%3C%2Fsection%3E%3C%2FcourseInfo%3E%3C%2Flocal%3E%3C%2Fxml%3E&in=${powerSearch}&q=&dr=AFTER" />
<#if semester != "" && semester != "undefined">
<span id="coursestuff"><strong>Course</strong>:
<a href="${semesterUrl}">${semester}</a>
— <a href="${departmentUrl}">${department}</a>
— <a href="${courseUrl}">${course}</a>
— <a href="${facultyUrl}">${faculty}</a>
— <a href="${sectionUrl}">${section}</a>
<#if XList != "">
<br>(Cross-listed as ${XList}.)
</#if>
</span>
</#if>
</#list>
<#assign abstract = xml.get('mods/abstract')>
<#if abstract != "">
<dt>Notes</dt>
<dd>${abstract}</dd>
</#if>
</#if>