From: gfawcett Date: Thu, 6 Jan 2011 02:35:59 +0000 (+0000) Subject: for physical video items, display the video type. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f933bb751e0a65262fcda23d43343dfc54645409;p=syrup%2Fmasslnc.git for physical video items, display the video type. git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@1163 6d9bc8c9-1ec2-4278-b937-99fde70a366f --- diff --git a/conifer/TODO b/conifer/TODO index 5f0319d..3560aa3 100644 --- a/conifer/TODO +++ b/conifer/TODO @@ -2,8 +2,6 @@ NEW: * add/remove individuals in course sites -* make sure volume, issue, source title, etc. are exposed over unAPI. - * make "DVD" and other media types obvious (icons, explicit descriptions, etc.) * bookbag-URL search should import all items from the bookbag (if they don't already exist) @@ -113,3 +111,5 @@ RECENTLY DONE: * repair unAPI -- it seems broken on SHOWCASE (it was just not working for non-physical items) +* make sure volume, issue, source title, etc. are exposed over unAPI. + diff --git a/conifer/libsystems/marcxml.py b/conifer/libsystems/marcxml.py index 9292b0a..23c2f92 100644 --- a/conifer/libsystems/marcxml.py +++ b/conifer/libsystems/marcxml.py @@ -26,6 +26,9 @@ def marcxml_to_records(rec): def record_to_dictionary(rec, multiples=True): tree = _to_tree(rec) dct = {} + for cf in tree.findall('{http://www.loc.gov/MARC21/slim}controlfield'): + t = cf.attrib['tag'] + dct.setdefault(t, []).append(cf.text) for df in tree.findall('{http://www.loc.gov/MARC21/slim}datafield'): t = df.attrib['tag'] for sf in df.findall('{http://www.loc.gov/MARC21/slim}subfield'): @@ -47,6 +50,9 @@ def marcxml_to_dictionary(rec, multiples=False): out = [] for r in records: dct = {} + for cf in r.findall('{http://www.loc.gov/MARC21/slim}controlfield'): + t = cf.attrib['tag'] + dct.setdefault(t, []).append(cf.text) for df in r.findall('{http://www.loc.gov/MARC21/slim}datafield'): t = df.attrib['tag'] for sf in df.findall('{http://www.loc.gov/MARC21/slim}subfield'): diff --git a/conifer/static/main.css b/conifer/static/main.css index 964509c..06a831c 100644 --- a/conifer/static/main.css +++ b/conifer/static/main.css @@ -244,6 +244,8 @@ li.item_HEADING .headingmainline a.mainlink:hover { list-style-image: url(tango/x-office-address-book.png); } +.itemtree li .videotype { font-weight: bold; font-size: 90%; } + .itemtree li.forbidden { background-color: #fdd; } diff --git a/conifer/syrup/models.py b/conifer/syrup/models.py index dd7f645..076783c 100644 --- a/conifer/syrup/models.py +++ b/conifer/syrup/models.py @@ -744,6 +744,20 @@ class Item(BaseModel): '%d total copies in library system' % (avail, desk, lib)) + _video_type_re = re.compile(r'tag="007">v(.)') + _video_types = {'c':'videocartridge', + 'd':'videodisc', + 'f':'videocassette', + 'r':'videoreel', + 'z':'video, other format'} + def video_type(self): + if not self.marcxml: + return None + m = self._video_type_re.search(self.marcxml) + if m: + vtype = m.group(1) + return self._video_types.get(vtype, 'video, unknown format') + # TODO: stuff I'm not sure about yet. I don't think it belongs here. def title_hl(self, terms): diff --git a/conifer/templates/components/site.xhtml b/conifer/templates/components/site.xhtml index 7d9cc92..bc142f0 100644 --- a/conifer/templates/components/site.xhtml +++ b/conifer/templates/components/site.xhtml @@ -53,6 +53,7 @@ searchtext = _('search this site...') ${item}
+ [${vt}] ${item.author}. (${item.published}). ${item.source_title}. diff --git a/conifer/templates/item/item_metadata.xhtml b/conifer/templates/item/item_metadata.xhtml index bda6bf7..6a56a84 100644 --- a/conifer/templates/item/item_metadata.xhtml +++ b/conifer/templates/item/item_metadata.xhtml @@ -4,6 +4,7 @@ site_title = '%s: %s (%s)' % (site.course.code, site.course.name, site.term) hier = item.hierarchy()[:-1] title = item.title is_editor = site.can_edit(request.user) +vidtype = item.video_type() ?> Title${item.title} Title of source${item.source_title} + Format${vidtype} Author(s)${item.author} Publisher${item.publisher} Published${item.published}