From: Jeff Godin Date: Tue, 12 Mar 2013 20:10:40 +0000 (-0400) Subject: Add dept location selector (replaces item type) X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=96a399ef9c889fe4e8aa82b67c52bcab80a1f848;p=evergreen%2Ftadl.git Add dept location selector (replaces item type) Add optional item_locations_selector (similar to item_type_selector) which can be used in place of the item_type_selector in areas where we would like to use shelving locations and not item type as a search filter. This is similar to features which exist in future versions of Evergreen, and may be a simple intermediate step which is later replaced. Triggered by the physical_dept 'ys' at the moment, we have a hardcoded list of groups of shelving locations. If triggered with an unknown department, the item_locations_selector defaults to a single empty entry for all locations. Signed-off-by: Jeff Godin --- diff --git a/templates_tadlskin/opac/parts/item_locations_selector.tt2 b/templates_tadlskin/opac/parts/item_locations_selector.tt2 new file mode 100644 index 0000000000..f13cb614ef --- /dev/null +++ b/templates_tadlskin/opac/parts/item_locations_selector.tt2 @@ -0,0 +1,35 @@ + +[% +# These are displayed in the order shown +IF dept == 'ys'; + item_locations = [ + { 'code' => '527,571,770,599,771,529,528,530,531,532,598,597,595,596,630', 'value' => 'Juvenile' }, + { 'code' => '571,597,595', 'value' => 'Juvenile Audiobooks' }, + { 'code' => '529', 'value' => 'Juvenile Easy' }, + { 'code' => '528', 'value' => 'Juvenile Easy Plus' }, + { 'code' => '549', 'value' => 'Puppets' }, + ]; +ELSE; + item_locations = [ + { 'code' => '', 'value' => 'All' }, + ]; +END; +%] + +[%- + name = "fi:locations"; + id = "item_locations_selector"; + values = values || CGI.param(name); +-%] + + + diff --git a/templates_tadlskin/opac/parts/searchbar.tt2 b/templates_tadlskin/opac/parts/searchbar.tt2 index da24ffef14..113b146962 100644 --- a/templates_tadlskin/opac/parts/searchbar.tt2 +++ b/templates_tadlskin/opac/parts/searchbar.tt2 @@ -28,7 +28,11 @@ [% IF ctx.bookbag %]