<ul class='docbrowser nav nav-vertical'>
    <%- navigation.each.with_index do |topic_group, groupidx| -%>
      <%- current_group = topic_group[:id] == group_id -%>
        <li class='disabled'>
          <h3><%= topic_group[:name] %></h3>
        </li>
        <%- topic_group[:topics].each.with_index do |topic, topicidx| -%>
          <%- if not topic.has_key?(:topics) -%>
            <%- current_topic = current_group && (topic[:id] == topic_id) -%>
              <li role="menuitem" class="<%= current_topic ? ' active' : '' %>"><a href="<%= subtopic_shim %><%= topic[:path] %>"><%= topic[:name] %></a></li>
          <%- else -%>
            <%- current_subgroup = topic[:id] == subgroup_id -%>
            <!-- <li role="menuitem"><a><%= topic[:name] %></a></li> -->
            <li role="menuitem" class="<%= current_topic ? ' active' : '' %>">
              <a class="" href="javascript:void(0);" data-toggle="collapse" data-target="#topicSubGroup-<%= groupidx %>-<%= topicidx %>">
                <span id="sgSpan-<%= groupidx %>-<%= topicidx %>" class="fa <%= current_subgroup ? 'fa-caret-down' : 'fa-caret-right' %>"></span>&nbsp;<%= topic[:name] %>
              </a>
              <ul id="topicSubGroup-<%= groupidx %>-<%= topicidx %>" class="nav-tertiary list-unstyled collapse<%= current_subgroup ? ' in' : '' %>">
                <%- topic[:topics].each do |subtopic| -%>
                  <%- current_subtopic = current_group && current_subgroup && (subtopic[:id] == topic_id) %>
                  <li class="<%= current_subtopic ? ' active' : '' %>">&nbsp;<a role="menuitem" href="<%= subtopic_shim %><%= subtopic[:path] %>"><%= subtopic[:name] %></strong></a><li>
                <%- end -%>
              </ul>
            </li>
          <%- end -%>
        <%- end -%>
    <%- end -%>
</ul>
