[%# First check to see if we have anything selected, otherwise we select all %] [% selectall = 1 | html %] [% FOREACH branch IN branches %] [% IF branch.selected %] [% selectall = 0 | html %] [% END %] [% END %]

Select all | Clear all

[% FOREACH branch IN branches %]
[% IF branch.selected || (selectall == 1) %] [% ELSE %] [% END %]
[% IF loop.count() % 4 == 0 && !loop.last() %]
[% END %] [% END %]