From: gfawcett Date: Thu, 7 May 2009 00:15:54 +0000 (+0000) Subject: added preliminary 'Notify circ of wanted items' screen. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=85ee93d84f6383a3e7dfc2ca407b62e7fe506d08;p=syrup%2Fmasslnc.git added preliminary 'Notify circ of wanted items' screen. More work to be done on the backend query, as well as on the display and possible export-format of data for circ. git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@460 6d9bc8c9-1ec2-4278-b937-99fde70a366f --- diff --git a/conifer/static/main.css b/conifer/static/main.css index 4cf795d..735db0f 100644 --- a/conifer/static/main.css +++ b/conifer/static/main.css @@ -318,6 +318,7 @@ h2.metadata_subhead {font-size: 105%; padding: 0; margin: 18px 0 9px 0;} 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; } diff --git a/conifer/syrup/urls.py b/conifer/syrup/urls.py index cbcf027..db5f854 100644 --- a/conifer/syrup/urls.py +++ b/conifer/syrup/urls.py @@ -51,6 +51,7 @@ urlpatterns = patterns('conifer.syrup.views', (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\d+)/reseq$', 'course_reseq'), (ITEM_PREFIX + r'reseq', 'item_heading_reseq'), diff --git a/conifer/syrup/views/items.py b/conifer/syrup/views/items.py index 230565f..0533213 100644 --- a/conifer/syrup/views/items.py +++ b/conifer/syrup/views/items.py @@ -481,3 +481,30 @@ def phys_mark_arrived_match(request): 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) + + diff --git a/conifer/templates/phys/circlist_for_term.xhtml b/conifer/templates/phys/circlist_for_term.xhtml new file mode 100644 index 0000000..96ea362 --- /dev/null +++ b/conifer/templates/phys/circlist_for_term.xhtml @@ -0,0 +1,47 @@ + + + + + ${title} + + +

${title}

+ + + + + + + + + + + + + + + +
#TitleAuthorPublisherPubDate
${resultnum+1}. + ${dc.get('dc:title', '???')} + details +

+ Electronic resource. view +

+
${dc.get(k) or '—'}
+ + + diff --git a/conifer/templates/phys/circlist_index.xhtml b/conifer/templates/phys/circlist_index.xhtml new file mode 100644 index 0000000..363926a --- /dev/null +++ b/conifer/templates/phys/circlist_index.xhtml @@ -0,0 +1,21 @@ + + + + + ${title} + + +

${title}

+

Please select a term:

+
+ + +
+ +