@memoize(timeout=CACHE_TIME)
def _item_status(self, bib_id):
def sort_out_status(counts, version, sort_lib, sort_desk, sort_avail,
- sort_callno, sort_dueinfo, sort_circmod, sort_alldues):
+ sort_callno, sort_dueinfo, sort_circmod, sort_alldues, prefix, suffix):
lib = sort_lib
desk = sort_desk
callsuffix = ''
if len(callno) == 0:
callno = callnum
+
+ if prefix:
+ callno = prefix + callno
+ if suffix:
+ callno = callno + suffix
avail_here = stats.get(self.AVAILABLE, 0)
avail_here += stats.get(self.RESHELVING, 0)
anystatus_here = sum(stats.values())
#TODO: clean this up, a hackish workaround for now
if version >= 2.1:
- for org, skip1, callnum, skip2, loc, stats in counts:
+ for org, prefix, callnum, suffix, loc, stats in counts:
+ if len(prefix) > 0:
+ prefix += ' '
+ if len(suffix) > 0:
+ suffix = ' ' + suffix
lib, desk, avail, callno, dueinfo, circmod, alldues = sort_out_status(counts,
- version, lib, desk, avail, callno, dueinfo, circmod, alldues)
+ version, lib, desk, avail, callno, dueinfo, circmod, alldues, prefix, suffix)
else:
for org, callnum, loc, stats in counts:
lib, desk, avail, callno, dueinfo, circmod, alldues = sort_out_status(counts,
<span py:if="item.source_title"><i>${item.source_title}.</i></span>
<span py:if="item.volume or item.issue"><i>${item.volume}</i>(${item.issue}), ${item.pages}.</span>
<div py:if="edit and user.is_staff">
- <span><i>Source: </i></span>
- <span py:if="item.circ_modifier">${item.circ_modifier}, </span>
- <span py:if="item.orig_prefix">${item.orig_prefix}, </span>
- <span py:if="item.orig_callno">${item.orig_callno}, </span>
- <span py:if="item.orig_suffix">${item.orig_suffix}, </span>
- <span py:if="item.circ_desk">desk - ${item.circ_desk}</span>
+ <span><i>Revert Parms: </i></span>
+ <span py:for="k,v in item.CALLNO_PREFIX_CHOICES">
+ <span py:if="int(item.orig_prefix)==int(k)">
+ ${v}
+ </span>
+ </span>
+ <span py:if="item.orig_callno">${item.orig_callno}</span>
+ <span py:for="k,v in item.CALLNO_SUFFIX_CHOICES">
+ <span py:if="int(item.orig_suffix)==int(k)">
+ ${v}
+ </span>
+ </span>
+ <span py:if="item.circ_modifier">(${item.circ_modifier}) </span>
+ <span py:for="k,v in item.CIRC_DESK_CHOICES">
+ <span py:if="item.circ_desk==k">
+ ${v}
+ </span>
+ </span>
</div>
</div>
<div class="forbidden_notice" py:if="forbidden">Awaiting copyright clearance: Not available to students.</div>
</span>
</div>
</div>
- <!-- !to show a full tree, uncomment the following: -->
+ <!-- !to hide the full tree, comment the following: -->
${show_tree(subs, edit)}
</li>
</span>