[open-ils-commits] r8278 - in
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb:
controllers lib public/oils/media/css/skin
public/oils/media/css/theme templates/oils/default
templates/oils/default/acq
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Dec 26 12:46:21 EST 2007
Author: erickson
Date: 2007-12-26 12:23:44 -0500 (Wed, 26 Dec 2007)
New Revision: 8278
Modified:
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/controllers/acq.py
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/lib/__init__.py
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/lib/context.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/skin/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/picklist.html
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/record_list.html
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/header.html
Log:
subcontexts can now register functions to be passed into the template. added a new global util context. added some more basic style
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-26 16:34:43 UTC (rev 8277)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/controllers/acq.py 2007-12-26 17:23:44 UTC (rev 8278)
@@ -22,6 +22,7 @@
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)
+ self.extract_bib_field = ContextItem(default_value=oilsweb.lib.acq.search.extract_bib_field)
Context.applySubContext('acq', AcqContext)
@@ -53,9 +54,6 @@
if ctx.acq.search_source:
c.oils_acq_records, ctx.acq.search_cache_key = self._build_z39_search(ctx)
-
- 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/pl_builder.html' % ctx.core.skin)
@@ -109,13 +107,9 @@
records.append(rec)
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']:
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/lib/__init__.py
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/lib/__init__.py 2007-12-26 16:34:43 UTC (rev 8277)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/lib/__init__.py 2007-12-26 17:23:44 UTC (rev 8278)
@@ -48,3 +48,12 @@
Context.applySubContext('core', CoreContext)
+
+class UtilContext(SubContext):
+ ''' The UtilContext maintains a set of general use functions '''
+ def __init__(self):
+ import oilsweb.lib.bib
+ self.scrub_isbn = ContextItem(default_value=oilsweb.lib.bib.scrub_isbn)
+
+Context.applySubContext('util', UtilContext)
+
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/lib/context.py
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/lib/context.py 2007-12-26 16:34:43 UTC (rev 8277)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/lib/context.py 2007-12-26 17:23:44 UTC (rev 8278)
@@ -19,7 +19,6 @@
def _fields(self):
''' Returns all public fields for this subcontext '''
return [ f for f in dir(self) if f[0:1] != '_' and
- getattr(self, f).__class__.__name__.find('function') < 0 and
getattr(self, f).__class__.__name__.find('method') < 0 ]
def postinit(self):
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-26 16:34:43 UTC (rev 8277)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/acq_default.css 2007-12-26 17:23:44 UTC (rev 8278)
@@ -16,8 +16,9 @@
.oils-acq-search-subsources-label { margin-top: 5px; }
#oils-acq-search-sources-label { margin-bottom: 10px; }
#oils-acq-search-fields-label { margin-bottom: 10px; }
+#oils-acq-search-fields-submit-block { margin: 5px; text-align: center;}
-#oils-acq-pl_builder-table td {}
+#oils-acq-pl_builder-table { width: 100%; }
.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; }
@@ -25,4 +26,5 @@
.oils-acq-record_list-records-phys_desc-row {}
#oils-acq-rdetail-marc-block { margin-top: 10px; padding: 10px; }
-#oils-acq-search-fields-submit-block { margin: 5px; text-align: center;}
+
+#oils-acq-picklist-table { width: 100%; }
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/default.css
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/default.css 2007-12-26 16:34:43 UTC (rev 8277)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/default.css 2007-12-26 17:23:44 UTC (rev 8278)
@@ -17,7 +17,7 @@
#oils-base-navigate-table { width: 100%; }
#oils-base-navigate-table td { width: 100%; }
-#oils-base-header-block { width: 100%; text-align: right; margin-top: 0px;}
+#oils-base-header-block { width: 100%; text-align: right; margin-top: 0px; padding-bottom: 4px;}
#oils-base-footer-block { width: 100%; text-align: center; vertical-align: bottom;}
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-26 16:34:43 UTC (rev 8277)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/theme/acq_default.css 2007-12-26 17:23:44 UTC (rev 8278)
@@ -1,5 +1,6 @@
#oils-acq-index-div { font-weight:bold; }
+
#oils-acq-search-container { width:100%; }
#oils-acq-search-sources-div { width:20%; float:left; }
#oils-acq-search-form-div { width:80%; float:right; }
@@ -8,10 +9,14 @@
#oils-acq-search-sources-label { font-weight: bold; border-bottom: 1px solid #6BA160;}
#oils-acq-search-fields-label { font-weight: bold; border-bottom: 1px solid #6BA160;}
#oils-acq-search-subsources-label { font-weight: bold; }
+#oils-acq-search-fields-submit-block { border: 2px solid #A1A1A1; }
+
#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-pl_builder-table tr { border-bottom: 1px solid #808080;} */
+.oils-acq-record_list-records-phys_desc-row { border-bottom: 1px solid #6BA160; }
+.oils-acq-record_list-picklist-td { border-style: solid; border-color: #A1A1A1; border-width: 0px 1px 0px 1px; }
.oils-acq-record_list-records-service-td { font-size: 85%; }
#oils-acq-pl_builder-picklist-submit { text-align: right; }
-#oils-acq-search-fields-submit-block { border: 2px solid #A1A1A1; }
+
+
+#oils-acq-rdetail-marc-block { border-top: 1px solid #808080; }
Modified: 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 2007-12-26 16:34:43 UTC (rev 8277)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist.html 2007-12-26 17:23:44 UTC (rev 8278)
@@ -1,13 +1,12 @@
<%inherit file='../base.html'/>
<%def name="block_title()">${_('Evergreen ACQ Picklist')}</%def>
<%def name="block_content()">
-<div>Building picklist with...</div>
-<table>
+<table id='oils-acq-picklist-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"))}'/>
+ src='${c.oils.core.ac_prefix}/jacket/small/${c.oils.util.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>
@@ -21,7 +20,7 @@
</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.util.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>
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-26 16:34:43 UTC (rev 8277)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/pl_builder.html 2007-12-26 17:23:44 UTC (rev 8278)
@@ -6,39 +6,36 @@
<input type='hidden' name='${c.oils.core.authtoken_.cgi_name}' value='${c.oils.core.authtoken}'/>
<table id='oils-acq-pl_builder-table'>
<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'>
+ <tr class='oils-acq-record_list-records-title-row'>
<td rowspan='3'>
- <img class='oils-acq-pl_builder-records-jacket'
- src='${c.oils.core.ac_prefix}/jacket/small/${c.oils.scrub_isbn(c.oils.acq.extract_bib_field(rec,"isbns.isbn"))}'/>
+ <img class='oils-acq-record_list-records-jacket'
+ src='${c.oils.core.ac_prefix}/jacket/small/${c.oils.util.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-pl_builder-records-service-td'>${res['service']}</td>
- <td rowspan='3' class='oils-acq-pl_builder-picklist-td' >
+ <td rowspan='3' 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"]}:${c.oils.acq.search_cache_key}'/>
+ value='${rec["cache_id"]}'/>
</tr>
</tr>
- <tr class='oils-acq-pl_builder-records-author-row'>
+ <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-pl_builder-records-phys_desc-row'>
+ <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.util.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")}'/>
Modified: 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 2007-12-26 16:34:43 UTC (rev 8277)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/record_list.html 2007-12-26 17:23:44 UTC (rev 8278)
@@ -3,7 +3,7 @@
<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"))}'/>
+ src='${c.oils.core.ac_prefix}/jacket/small/${c.oils.util.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>
@@ -21,7 +21,7 @@
</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.util.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>
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/header.html
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/header.html 2007-12-26 16:34:43 UTC (rev 8277)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/header.html 2007-12-26 17:23:44 UTC (rev 8278)
@@ -1,3 +1,5 @@
<div id='oils-base-header-content-div'>
- ${c.oils.core.user.usrname()} / ${c.oils.core.workstation.name()}
+ <span id='oils-base-header-user-info'>
+ ${c.oils.core.user.usrname()} / ${c.oils.core.workstation.name()}
+ </span>
</div>
More information about the open-ils-commits
mailing list