From: erickson Date: Thu, 27 Dec 2007 21:18:27 +0000 (+0000) Subject: moving skin/theme css into sub-dir, while still using top-level css file for organization X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=e6cd72920631e4f6b44be7501dd6f3e62b84078c;p=Evergreen.git moving skin/theme css into sub-dir, while still using top-level css file for organization started an admin app alongside the acq app added a new top-level cross-app navigation block along with navigation bars for the apps added a placeholder for the common dashboard running context postinit after all contexts are initialized git-svn-id: svn://svn.open-ils.org/ILS/branches/acq-experiment@8280 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/oilsweb/development.ini b/Open-ILS/web/oilsweb/development.ini index b68be0e36d..e10829847e 100644 --- a/Open-ILS/web/oilsweb/development.ini +++ b/Open-ILS/web/oilsweb/development.ini @@ -12,8 +12,8 @@ error_email_from = paste@localhost [server:main] use = egg:Paste#http -#host = 0.0.0.0 -host = 216.154.195.227 +host = 0.0.0.0 +#host = 216.154.195.227 port = 5000 [app:main] @@ -35,6 +35,8 @@ oils_added_content_prefix = http://dev.gapines.org/opac/extras/ac oils_xsl_prefix = oilsweb/public/oils/media/xsl oils_xsl_acq_bib = acq-bibdata-marc.xslt oils_xsl_marc2html = oilsMARC21slim2HTML.xsl +# how long do we cache search results for +oils_bib_cache_time = 3200 # path to extra templates or overridden templates local_templates = /openils/var/web/oilsweb/oilsweb/local_templates # ---------------------------------------------------------- diff --git a/Open-ILS/web/oilsweb/oilsweb/config/routing.py b/Open-ILS/web/oilsweb/oilsweb/config/routing.py index 853cbe5773..c0e2a7b555 100644 --- a/Open-ILS/web/oilsweb/oilsweb/config/routing.py +++ b/Open-ILS/web/oilsweb/oilsweb/config/routing.py @@ -18,10 +18,20 @@ def make_map(): # CUSTOM ROUTES HERE - map.connect('oils/:controller/:action') + if config.get('use_mod_python'): + map.connect(':controller/:action') + map.connect('admin/:action/:type/:id', controller='admin') + map.connect('admin/:action/:type', controller='admin') + else: + map.connect('oils/:controller/:action') + map.connect('oils/admin/:action/:type/:id', controller='admin') + map.connect('oils/admin/:action/:type', controller='admin') + + ''' trying a different set of admin routes above... map.connect('acq_admin', 'oils/admin', controller='acq_admin') map.connect('acq_admin_object', 'oils/admin/:object', controller='acq_admin') map.connect('acq_admin_direct', 'oils/admin/direct/:object/:id', controller='acq_admin') + ''' map.connect('*url', controller='template', action='view') return map diff --git a/Open-ILS/web/oilsweb/oilsweb/controllers/acq.py b/Open-ILS/web/oilsweb/oilsweb/controllers/acq.py index 8ba2a40bfa..64b0a5294f 100644 --- a/Open-ILS/web/oilsweb/oilsweb/controllers/acq.py +++ b/Open-ILS/web/oilsweb/oilsweb/controllers/acq.py @@ -1,6 +1,6 @@ from oilsweb.lib.base import * -import logging +import logging, pylons import oilsweb.lib.context import oilsweb.lib.util import oilsweb.lib.acq.search @@ -22,6 +22,11 @@ class AcqContext(SubContext): 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) + self.prefix = ContextItem() + + def postinit(self): + self.prefix = "%s/acq" % Context.getContext().core.prefix + Context.applySubContext('acq', AcqContext) diff --git a/Open-ILS/web/oilsweb/oilsweb/controllers/admin.py b/Open-ILS/web/oilsweb/oilsweb/controllers/admin.py new file mode 100644 index 0000000000..10eb30a715 --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/controllers/admin.py @@ -0,0 +1,55 @@ +from oilsweb.lib.base import * +import oilsweb.lib.util +from oilsweb.lib.context import Context, SubContext, ContextItem +import oils.utils.idl +import oils.utils.csedit +import osrf.ses + +class AdminContext(SubContext): + ''' Define the CGI/Context params for this application ''' + def __init__(self): + self.object = ContextItem() + self.object_class = ContextItem() + self.object_meta = ContextItem() + self.mode = ContextItem(default_value='view') + self.prefix = ContextItem() + def postinit(self): + self.prefix = "%s/admin" % Context.getContext().core.prefix + +Context.applySubContext('adm', AdminContext) + +class AdminController(BaseController): + + def init(self, type, id=None): + c.oils = oilsweb.lib.context.Context.init(request, response) + c.oils.adm.object_class = type + meta = c.oils.adm.object_meta = oils.utils.idl.oilsGetIDLParser().IDLObject[type] + + if id is not None: + c.oils.adm.object = osrf.ses.AtomicRequest( + 'open-ils.cstore', + 'open-ils.cstore.direct.%s.retrieve' % + meta['fieldmapper'].replace('::', '.'), id) + + c.oils.apply_cookies() + + def view(self, type, id): + self.init(type, id) + return render('oils/%s/admin/object.html' % c.oils.core.skin) + + def update(self, type, id): + self.init(type, id) + c.oils.adm.mode = 'update' + return render('oils/%s/admin/object.html' % c.oils.core.skin) + + def create(self, type): + self.init(type) + c.oils.adm.mode = 'create' + return render('oils/%s/admin/object.html' % c.oils.core.skin) + + def delete(self, type, id): + self.init(type, id) + c.oils.adm.mode = 'delete' + return render('oils/%s/admin/object.html' % c.oils.core.skin) # show a confirmation page + + diff --git a/Open-ILS/web/oilsweb/oilsweb/controllers/base.py b/Open-ILS/web/oilsweb/oilsweb/controllers/base.py new file mode 100644 index 0000000000..1bc2285278 --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/controllers/base.py @@ -0,0 +1,21 @@ +import logging + +from oilsweb.lib.base import * +from oilsweb.lib.context import Context, SubContext, ContextItem + +log = logging.getLogger(__name__) + + +class BaseContext(SubContext): + def postinit(self): + self.prefix = "%s/base" % Context.getContext().core.prefix +Context.applySubContext('base', BaseContext) + + +class BaseController(BaseController): + ''' Controller for globally shared interfaces ''' + + def dashboard(self): + c.oils = Context.init(request, response) + return render('oils/%s/dashboard.html' % c.oils.core.skin) + diff --git a/Open-ILS/web/oilsweb/oilsweb/lib/acq/search.py b/Open-ILS/web/oilsweb/oilsweb/lib/acq/search.py index d234dd8208..a334fa3f04 100644 --- a/Open-ILS/web/oilsweb/oilsweb/lib/acq/search.py +++ b/Open-ILS/web/oilsweb/oilsweb/lib/acq/search.py @@ -4,6 +4,7 @@ import osrf.ses import osrf.xml_obj import oils.const import osrf.log, osrf.cache, osrf.json +import pylons.config EG_Z39_SOURCES = 'open-ils.search.z3950.retrieve_services' EG_Z39_SEARCH = 'open-ils.search.z3950.search_class' @@ -47,7 +48,7 @@ def cache_search(search, results): key = md5.new() key.update(unicode(search)) key = key.hexdigest() - osrf.cache.CacheClient().put(key, results) + osrf.cache.CacheClient().put(key, results, pylons.config.get('oils_bib_cache_time', 900)) return key def extract_bib_field(rec, field, all=False): diff --git a/Open-ILS/web/oilsweb/oilsweb/lib/context.py b/Open-ILS/web/oilsweb/oilsweb/lib/context.py index 5d06154906..38d4610b76 100644 --- a/Open-ILS/web/oilsweb/oilsweb/lib/context.py +++ b/Open-ILS/web/oilsweb/oilsweb/lib/context.py @@ -111,6 +111,9 @@ class Context(object): # store the metatdata at _ setattr(getattr(c, app), "%s_" % name, item) + # run postinit after all contexts have been loaded + for app in _subContexts.keys(): + ctx = getattr(c, app) ctx.postinit() return c 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 deleted file mode 100644 index 05734e8471..0000000000 --- a/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/acq_default.css +++ /dev/null @@ -1,34 +0,0 @@ - -#oils-acq-index-block { font-weight:bold; } - -/* bib search */ -#oils-acq-search-container { width:100%; } -#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-search-fields-submit-block { margin: 5px; text-align: center;} - -/* bib search results / picklist builder interface */ -#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; } -.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-picklist-table { width: 100%; } - - 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 ef498ee6b6..314db1f4f6 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 @@ -1,5 +1,6 @@ /* import the default css for the install applications */ -@import "acq_default.css"; +@import "default/acq.css"; +@import "default/admin.css"; /* base default style */ @@ -11,16 +12,17 @@ body { margin-top: 0px; padding-top: 0px;} #oils-base-body-block { width: 100%; margin-top: 0px; padding-top: 0px;} #oils-base-main-block { width: 100%; margin-top: 0px; padding-top: 0px;} +#oils-base-content-block { width: 84%; vertical-align: top; float:right; 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-sidebar-block { width: 15%; vertical-align: top; float:left;} #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;} - +.oils-base-sub-navigate-block { text-align: center; padding: 3px; margin-bottom: 10px;} +.oils-base-sub-navigate-block span { padding: 3px; } diff --git a/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/default/acq.css b/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/default/acq.css new file mode 100644 index 0000000000..da08dbe0a5 --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/default/acq.css @@ -0,0 +1,39 @@ + +#oils-acq-index-block { font-weight:bold; } +/* +.oils-sub-navigate-block { width: 100%; text-align: left; padding: 3px;} +.oils-sub-navigate-block span { padding: 3px; } +*/ + +/* bib search */ +#oils-acq-search-container { width:100%; } +#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-search-fields-submit-block { margin: 5px; text-align: center;} + +/* bib search results / picklist builder interface */ +#oils-acq-pl_builder-table { width: 100%; } +.oils-acq-record_list-records-jacket-td { width: 46px; } +.oils-acq-record_list-records-jacket { width: 42px; height: 54px; padding-left: 0px; } +.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; } + + +#oils-acq-picklist-table { width: 100%; } + + diff --git a/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/default/admin.css b/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/default/admin.css new file mode 100644 index 0000000000..c10a384e5b --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/default/admin.css @@ -0,0 +1,3 @@ +#oils-admin-object-actions { width: 100%; padding: 2px; margin: 2px; text-align: right;} +#oils-admin-object-table { width: 100%; } +#oils-admin-object-table td { padding: 3px; } 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 deleted file mode 100644 index 468f67501f..0000000000 --- a/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/theme/acq_default.css +++ /dev/null @@ -1,22 +0,0 @@ - -#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; } -#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; 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 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-rdetail-marc-block { border-top: 1px solid #808080; } 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 c8eaab5e53..636a4d9198 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,9 +1,9 @@ /* import the default css for the install applications */ -@import "acq_default.css"; +@import "default/acq.css"; +@import "default/admin.css"; body { font-size: 80%; } -/* base default style */ #oils-base-body-block {} #oils-base-navigate-block {border: 2px solid #85C777; background: #6BA160;} #oils-base-navigate-block a { color: #000000; } @@ -14,5 +14,7 @@ body { font-size: 80%; } #oils-base-header-block {border-bottom: 1px solid #5E5E5E; } - +.oils-base-sub-navigate-block { border: 2px solid #6BA160; background: #85C777;} +.oils-base-sub-navigate-block a { color: #000000; } +.oils-base-sub-navigate-block span:hover { background: #6BA160; } diff --git a/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/theme/default/acq.css b/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/theme/default/acq.css new file mode 100644 index 0000000000..468f67501f --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/theme/default/acq.css @@ -0,0 +1,22 @@ + +#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; } +#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; 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 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-rdetail-marc-block { border-top: 1px solid #808080; } diff --git a/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/theme/default/admin.css b/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/theme/default/admin.css new file mode 100644 index 0000000000..a79d2024bb --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/theme/default/admin.css @@ -0,0 +1 @@ +#oils-admin-object-table tr { border-bottom: 1px solid #6BA160; } diff --git a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/base.html b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/base.html new file mode 100644 index 0000000000..8f3ad6b8ed --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/base.html @@ -0,0 +1,4 @@ +<%inherit file='../base.html'/> +<%def name="block_sub_navigate()"> + <%include file='navigate.html'/> + diff --git a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/index.html b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/index.html index 9a9a383f3f..1e658fc6b6 100644 --- a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/index.html +++ b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/index.html @@ -1,4 +1,4 @@ -<%inherit file='../base.html'/> +<%inherit file='base.html'/> <%def name="block_title()">${_('Evergreen Acquisitions Home')} <%def name="block_content()"> diff --git a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/navigate.html b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/navigate.html new file mode 100644 index 0000000000..b2a828b6b3 --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/navigate.html @@ -0,0 +1,3 @@ +${_('Acquisitions Home')} +${_('Bib Search')} + diff --git a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist.html b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist.html index 3114ae061a..4eaa2d93f3 100644 --- a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist.html +++ b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist.html @@ -1,4 +1,4 @@ -<%inherit file='../base.html'/> +<%inherit file='base.html'/> <%def name="block_title()">${_('Evergreen ACQ Picklist')} <%def name="block_content()"> diff --git a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/pl_builder.html b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/pl_builder.html index 6cfbf035d3..02f0623db3 100644 --- a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/pl_builder.html +++ b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/pl_builder.html @@ -1,15 +1,14 @@ -<%inherit file='../base.html'/> +<%inherit file='base.html'/> <%def name="block_title()">${_('Evergreen Acquisitions Results')} <%def name="block_content()"> -
% for res in c.oils_acq_records: % for rec in res['records']: - diff --git a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/rdetails.html b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/rdetails.html index 002f9ed78a..58dcb75271 100644 --- a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/rdetails.html +++ b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/rdetails.html @@ -1,4 +1,4 @@ -<%inherit file='../base.html'/> +<%inherit file='base.html'/> <%def name="block_title()">${_('Evergreen ACQ Details')} <%def name="block_content()">
+
diff --git a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/record_list.html b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/record_list.html index c4ecf1d483..1b4cef522c 100644 --- a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/record_list.html +++ b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/record_list.html @@ -1,7 +1,7 @@ % for res in c.oils_acq_records: % for rec in res['records']: - 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 3be2f6a332..b58d371e5b 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 @@ -1,9 +1,8 @@ -<%inherit file='../base.html'/> +<%inherit file='base.html'/> <%def name="block_title()">${_('Evergreen Acquisitions Search')} <%def name="block_content()"> -
${_('Search Sources')}
diff --git a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/admin/base.html b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/admin/base.html new file mode 100644 index 0000000000..502f92128b --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/admin/base.html @@ -0,0 +1,5 @@ +<%inherit file='../base.html'/> +<%def name="block_sub_navigate()"> + <%include file='navigate.html'/> + + diff --git a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/admin/navigate.html b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/admin/navigate.html new file mode 100644 index 0000000000..03ebdb3edf --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/admin/navigate.html @@ -0,0 +1,17 @@ + + ${_('Search')} + +% if c.oils.adm.mode != 'create': + + ${_('Create')} + + % if c.oils.adm.mode != 'update': + + ${_('Update')} + + % endif + + ${_('Delete')} + +% endif + diff --git a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/admin/object.html b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/admin/object.html new file mode 100644 index 0000000000..1cbcd50c02 --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/admin/object.html @@ -0,0 +1,37 @@ +<%inherit file='base.html'/> + +<%def name="block_title()">${_('Evergreen Admin')} +<%def name="block_content()"> +
${c.oils.adm.object_meta['rpt_label']}
+ % if c.oils.adm.mode == 'delete': +
+ <% + ## Why does doing this inline (inside ${...}) give me a syntax error???? + string = _("Are you sure you want to delete %(cls)s with id %(id)d?") % {"cls":c.oils.adm.object_class, "id":c.oils.adm.object.id()} + %> + ${string} +
+ % else: +
+
+ % for fieldmeta in [ f for f in c.oils.adm.object_meta['fields'] if not f['virtual']]: + + + + + % endfor +
${fieldmeta['rpt_label']} + % if c.oils.adm.mode == 'update': + + % else: + % if c.oils.adm.mode == 'create': + + % else: + % if c.oils.adm.mode == 'view': + ${unicode(getattr(c.oils.adm.object, fieldmeta['name'])())} + % endif + % endif + % endif +
+ % endif + + 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 a5bcfca2c2..4240efd738 100644 --- a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/base.html +++ b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/base.html @@ -10,7 +10,7 @@ ${self.block_navigate()}
- ${self.block_content()} + ${self.block_global_content()}
${self.block_sidebar()} @@ -26,6 +26,12 @@ <%include file='header.html'/> <%def name='block_sidebar()'/> +<%def name='block_global_content()'> +
+ ${self.block_sub_navigate()} +
+ ${self.block_content()} + <%def name='block_content()'/> <%def name='block_navigate()'> <%include file='navigate.html'/> @@ -33,3 +39,4 @@ <%def name='block_footer()'> <%include file='footer.html'/> +<%def name='block_sub_navigate()'/> diff --git a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/dashboard.html b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/dashboard.html new file mode 100644 index 0000000000..d67abe6fe7 --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/dashboard.html @@ -0,0 +1,9 @@ +<%inherit file='base.html'/> + +<%def name="block_title()">${_('Evergreen Dashboard')} +<%def name="block_content()"> +
+ DASHBOARD +
+ + 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 497d7847cb..c1c91ec448 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,9 @@ - - + + + +
${_('Home')}
${_('Bib Search')}
${_('Dashboard')}
${_('Acqisitions')}
${_('Serials')}
${_('Admin')}
diff --git a/Open-ILS/web/oilsweb/oilsweb/tests/functional/test_admin.py b/Open-ILS/web/oilsweb/oilsweb/tests/functional/test_admin.py new file mode 100644 index 0000000000..99d6439e63 --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/tests/functional/test_admin.py @@ -0,0 +1,7 @@ +from oilsweb.tests import * + +class TestAdminController(TestController): + + def test_index(self): + response = self.app.get(url_for(controller='admin')) + # Test response... diff --git a/Open-ILS/web/oilsweb/oilsweb/tests/functional/test_base.py b/Open-ILS/web/oilsweb/oilsweb/tests/functional/test_base.py new file mode 100644 index 0000000000..530c6a5554 --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/tests/functional/test_base.py @@ -0,0 +1,7 @@ +from oilsweb.tests import * + +class TestBaseController(TestController): + + def test_index(self): + response = self.app.get(url_for(controller='base')) + # Test response...