From: erickson Date: Wed, 26 Dec 2007 16:34:43 +0000 (+0000) Subject: added a config variable for local template path X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=92ea8def949653b34062c83f9451c697183e4934;p=Evergreen.git added a config variable for local template path removed some unused config variables sorting search field labels before display added some basic style to prevent eye bleeding changed sources from a multiselect to a set of checkboxes for easier styling git-svn-id: svn://svn.open-ils.org/ILS/branches/acq-experiment@8277 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/oilsweb/development.ini b/Open-ILS/web/oilsweb/development.ini index 9ed840ed0a..b68be0e36d 100644 --- a/Open-ILS/web/oilsweb/development.ini +++ b/Open-ILS/web/oilsweb/development.ini @@ -23,16 +23,21 @@ cache_dir = %(here)s/data beaker.session.key = oilsweb beaker.session.secret = somesecret +# ---------------------------------------------------------- osrf_config = /openils/conf/opensrf_core.xml osrf_config_ctxt = config.opensrf oils_prefix = /oils +# media_prefix can be a path or full URL oils_media_prefix = /oils/media +# added_content_prefix can be a path or full URL oils_added_content_prefix = http://dev.gapines.org/opac/extras/ac -oils_username = admin -oils_password = open-ils +# URL relative to the app root where XSL files are found oils_xsl_prefix = oilsweb/public/oils/media/xsl oils_xsl_acq_bib = acq-bibdata-marc.xslt oils_xsl_marc2html = oilsMARC21slim2HTML.xsl +# path to extra templates or overridden templates +local_templates = /openils/var/web/oilsweb/oilsweb/local_templates +# ---------------------------------------------------------- # If you'd like to fine-tune the individual locations of the cache data dirs diff --git a/Open-ILS/web/oilsweb/oilsweb/config/environment.py b/Open-ILS/web/oilsweb/oilsweb/config/environment.py index 848c55e004..9bef51a700 100644 --- a/Open-ILS/web/oilsweb/oilsweb/config/environment.py +++ b/Open-ILS/web/oilsweb/oilsweb/config/environment.py @@ -16,7 +16,7 @@ def load_environment(global_conf, app_conf): paths = dict(root=root, controllers=os.path.join(root, 'controllers'), static_files=os.path.join(root, 'public'), - templates=[os.path.join(root, 'templates')]) + templates=[app_conf.get('local_templates', ''), os.path.join(root, 'templates')]) # Initialize config with the basic options config.init_app(global_conf, app_conf, package='oilsweb', diff --git a/Open-ILS/web/oilsweb/oilsweb/controllers/acq.py b/Open-ILS/web/oilsweb/oilsweb/controllers/acq.py index 6df8567296..ef33ce9d17 100644 --- a/Open-ILS/web/oilsweb/oilsweb/controllers/acq.py +++ b/Open-ILS/web/oilsweb/oilsweb/controllers/acq.py @@ -40,6 +40,9 @@ class AcqController(BaseController): for key, val in data['attrs'].iteritems(): sc[key] = val.get('label') or key c.oils_search_classes = sc + keys = sc.keys() + keys.sort() + c.oils_search_classes_sorted = keys return render('oils/%s/acq/search.html' % c.oils.core.skin) @@ -104,7 +107,6 @@ class AcqController(BaseController): 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 diff --git a/Open-ILS/web/oilsweb/oilsweb/lib/__init__.py b/Open-ILS/web/oilsweb/oilsweb/lib/__init__.py index 9db4e818a0..4c56ca491b 100644 --- a/Open-ILS/web/oilsweb/oilsweb/lib/__init__.py +++ b/Open-ILS/web/oilsweb/oilsweb/lib/__init__.py @@ -23,13 +23,28 @@ class CoreContext(SubContext): self.fetchUser() + _auth_cache = {} def fetchUser(self): ''' Grab the logged in user and their workstation ''' if self.authtoken: + + if self.authtoken in CoreContext._auth_cache: + self.user = CoreContext._auth_cache[self.authtoken]['user'] + self.workstation = CoreContext._auth_cache[self.authtoken]['workstation'] + return + self.user = osrf.ses.AtomicRequest( 'open-ils.auth', 'open-ils.auth.session.retrieve', self.authtoken) self.workstation = oils.utils.csedit.CSEditor().retrieve_actor_workstation(self.user.wsid()) + + # cache the auth data and destroy any old auth data + CoreContext._auth_cache = { + self.authtoken : { + 'user' : self.user, + 'workstation' : self.workstation + } + } Context.applySubContext('core', CoreContext) diff --git a/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/acq_default.css b/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/acq_default.css index 10d76ae648..a97d5a935a 100644 --- a/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/acq_default.css +++ b/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/acq_default.css @@ -1,14 +1,22 @@ #oils-acq-index-block { font-weight:bold; } #oils-acq-search-container { width:100%; } -#oils-acq-search-sources-block { width:29%; vertical-align: top; float: left; } -#oils-acq-search-form-block { width:70%; vertical-align: top; float:right; } +#oils-acq-search-sources-block { width:32%; vertical-align: top; float: left; margin-right: 10px;} +#oils-acq-search-form-block { width:63%; vertical-align: top; float:right; } #oils-acq-search-sources-selector { padding: 2px; } #oils-acq-search-sources-selector option { margin-bottom: 2px; } .oils-acq-search-form-row { width: 100%; } .oils-acq-search-form-label {} .oils-acq-search-form-input {} +#oils-acq-search-sources-list { padding: 1px; } +#oils-acq-search-sources-list li { list-style-type: none; padding-left: 0px; } +.oils-acq-search-sources-sublist { padding: 1px; list-style-type: none;} +.oils-acq-search-sources-sublist li { margin-left: 10px; } +.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-pl_builder-table td {} .oils-acq-record_list-records-jacket { width: 42px; height: 54px; padding-left: 10px; } .oils-acq-record_list-records-title-row {} @@ -16,3 +24,5 @@ .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; } + +#oils-acq-search-fields-submit-block { margin: 5px; text-align: center;} diff --git a/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/default.css b/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/default.css index d1231c24ef..03f46fcdc4 100644 --- a/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/default.css +++ b/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/default.css @@ -14,8 +14,10 @@ body { margin-top: 0px; padding-top: 0px;} #oils-base-navigate-block { width: 15%; vertical-align: top; float:left;} #oils-base-content-block { width: 84%; vertical-align: top; float:right; padding-top: 8px;} #oils-base-sidebar-block { width: 15%; vertical-align: top; float:left;} +#oils-base-navigate-table { width: 100%; } +#oils-base-navigate-table td { width: 100%; } -#oils-base-header-block { width: 84%; text-align: right; margin-top: 0px; float:right;} +#oils-base-header-block { width: 100%; text-align: right; margin-top: 0px;} #oils-base-footer-block { width: 100%; text-align: center; vertical-align: bottom;} diff --git a/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/theme/acq_default.css b/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/theme/acq_default.css index b1b943afa0..a48ca91b02 100644 --- a/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/theme/acq_default.css +++ b/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/theme/acq_default.css @@ -5,10 +5,13 @@ #oils-acq-search-form-div { width:80%; float:right; } #oils-acq-search-z39-sources-table thead td { font-weight: bold; } #oils-acq-search-z39-sources-table tbody td { width: 33%; } -#oils-acq-search-sources-label { font-weight: bold; } +#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-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; } +#oils-acq-search-fields-submit-block { border: 2px solid #A1A1A1; } diff --git a/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/theme/default.css b/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/theme/default.css index 936402f0ae..c8eaab5e53 100644 --- a/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/theme/default.css +++ b/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/theme/default.css @@ -1,15 +1,17 @@ /* import the default css for the install applications */ @import "acq_default.css"; -body { font-size: 85%; } +body { font-size: 80%; } /* base default style */ #oils-base-body-block {} -#oils-base-navigate-block {border: 1px solid #808080;} +#oils-base-navigate-block {border: 2px solid #85C777; background: #6BA160;} +#oils-base-navigate-block a { color: #000000; } +#oils-base-navigate-table td:hover { background: #85C777; } #oils-base-content-block {} #oils-base-sidebar-block {} -#oils-base-footer-block {padding: 3px; margin-top: 20px; border: 1px solid #808080;} -#oils-base-header-block {border-bottom: 1px solid #909090; } +#oils-base-footer-block {padding: 3px; margin-top: 20px; border-top: 1px solid #5E5E5E;} +#oils-base-header-block {border-bottom: 1px solid #5E5E5E; } diff --git a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/search.html b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/search.html index 67a6270763..3be2f6a332 100644 --- a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/search.html +++ b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/search.html @@ -7,20 +7,33 @@
${_('Search Sources')}
- +
    +
  • ${_('Evergreen Catalog')}
  • +
  • +
    ${_("Z39.50 Sources")}
    +
      + % for src,cfg in c.oils_z39_sources.iteritems(): +
    • + + ${src} ${cfg["host"]}:${cfg["db"]} + % if cfg['auth'] == 't': + * + % endif + +
    • + % endfor +
    +
  • +
- - % for cls, lbl in c.oils_search_classes.iteritems(): +
${_('Search Fields')}
+
+ % for cls in c.oils_search_classes_sorted: - + % endfor
${lbl}${c.oils_search_classes[cls]} @@ -28,7 +41,9 @@
- +
+ +
diff --git a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/base.html b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/base.html index 58183fc472..a5bcfca2c2 100644 --- a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/base.html +++ b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/base.html @@ -2,13 +2,13 @@ <%def name='block_body_content()'>
+
+ ${self.block_header()} +
${self.block_navigate()}
-
- ${self.block_header()} -
${self.block_content()}
diff --git a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/navigate.html b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/navigate.html index 44f5463cee..497d7847cb 100644 --- a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/navigate.html +++ b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/navigate.html @@ -1,7 +1,7 @@ - +
${_('Home')}
${_('Search')}
${_('Bib Search')}