[open-ils-commits] r1190 - in servres/trunk/conifer: integration syrup templates templates/components (artunit)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Jan 11 23:42:28 EST 2011
Author: artunit
Date: 2011-01-11 23:42:25 -0500 (Tue, 11 Jan 2011)
New Revision: 1190
Modified:
servres/trunk/conifer/integration/uwindsor.py
servres/trunk/conifer/syrup/models.py
servres/trunk/conifer/templates/components/site.xhtml
servres/trunk/conifer/templates/site_detail.xhtml
Log:
display loan duration, change div to span for IE madness
Modified: servres/trunk/conifer/integration/uwindsor.py
===================================================================
--- servres/trunk/conifer/integration/uwindsor.py 2011-01-11 04:01:23 UTC (rev 1189)
+++ servres/trunk/conifer/integration/uwindsor.py 2011-01-12 04:42:25 UTC (rev 1190)
@@ -105,6 +105,7 @@
lib = desk = avail = 0
dueinfo = ''
callno = ''
+ circmod = ''
for org, callnum, loc, stats in counts:
if len(callno) == 0:
callno = callnum
@@ -123,12 +124,14 @@
we want to return the resource that will be returned first if
already checked out
"""
- if loc == RESERVES_DESK_NAME and avail == 0:
- for copyid in copyids:
- circinfo = E1(OPENSRF_FLESHED2_CALL, copyid)
- circs = circinfo.get("circulations")
- if circs and avail==0:
- if len(circs) > 0:
+ for copyid in copyids:
+ circinfo = E1(OPENSRF_FLESHED2_CALL, copyid)
+ if loc == RESERVES_DESK_NAME:
+ if len(circmod) == 0:
+ circmod = circinfo.get("circ_modifier")
+ if avail == 0:
+ circs = circinfo.get("circulations")
+ if circs and len(circs) > 0:
circ = circs[0]
rawdate = circ.get("due_date")
#remove offset info, %z is flakey for some reason
@@ -143,7 +146,7 @@
dueinfo = time.strftime(DUE_FORMAT,earliestdue)
callno = callnum
- return (lib, desk, avail, callno, dueinfo)
+ return (lib, desk, avail, callno, dueinfo, circmod)
except:
print "due date/call problem: ", bib_id
print "*** print_exc:"
Modified: servres/trunk/conifer/syrup/models.py
===================================================================
--- servres/trunk/conifer/syrup/models.py 2011-01-11 04:01:23 UTC (rev 1189)
+++ servres/trunk/conifer/syrup/models.py 2011-01-12 04:42:25 UTC (rev 1190)
@@ -750,7 +750,7 @@
if not stat:
return (False, 'Status information not available.')
else:
- lib, desk, avail, callno, dueinfo = stat
+ lib, desk, avail, callno, dueinfo, circmod = stat
return (avail > 0,
'%d of %d copies available at reserves desk; '
'%d total copies in library system'
Modified: servres/trunk/conifer/templates/components/site.xhtml
===================================================================
--- servres/trunk/conifer/templates/components/site.xhtml 2011-01-11 04:01:23 UTC (rev 1189)
+++ servres/trunk/conifer/templates/components/site.xhtml 2011-01-12 04:42:25 UTC (rev 1190)
@@ -39,11 +39,25 @@
?>
<div class="availability" py:if="item.item_type == 'PHYS'">
<a href="${item.item_url()}">
- <div py:if="valid" py:with="(_lib, _desk, _avail, _callno, _dueinfo) = stat"
+ <div py:if="valid" py:with="(_lib, _desk, _avail, _callno, _dueinfo, _circmod) = stat"
class="${_avail > 0 and 'available' or 'unavailable'}"
title="${_avail} of ${_desk} copies available at reserves desk; ${_lib} total copies in library system">
<div>${_avail and 'Available' or 'Unavailable'} (${_avail}/${_desk})</div>
<div py:if="_dueinfo">DUE: ${_dueinfo}</div>
+ <div py:if="_circmod">
+ <span py:if="_circmod == 'RSV2'">2 Hour Loan</span>
+ <span py:if="_circmod == 'RSV3'">3 Hour Loan</span>
+ <span py:if="_circmod == 'RSV4'">4 Hour Loan</span>
+ <span py:if="_circmod == 'RSV7'">7 Hour Loan</span>
+ <span py:if="_circmod == 'RESERVE 1 DAY'">1 Day Loan</span>
+ <span py:if="_circmod == 'RESERVE 1 HOUR'">1 Hour Loan</span>
+ <span py:if="_circmod == 'RESERVE 14 DAY'">14 Day Loan</span>
+ <span py:if="_circmod == 'RESERVE 2 DAY'">2 Day Loan</span>
+ <span py:if="_circmod == 'RESERVE 2 HOUR'">2 Hour Loan</span>
+ <span py:if="_circmod == 'RESERVE 3 DAY'">3 Day Loan</span>
+ <span py:if="_circmod == 'RESERVE 4 HOUR'">4 Hour Loan</span>
+ <span py:if="_circmod == 'RESERVE 7 DAY'">7 Day Loan</span>
+ </div>
<div class="callnumber">${_callno}</div>
</div>
<div py:if="not valid" class="unavailable">
Modified: servres/trunk/conifer/templates/site_detail.xhtml
===================================================================
--- servres/trunk/conifer/templates/site_detail.xhtml 2011-01-11 04:01:23 UTC (rev 1189)
+++ servres/trunk/conifer/templates/site_detail.xhtml 2011-01-12 04:42:25 UTC (rev 1190)
@@ -30,9 +30,10 @@
<p py:if="not item_tree">
There are no items associated with this site yet.
</p>
- <div id="treepanel">
+ <!-- possible fix for outrageous spacing in IE 8 -->
+ <span id="treepanel">
${show_tree(item_tree, edit=is_editor)}
- </div>
+ </span>
<div py:if="is_editor">${add_subs()}</div>
More information about the open-ils-commits
mailing list