NEW:
-* add URL form should have same metadata as ELEC form (except for copyright status)
-
-* why are .focus() calls not working properly?
-
-* edit URL item fails with error. KeyError: author2
-
* add Joan's new text
* write up some documentation
-* add/remove individuals in course sites
-
* review CLEW integration. KISS.
+* why are .focus() calls not working properly?
+
+* add/remove individuals in course sites
+
CRITICAL:
IMPORTANT:
* factor out hardcoded references to the EG server.
* add new staff member
+
+* add URL form should have same metadata as ELEC form (except for copyright status)
+
+* edit URL item fails with error. KeyError: author2
+
if request.method != 'POST':
item = models.Item() # dummy object
+ item.item_type = item_type
return g.render('item/item_add_%s.xhtml' % item_type.lower(),
**locals())
else:
--- /dev/null
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:xi="http://www.w3.org/2001/XInclude"
+ xmlns:py="http://genshi.edgewall.org/"
+ py:strip="True">
+<?python
+if bool(item.id):
+ authors = [a.strip() for a in item.author.split(';')]
+else:
+ authors = []
+if len(authors) < 2:
+ authors.extend([''] * (2 - len(authors)))
+
+?>
+ <tbody py:def="common_table()" py:strip="True">
+ <tr><th>Title of document</th><td><input type="text" name="title" value="${item.title}"/></td></tr>
+ <tr><th>Title of source</th><td><input type="text" name="source_title" value="${item.source_title}"/></td></tr>
+ <tr py:for="n, author in enumerate(authors)">
+ <th>Author #${n+1}</th><td><input type="text" name="author${n+1}" value="${author}"/></td>
+ </tr>
+ <tr><th>Publisher</th><td><input type="text" name="publisher" value="${item.publisher}"/></td></tr>
+ <tr><th>Published</th><td><input type="text" name="published" value="${item.published}"/></td></tr>
+ <tr><th>Volume</th><td><input type="text" name="volume" value="${item.volume}"/></td></tr>
+ <tr><th>Issue</th><td><input type="text" name="issue" value="${item.issue}"/></td></tr>
+ <tr><th>Pages</th><td><input type="text" name="pages" value="${item.pages}"/></td></tr>
+ <tr><th>ISBN</th><td><input type="text" name="isbn" value="${item.isbn}"/></td></tr>
+ <tr py:if="user.is_staff and item.item_type == 'ELEC'">
+ <th>Copyright Status</th>
+ <td>
+ <select name="copyright_status">
+ <option py:for="k,v in item.COPYRIGHT_STATUS_CHOICES"
+ py:attrs="{'selected': item.copyright_status==k or None}"
+ value="${k}"
+ py:content="v"/>
+ </select>
+ </td>
+ </tr>
+ </tbody>
+
+</html>
\ No newline at end of file
is_edit = bool(item.id)
title = is_edit and _('Electronic document: Metadata') or _('Add a new electronic document')
site.title = '%s: %s (%s)' % (site.course.code, site.course.name, site.term)
-if is_edit:
- authors = [a.strip() for a in item.author.split(';')]
-else:
- authors = []
-if len(authors) < 2:
- authors.extend([''] * (2 - len(authors)))
?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:py="http://genshi.edgewall.org/">
<xi:include href="../master.xhtml"/>
<xi:include href="../components/site.xhtml"/>
+ <xi:include href="common_metadata.xhtml"/>
<head>
<title>${title}</title>
<script type="text/javascript">
${offer_to_delete(item)}
<h2>${title}</h2>
- <tbody py:def="common_table()" py:strip="True">
- <tr><th>Title of document</th><td><input type="text" name="title" value="${item.title}"/></td></tr>
- <tr><th>Title of source</th><td><input type="text" name="source_title" value="${item.source_title}"/></td></tr>
- <tr py:for="n, author in enumerate(authors)">
- <th>Author #${n+1}</th><td><input type="text" name="author${n+1}" value="${author}"/></td>
- </tr>
- <tr><th>Publisher</th><td><input type="text" name="publisher" value="${item.publisher}"/></td></tr>
- <tr><th>Published</th><td><input type="text" name="published" value="${item.published}"/></td></tr>
- <tr><th>Volume</th><td><input type="text" name="volume" value="${item.volume}"/></td></tr>
- <tr><th>Issue</th><td><input type="text" name="issue" value="${item.issue}"/></td></tr>
- <tr><th>Pages</th><td><input type="text" name="pages" value="${item.pages}"/></td></tr>
- <tr><th>ISBN</th><td><input type="text" name="isbn" value="${item.isbn}"/></td></tr>
- <tr py:if="user.is_staff">
- <th>Copyright Status</th>
- <td>
- <select name="copyright_status">
- <option py:for="k,v in item.COPYRIGHT_STATUS_CHOICES"
- py:attrs="{'selected': item.copyright_status==k or None}"
- value="${k}"
- py:content="v"/>
- </select>
- </td>
- </tr>
- </tbody>
-
<div py:if="not is_edit">
<form action=".?item_type=${item_type}" method="POST"
enctype="multipart/form-data">
<table class="metadata_table">
- ${common_table()}
+ ${common_table(item)}
<tr><th>File</th><td><input type="file" name="file"/></td></tr>
</table>
<p><input type="submit" value="Upload file and Create item"/>
xmlns:py="http://genshi.edgewall.org/">
<xi:include href="../master.xhtml"/>
<xi:include href="../components/site.xhtml"/>
+ <xi:include href="common_metadata.xhtml"/>
<head>
<title>${title}</title>
<script type="text/javascript">
<h2>${title}</h2>
<form action=".?item_type=${item_type}" method="POST">
<table class="metadata_table">
- <tr><th>Title</th><td><input type="text" name="title" value="${item.title}"/></td></tr>
+ <tbody>
<tr><th>URL</th><td><input type="text" name="url" value="${item.url}"/></td></tr>
- <tr><th>Author</th><td><input type="text" name="author"
- value="${item.author}"/></td></tr>
- <tr><th>Publisher</th><td><input type="text" name="publisher"
- value="${item.publisher}"/></td></tr>
- <tr><th>Published</th><td><input type="text" name="published"
- value="${item.published}"/></td></tr>
+ </tbody>
+ ${common_table()}
</table>
<div py:if="item.marcxml">
<p id="marcdatashow"><a href="javascript:void($('#marcdata').toggle());">Display MARC Record</a></p>