refactor sidebar inclusion

This commit is contained in:
Oliver Gorwits
2012-02-02 15:06:52 +00:00
parent fe1f1fa2fd
commit fc9b86e852
9 changed files with 25 additions and 41 deletions

View File

@@ -11,14 +11,13 @@
[% FOREACH tab IN vars.tabs %]
<div id="[% tab.id %]_search" class="tab-pane [% 'active' IF params.tab == tab.id %]">
<form id="[% tab.id %]_form" class="nd_sidesearchform form-stacked" method="get" action="[% uri_for('/search') %]">
<input name="q" value="[% params.q %]" type="hidden"/>
<input name="tab" value="[% tab.id %]" type="hidden"/>
[% TRY %]
[% INCLUDE "sidebar/search/${tab.id}.tt" %]
<button id="[% tab.id %]_submit" type="submit" class="btn info span3">Search Again</button>
<script type="text/javascript">has_sidebar["[% tab.id %]"] = 1;</script>
[% CATCH %]
<!-- no "[% tab.id %]" search options -->
<input name="q" value="[% params.q %]" type="hidden"/>
<script type="text/javascript">has_sidebar["[% tab.id %]"] = 0;</script>
[% END %]
</form>