From 5f4b8b080428244b4dafae5df7da1f7b26e61a63 Mon Sep 17 00:00:00 2001 From: djfiander Date: Wed, 21 May 2008 20:44:19 +0000 Subject: [PATCH] Pull Picklist Grid generation out into separate Pylons template and generalize for use elsewhere git-svn-id: svn://svn.open-ils.org/ILS/branches/acq-experiment@9659 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../templates/oils/default/acq/picklist/view.html | 121 +++---------------- .../templates/oils/default/common/jubgrid.html | 129 +++++++++++++++++++++ 2 files changed, 147 insertions(+), 103 deletions(-) create mode 100644 Open-ILS/web/oilsweb/oilsweb/templates/oils/default/common/jubgrid.html diff --git a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/view.html b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/view.html index a90745f9fa..b121a33765 100644 --- a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/view.html +++ b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/view.html @@ -3,51 +3,12 @@ vim:ts=4:sw=4:et:ft=mako: --> <%inherit file='base.html'/> - +<%namespace file='../../common/jubgrid.html' name='jubgrid'/> <%def name="block_js()"> ${parent.block_js()} - <%def name="page_title()">${_('Picklist')} @@ -66,68 +27,22 @@ -
-
-
- -
-
-
- -
-
-
+ + ${jubgrid.jubgrid('oils-acq-picklist', 'pickListGrid')} diff --git a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/common/jubgrid.html b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/common/jubgrid.html new file mode 100644 index 0000000000..38a34c1658 --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/common/jubgrid.html @@ -0,0 +1,129 @@ +<%def name='jubgrid(domprefix, grid_jsid)'> +<%doc> +This template creates a split screen Dojo layout. The top frame +of the screen holds a list of of JUBs, or titles. Clicking on a +title in the top frame will load the purchase details for all the +copies on order for that title into the bottom frame. + +To create a display for a set of JUBs, create a Dojo store and +model for the set of JUBs, then place the following lines in your +HTML where you want the display to appear: + + <%namespace file='/oils/default/common/jubgrid.html' name='jubgrid'/> + ${jubgrid.jubgrid('dom_prefix', 'grid_js_id')} + +where 'dom_prefix' is a string that will be used as the prefix +for the DOM notes that are created by this template, and +'grid_js_id' is a valid JavaScript identifier that will name the +DOM node to which the list of JUBs will be attached. For example + + ${jubgrid.jubgrid('oils-acq-picklist', 'pickListGrid')} + +will create a Dojo grid with the DOM id of + + 'oils-acq-picklist-JUB-grid' + +and a jsid of + + pickListGrid + +To fill the grid with data, call the javascript function + + populateJUBGrid(grid_js_id, model) + +'grid_js_id' is the same javascript id that was used to +instantiate the template, and model is a javascript variable +pointing to the JUB model (and store) that you have created. + + +
+ +
+
+ +
+
+
+ +
+
+
+ -- 2.11.0