
<!-- Top menu -->
<script id="metadata.list.template" type="text/x-handlebars-template">
  {{#each items}}
    <li class="dropdown">
      <a href="javascript:show_{{@key}}()" class="dropdown-toggle" data-toggle="dropdown"><span id="cloudtrail_dropdown">{{make_title @key}}</span><b class="caret"></b></a>
      <ul class="dropdown-menu">
        <li class="dropdown-header">Summaries</li>
        <li><a href="#services.{{@key}}.violations">Dashboard</a></li>
        {{#each summaries}}
          {{#if risks}}
            <li class="dropdown-submenu"><a href="#{{path}}">{{make_title @key}}</a>
              <ul class="dropdown-menu">
                <li class="dropdown-header">Security risks</li>
                {{#each risks}}
                  <li><a href="#services.{{@../../key}}.violations.{{this}}.items">{{get_value_at 'services' @../../key 'violations' this 'description'}}</a></li>
                {{/each}}
              </ul>
            </li>
          {{else}}
            <li><a href="#{{path}}">{{make_title @key}}</a></li>
          {{/if}}
        {{/each}}
        <li class="divider"></li>
        <li class="dropdown-header">{{make_title @key}} config</li>
        {{#each resources}}
          {{#if risks}}
            <li class="dropdown-submenu"><a href="#{{full_path}}">{{make_title @key}} ({{count}})</a>
              <ul class="dropdown-menu">
                <li class="dropdown-header">Security risks</li>
                {{#each risks}}
                  <li><a href="#services.{{@../../key}}.violations.{{this}}.items">{{get_value_at 'services' @../../key 'violations' this 'description'}}</a></li>
                {{/each}}
              </ul>
            </li>
          {{else}}
            <li><a href="#{{full_path}}">{{make_title @key}} ({{count}})</a></li>
          {{/if}}
        {{/each}}
      </ul>
    </li>
  {{/each}}
</script>

