]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/web/templates/default/opac/parts/libselect.tt2
f41d0e420b58d1097e565a35a0e4dc3c3591f6d0
[Evergreen.git] / Open-ILS / web / templates / default / opac / parts / libselect.tt2
1 [%  # XXX TODO probably put this BLOCK somewhere else so it can be used widely.
2     # Org Unit Selector Widget :
3     #   PROCESS build_org_selector id='selector-id' name='selector-name'
4     BLOCK build_org_selector;
5         first_run = 0;
6         IF !org_unit;
7             org_unit = ctx.aou_tree;
8             first_run = 1;
9 %]
10     <select id='[% id %]' name='[% name %]'>
11     [% END %]
12         <option value='[% org_unit.id %]' [% IF org_unit.id == value %] selected='selected' [% END %]>
13             [%
14                 pad = org_unit.ou_type.depth * 2;
15                 FOR idx IN [0..pad]; '&nbsp;'; END;
16                 org_unit.name;
17             %]
18         </option>
19         [% FOR child IN org_unit.children; PROCESS build_org_selector org_unit = child; END %]
20     [% IF first_run %]
21     </select>
22     [% END %]
23 [% END %]
24
25 <!-- ****************** libselect.xml ***************************** -->
26     <span id='depth_selector_span'>
27         [% PROCESS build_org_selector name='loc' %]
28     </span>
29     <span id='lib_selector_span'>
30         <a id='lib_selector_link' class='classic_link'
31             href='#'>[% l("Choose a library to search") %]</a>
32     </span>
33 <!-- ****************** end: libselect.xml ***************************** -->