font-weight: normal;
}
+.metadata_table tbody th,
+.metadata_table tbody td {
+ padding: 8; border: #ddd 1px solid;
+}
+
+.metadata_table tbody th {
+ background-color: #eee;
+}
+
+.metadata_table a.bigdownload { padding: 8 58; font-weight: bold; font-size: 105%; }
+
+h2.metadata_subhead {font-size: 105%; padding: 0; margin: 18 0 9 0;}
+
+.metadata_table tbody th {
+ text-align: left; width: 120;
+}
.gap { height: 24; }
/* panels that appear when specific OPTIONs or radio-buttons are selected. */
.specific { padding: 8; margin: 0 16; background-color: #eef; }
-li.sort_item { margin-top: 20px !important;
+li.sort_item { margin-top: 20px} !important;
border: gray 1px dotted; width: 400; }
li.sort_item:hover { background-color: #eee; }
def needs_meta_link(self):
"""Should an 'About' link be displayed for this item?"""
- return self.item_type in ('ELEC', 'URL')
+ return self.item_type in ('ELEC', 'URL', 'PHYS')
def item_url(self, suffix='', force_local_url=False):
if self.item_type == 'ELEC' and suffix == '':
<!-- !I'm really sorry, this is ugly, but I want
non-breaking spaces here, so that on long-named items,
the links will stay togeter. A better way? -->
- <span py:if="item.needs_meta_link()"><a href="${item.item_url('meta')}">about</a> </span><span py:if="edit">• <a href="${item.item_url('edit/')}">edit</a></span><span py:if="edit"> • <a href="${item.item_url('relocate/')}">put under heading</a></span>
+ <span py:if="item.needs_meta_link()"><a href="${item.item_url('meta')}">about</a> </span><span py:if="edit">• <a href="${item.item_url('edit/')}">edit</a></span><span py:if="edit"> • <a href="${item.item_url('relocate/')}">put under heading</a></span>
</span>
</div>
<!-- !to show a full tree, uncomment the following: -->
course_title = '%s: %s (%s)' % (course.code, course.title, course.term)
hier = item.hierarchy()[:-1]
title = item.title
+metadata = item.metadata_set.all()
?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xi="http://www.w3.org/2001/XInclude"
<body>
${course_banner(course)}
${nested_title(item)}
-
- <table>
+ <table class="metadata_table" style="margin-top: 1em;">
<tr><th>Title</th><td>${item.title}</td></tr>
- <tr><th>Type</th><td>${item.item_type}</td></tr>
+ <tr><th>Type</th><td>${item.get_item_type_display()}</td></tr>
<tr py:if="item.url"><th>URL</th><td><a href="${item.url}">${item.url}</a></td></tr>
</table>
<div py:if="item.item_type=='ELEC'">
- <p><a href="${item.item_url()}">Download</a></p>
- <table>
+ <h2 class="metadata_subhead">Attached document</h2>
+ <table class="metadata_table">
<tr><th>Content type</th><td>${item.fileobj_mimetype}</td></tr>
- <tr><th>Content length</th><td>${item.fileobj.size}</td></tr>
+ <tr><th>Size</th><td>${item.fileobj.size} bytes</td></tr>
+ <tr><th/><td><a class="bigdownload" href="${item.item_url()}">Download</a></td></tr>
</table>
</div>
-
- <table>
- <tr py:for="attr in item.metadata_set.all()">
- <th>${attr.get_name_display()}</th><td>${attr.value}</td>
- </tr>
- </table>
+ <div py:if="metadata">
+ <h2 class="metadata_subhead">Additional metadata</h2>
+ <table class="metadata_table">
+ <tr py:for="attr in metadata">
+ <th>${attr.get_name_display()}</th><td>${attr.value}</td>
+ </tr>
+ </table>
+ </div>
</body>
</html>