[open-ils-commits] r8269 - in
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb:
controllers public/oils/media/css/skin
public/oils/media/css/theme templates/oils/default/acq
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Dec 21 11:56:05 EST 2007
Author: erickson
Date: 2007-12-21 11:34:06 -0500 (Fri, 21 Dec 2007)
New Revision: 8269
Added:
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist.html
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/record_list.html
Modified:
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/controllers/acq.py
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/acq_default.css
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/theme/acq_default.css
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/pl_builder.html
Log:
added rudimentary picklist interface. just prints what is going in for now..
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/controllers/acq.py
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/controllers/acq.py 2007-12-21 15:23:11 UTC (rev 8268)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/controllers/acq.py 2007-12-21 16:34:06 UTC (rev 8269)
@@ -21,6 +21,7 @@
self.search_cache_key = ContextItem(cgi_name='acq.sk')
self.record_id = ContextItem(cgi_name='acq.r')
self.record = ContextItem(cgi_name='acq.r')
+ self.picklist_item = ContextItem(cgi_name='acq.pi', multi=True)
Context.applySubContext('acq', AcqContext)
@@ -84,14 +85,38 @@
cache_key = c.oils.acq.search_cache_key
results = osrf.cache.CacheClient().get(cache_key)
- for res in results:
- for rec in res['records']:
- if str(rec['cache_id']) == str(rec_id):
- c.oils.acq.record = rec
- #c.oils.acq.record_html = oilsweb.lib.bib.marc_to_html(rec['marcxml'])
- return render('oils/%s/acq/rdetails.html' % c.oils.core.skin)
+ rec = self._find_cached_record(results, rec_id)
+ if rec:
+ c.oils.acq.record = rec
+ #c.oils.acq.record_html = oilsweb.lib.bib.marc_to_html(rec['marcxml'])
+ return render('oils/%s/acq/rdetails.html' % c.oils.core.skin)
return 'exception -> no record'
+ def create_picklist(self):
+ ctx = oilsweb.lib.context.Context.init(request)
+ if not isinstance(ctx.acq.picklist_item, list):
+ ctx.acq.picklist_item = [ctx.acq.picklist_item]
+ results = osrf.cache.CacheClient().get(ctx.acq.search_cache_key)
+ records = []
+ for cache_id in ctx.acq.picklist_item:
+ rec = self._find_cached_record(results, cache_id)
+ records.append(rec)
+ log.debug('pi = ' + unicode(cache_id))
+
+ c.oils_acq_records = records
+ ctx.scrub_isbn = oilsweb.lib.bib.scrub_isbn # XXX add more generically to the context object
+ ctx.acq.extract_bib_field = oilsweb.lib.acq.search.extract_bib_field
+ c.oils = ctx
+ return render('oils/%s/acq/picklist.html' % c.oils.core.skin)
+
+ return "PL"
+
+ def _find_cached_record(self, results, cache_id):
+ for res in results:
+ for rec in res['records']:
+ if str(rec['cache_id']) == str(cache_id):
+ return rec
+
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/acq_default.css
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/acq_default.css 2007-12-21 15:23:11 UTC (rev 8268)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/acq_default.css 2007-12-21 16:34:06 UTC (rev 8269)
@@ -10,9 +10,9 @@
.oils-acq-search-form-input {}
#oils-acq-pl_builder-table td {}
-.oils-acq-pl_builder-records-jacket { width: 42px; height: 54px; padding-left: 10px; }
-.oils-acq-pl_builder-records-title-row {}
-.oils-acq-pl_builder-records-author-row td { padding-left: 30px; }
-.oils-acq-pl_builder-records-phys_desc-row td { padding-left: 30px; }
-.oils-acq-pl_builder-records-phys_desc-row {}
+.oils-acq-record_list-records-jacket { width: 42px; height: 54px; padding-left: 10px; }
+.oils-acq-record_list-records-title-row {}
+.oils-acq-record_list-records-author-row td { padding-left: 30px; }
+.oils-acq-record_list-records-phys_desc-row td { padding-left: 30px; }
+.oils-acq-record_list-records-phys_desc-row {}
#oils-acq-rdetail-marc-block { margin-top: 10px; padding: 10px; }
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/theme/acq_default.css
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/theme/acq_default.css 2007-12-21 15:23:11 UTC (rev 8268)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/theme/acq_default.css 2007-12-21 16:34:06 UTC (rev 8269)
@@ -9,3 +9,6 @@
#oils-acq-pl_builder-table thead td { font-weight: bold; }
#oils-acq-pl_builder-table td { border-bottom: 1px solid #808080;}
#oils-acq-rdetail-marc-block { border-top: 1px solid #808080; }
+.oils-acq-record_list-picklist-td { background: #D0D0D0; }
+.oils-acq-record_list-records-service-td { font-size: 85%; }
+#oils-acq-pl_builder-picklist-submit { text-align: right; }
Added: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist.html
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist.html (rev 0)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist.html 2007-12-21 16:34:06 UTC (rev 8269)
@@ -0,0 +1,31 @@
+<%inherit file='../base.html'/>
+<%def name="block_title()">${_('Evergreen ACQ Picklist')}</%def>
+<%def name="block_content()">
+<div>Building picklist with...</div>
+<table>
+ % for rec in c.oils_acq_records:
+ <tr class='oils-acq-record_list-records-title-row'>
+ <td rowspan='3'>
+ <img class='oils-acq-record_list-records-jacket'
+ src='${c.oils.core.ac_prefix}/jacket/small/${c.oils.scrub_isbn(c.oils.acq.extract_bib_field(rec,"isbns.isbn"))}'/>
+ </td>
+ <td>
+ <a href='rdetails?${c.oils.make_query_string()}&${c.oils.acq.record_id_.cgi_name}=${rec["cache_id"]}&${c.oils.acq.search_cache_key_.cgi_name}=${c.oils.acq.search_cache_key}'>${c.oils.acq.extract_bib_field(rec, 'title')}</a>
+ </td>
+ <td class='oils-acq-record_list-records-service-td'>--source info--</td>
+ </tr>
+
+ </tr>
+ <tr class='oils-acq-record_list-records-author-row'>
+ <td colspan='4'>${c.oils.acq.extract_bib_field(rec, 'author')}</td>
+ </tr>
+ <tr class='oils-acq-record_list-records-phys_desc-row'>
+ <td colspan='4'>
+ ${c.oils.scrub_isbn(c.oils.acq.extract_bib_field(rec, 'isbns.isbn'))} |
+ ${c.oils.acq.extract_bib_field(rec, 'pubdate')} |
+ ${c.oils.acq.extract_bib_field(rec, 'physicalSize')}
+ </td>
+ </tr>
+ % endfor
+</table>
+</%def>
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/pl_builder.html
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/pl_builder.html 2007-12-21 15:23:11 UTC (rev 8268)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/pl_builder.html 2007-12-21 16:34:06 UTC (rev 8269)
@@ -1,6 +1,8 @@
<%inherit file='../base.html'/>
<%def name="block_title()">${_('Evergreen Acquisitions Results')}</%def>
<%def name="block_content()">
+ <form action='create_picklist' method='GET'>
+ <input type='hidden' name='${c.oils.acq.search_cache_key_.cgi_name}' value='${c.oils.acq.search_cache_key}'/>
<table id='oils-acq-pl_builder-table'>
<!--
<thead>
@@ -8,6 +10,8 @@
</thead>
-->
<tbody>
+ <%include file="record_list.html"/>
+ <!--
% for res in c.oils_acq_records:
% for rec in res['records']:
<tr class='oils-acq-pl_builder-records-title-row'>
@@ -18,22 +22,33 @@
<td>
<a href='rdetails?${c.oils.make_query_string()}&${c.oils.acq.record_id_.cgi_name}=${rec["cache_id"]}&${c.oils.acq.search_cache_key_.cgi_name}=${c.oils.acq.search_cache_key}'>${c.oils.acq.extract_bib_field(rec, 'title')}</a>
</td>
- <td>${c.oils.scrub_isbn(c.oils.acq.extract_bib_field(rec, 'isbns.isbn'))}</td>
- <td>${res['service']}</td>
+ <td class='oils-acq-pl_builder-records-service-td'>${res['service']}</td>
+ <td rowspan='3' class='oils-acq-pl_builder-picklist-td' >
+ <input type='checkbox'
+ name='${c.oils.acq.picklist_item_.cgi_name}'
+ value='${rec["cache_id"]}:${c.oils.acq.search_cache_key}'/>
</tr>
</tr>
<tr class='oils-acq-pl_builder-records-author-row'>
- <td colspan='3'>${c.oils.acq.extract_bib_field(rec, 'author')}</td>
+ <td colspan='4'>${c.oils.acq.extract_bib_field(rec, 'author')}</td>
</tr>
<tr class='oils-acq-pl_builder-records-phys_desc-row'>
- <td colspan='3'>
+ <td colspan='4'>
+ ${c.oils.scrub_isbn(c.oils.acq.extract_bib_field(rec, 'isbns.isbn'))} |
${c.oils.acq.extract_bib_field(rec, 'pubdate')} |
${c.oils.acq.extract_bib_field(rec, 'physicalSize')}
</td>
</tr>
% endfor
% endfor
+ -->
+ <tr>
+ <td colspan='4' id='oils-acq-pl_builder-picklist-submit'>
+ <input type='submit' value='${_("Add to Picklist")}'/>
+ </td>
+ </tr>
</tbody>
</table>
+ </form>
</%def>
Added: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/record_list.html
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/record_list.html (rev 0)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/record_list.html 2007-12-21 16:34:06 UTC (rev 8269)
@@ -0,0 +1,31 @@
+% for res in c.oils_acq_records:
+ % for rec in res['records']:
+ <tr class='oils-acq-record_list-records-title-row'>
+ <td rowspan='3'>
+ <img class='oils-acq-record_list-records-jacket'
+ src='${c.oils.core.ac_prefix}/jacket/small/${c.oils.scrub_isbn(c.oils.acq.extract_bib_field(rec,"isbns.isbn"))}'/>
+ </td>
+ <td>
+ <a href='rdetails?${c.oils.make_query_string()}&${c.oils.acq.record_id_.cgi_name}=${rec["cache_id"]}&${c.oils.acq.search_cache_key_.cgi_name}=${c.oils.acq.search_cache_key}'>${c.oils.acq.extract_bib_field(rec, 'title')}</a>
+ </td>
+ <td class='oils-acq-record_list-records-service-td'>${res['service']}</td>
+ <td rowspan='3' class='oils-acq-record_list-picklist-td' >
+ <input type='checkbox'
+ name='${c.oils.acq.picklist_item_.cgi_name}'
+ value='${rec["cache_id"]}'/>
+ </tr>
+
+ </tr>
+ <tr class='oils-acq-record_list-records-author-row'>
+ <td colspan='4'>${c.oils.acq.extract_bib_field(rec, 'author')}</td>
+ </tr>
+ <tr class='oils-acq-record_list-records-phys_desc-row'>
+ <td colspan='4'>
+ ${c.oils.scrub_isbn(c.oils.acq.extract_bib_field(rec, 'isbns.isbn'))} |
+ ${c.oils.acq.extract_bib_field(rec, 'pubdate')} |
+ ${c.oils.acq.extract_bib_field(rec, 'physicalSize')}
+ </td>
+ </tr>
+ % endfor
+% endfor
+
More information about the open-ils-commits
mailing list