<i class="nd_sidebar-toggle icon-wrench icon-large" id="nd_sidebar-toggle-img-out"
  rel="tooltip" data-placement="left" data-offset="5" data-title="Show Sidebar"></i>
<div class="container-fluid">
  <div class="nd_sidebar">
    <div class="well">
      <i class="nd_sidebar-toggle icon-signout" id="nd_sidebar-toggle-img-in"
        rel="tooltip" data-placement="left" data-offset="5" data-title="Hide Sidebar" data-container="body"></i>
      <i class="nd_sidebar-pin icon-pushpin"
        rel="tooltip" data-placement="left" data-offset="5" data-title="Pin Sidebar" data-container="body"></i>
      <div class="tab-content">
        [% FOREACH tab IN settings._search_tabs %]
        <div id="[% tab.tag | html_entity %]_search" class="tab-pane [% 'active' IF params.tab == tab.tag %]">
          <form id="[% tab.tag | html_entity %]_form" class="nd_sidebar-form form-stacked" method="get" action="[% uri_for('/search') | none %]">
            <input name="tab" value="[% tab.tag | html_entity %]" type="hidden"/>
            [% TRY %]
            <script type="text/javascript">has_sidebar["[% tab.tag | html_entity %]"] = 1;</script>
            [% INCLUDE "sidebar/search/${tab.tag}.tt" %]
            [% CATCH %]
            <!-- no "[% tab.tag | html_entity %]" search options -->
            <input name="q" value="[% params.q | html_entity %]" type="hidden"/>
            <script type="text/javascript">has_sidebar["[% tab.tag | html_entity %]"] = 0;</script>
            [% END %]
          </form>
        </div> <!-- /tab-pane -->
        [% END %]
      </div> <!-- /tab-content -->
    </div>
  </div>

  <div class="content">
    <ul id="nd_search-results" class="nav nav-tabs">
      [% FOREACH tab IN settings._search_tabs %]
      <li[% ' class="active"' IF params.tab == tab.tag %]><a id="[% tab.tag | html_entity %]_link" href="#[% tab.tag | html_entity %]_pane">[% tab.label | html_entity %]</a></li>
      [% END %]
      <span id="nd_device-name">
        <a id="nd_csv-download" href="#" download="netdisco.csv">
          <i id="nd_csv-download-icon" class="text-info icon-file-text-alt icon-large"
            rel="tooltip" data-placement="left" data-offset="5" data-title="Download as CSV"></i></a>
      </span>
    </ul>
    <div class="tab-content">
      [% FOREACH tab IN settings._search_tabs %]
      <div class="tab-pane[% ' active' IF params.tab == tab.tag %]" id="[% tab.tag | html_entity %]_pane"></div>
      [% END %]
  </div>
</div>

<script type="text/javascript">
[%+ INCLUDE 'js/search.js' -%]
</script>
