]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/web/templates/default/opac/common.tt2
Proof of concept Template-Toolkit OPAC
[Evergreen.git] / Open-ILS / web / templates / default / opac / common.tt2
1 [% 
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.org_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 * 4;
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 [% PROCESS 'default/opac/marc_attrs.tt2' %]
26
27