From a8b519d0c782384fc3a64ae8da68afb35ab3e16a Mon Sep 17 00:00:00 2001 From: gfawcett Date: Tue, 28 Dec 2010 20:58:37 +0000 Subject: [PATCH] ELEC and URL items both have extended (ERes-like) metadata. git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@1137 6d9bc8c9-1ec2-4278-b937-99fde70a366f --- conifer/TODO | 17 ++++++------ conifer/syrup/views/items.py | 1 + conifer/templates/item/common_metadata.xhtml | 39 ++++++++++++++++++++++++++++ conifer/templates/item/item_add_elec.xhtml | 34 ++---------------------- conifer/templates/item/item_add_url.xhtml | 11 +++----- 5 files changed, 55 insertions(+), 47 deletions(-) create mode 100644 conifer/templates/item/common_metadata.xhtml diff --git a/conifer/TODO b/conifer/TODO index 73c9f2d..ed81f48 100644 --- a/conifer/TODO +++ b/conifer/TODO @@ -1,19 +1,15 @@ NEW: -* add URL form should have same metadata as ELEC form (except for copyright status) - -* why are .focus() calls not working properly? - -* edit URL item fails with error. KeyError: author2 - * add Joan's new text * write up some documentation -* add/remove individuals in course sites - * review CLEW integration. KISS. +* why are .focus() calls not working properly? + +* add/remove individuals in course sites + CRITICAL: IMPORTANT: @@ -76,3 +72,8 @@ RECENTLY DONE: * factor out hardcoded references to the EG server. * add new staff member + +* add URL form should have same metadata as ELEC form (except for copyright status) + +* edit URL item fails with error. KeyError: author2 + diff --git a/conifer/syrup/views/items.py b/conifer/syrup/views/items.py index 4e4ffdd..0aa34eb 100644 --- a/conifer/syrup/views/items.py +++ b/conifer/syrup/views/items.py @@ -88,6 +88,7 @@ def item_add(request, site_id, item_id): if request.method != 'POST': item = models.Item() # dummy object + item.item_type = item_type return g.render('item/item_add_%s.xhtml' % item_type.lower(), **locals()) else: diff --git a/conifer/templates/item/common_metadata.xhtml b/conifer/templates/item/common_metadata.xhtml new file mode 100644 index 0000000..819ffde --- /dev/null +++ b/conifer/templates/item/common_metadata.xhtml @@ -0,0 +1,39 @@ + + + + Title of document + Title of source + + Author #${n+1} + + Publisher + Published + Volume + Issue + Pages + ISBN + + Copyright Status + + + + + + + \ No newline at end of file diff --git a/conifer/templates/item/item_add_elec.xhtml b/conifer/templates/item/item_add_elec.xhtml index e9ca402..4149c1c 100644 --- a/conifer/templates/item/item_add_elec.xhtml +++ b/conifer/templates/item/item_add_elec.xhtml @@ -2,18 +2,13 @@ is_edit = bool(item.id) title = is_edit and _('Electronic document: Metadata') or _('Add a new electronic document') site.title = '%s: %s (%s)' % (site.course.code, site.course.name, site.term) -if is_edit: - authors = [a.strip() for a in item.author.split(';')] -else: - authors = [] -if len(authors) < 2: - authors.extend([''] * (2 - len(authors))) ?> + ${title}