text-align: left; width: 120px;
}
.gap { height: 24px; }
+.metadata_table td { max-width: 800px; overflow: hidden; }
/* panels that appear when specific OPTIONs or radio-buttons are selected. */
.specific { padding: 8px; margin: 0 16px; background-color: #eef; }
(r'^phys/checkout/$', 'phys_checkout'),
(r'^phys/mark_arrived/$', 'phys_mark_arrived'),
(r'^phys/mark_arrived/match/$', 'phys_mark_arrived_match'),
+ (r'^phys/circlist/$', 'phys_circlist'),
(r'^course/(?P<course_id>\d+)/reseq$', 'course_reseq'),
(ITEM_PREFIX + r'reseq', 'item_heading_reseq'),
item.metadata_set.create(name='syrup:barcode', value=barcode)
item.save()
return g.render('phys/mark_arrived_outcome.xhtml')
+
+@admin_only
+def phys_circlist(request):
+ term_code = request.GET.get('term')
+ if not term_code:
+ terms = models.Term.objects.order_by('code')
+ return g.render('phys/circlist_index.xhtml', terms=terms)
+
+ term = get_object_or_404(models.Term, code=term_code)
+
+ # gather the list of wanted items for this term.
+ # Fixme, I need a better way.
+
+ cursor = django.db.connection.cursor()
+ q = "select item_id from syrup_metadata where name='syrup:barcode'"
+ cursor.execute(q)
+ bad_ids = set([r[0] for r in cursor.fetchall()])
+ cursor.close()
+
+ wanted = models.Item.objects.filter(
+ item_type='PHYS', course__term=term).select_related('metadata')
+ wanted = [w for w in wanted if w.id not in bad_ids]
+ return g.render('phys/circlist_for_term.xhtml',
+ term=term,
+ wanted=wanted)
+
+
--- /dev/null
+<?python
+title = _('Wanted items: %s') % term
+from conifer.libsystems.z3950.marcxml import marcxml_dictionary_to_dc as to_dublin
+dc_keys = ['dc:title', 'dc:creator', 'dc:publisher', 'dc:date']
+?>
+<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"/>
+<head>
+ <title>${title}</title>
+</head>
+<body>
+ <h1>${title}</h1>
+
+<table class="pagetable">
+ <thead>
+ <tr><th>#</th><th>Title</th><th>Author</th><th>Publisher</th><th>PubDate</th></tr>
+ </thead>
+ <tbody py:for="resultnum, res in enumerate(w.marc() for w in wanted)"
+ py:with="dc=to_dublin(res)">
+ <tr>
+ <td>${resultnum+1}.</td>
+ <td>
+ ${dc.get('dc:title', '???')}
+ <a href="javascript:$('#full_${resultnum}').toggle(); void(0);">details</a>
+ <p py:if="res.get('8569')" style="margin: 8px 0; font-size: 90%; color: darkred;">
+ Electronic resource. <a href="${res.get('856u')}">view</a>
+ </p>
+ </td>
+ <td py:for="k in dc_keys[1:]">${dc.get(k) or '—'}</td>
+ </tr>
+ <tr id="full_${resultnum}" style="display: none;">
+ <td colspan="5" style="padding-left: 36;">
+ <table class="metadata_table">
+ <?python allkeys = res.keys(); allkeys.sort(); ?>
+ <tr py:for="k in allkeys">
+ <th>${k}</th><td>${res[k]}</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+
+</body>
+</html>
--- /dev/null
+<?python
+title = _('Notify Circulation of wanted items')
+?>
+<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"/>
+<head>
+ <title>${title}</title>
+</head>
+<body>
+ <h1>${title}</h1>
+ <p>Please select a term:</p>
+ <form action="." method="GET">
+ <select name="term">
+ <option py:for="term in terms" value="${term.code}">${term}</option>
+ </select>
+ <input type="submit" value="Continue"/>
+ </form>
+</body>
+</html>