<!--
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
  distributed with this work for additional information
  regarding copyright ownership.  The ASF licenses this file
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, either express or implied.  See the License for the
  specific language governing permissions and limitations
  under the License.
-->
<a href="#" class="modules-link-with-icon" uib-dropdown-toggle>
    <svg class="modules-icon hidden-xs" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
        <rect class="modules-icon-obj1" width="4" height="4"/>
        <rect class="modules-icon-obj1" x="8" width="4" height="4"/>
        <rect class="modules-icon-obj1" x="16" width="4" height="4"/>
        <rect class="modules-icon-obj1" y="8" width="4" height="4"/>
        <rect class="modules-icon-obj1" x="8" y="8" width="4" height="4"/>
        <rect class="modules-icon-obj1" x="16" y="8" width="4" height="4"/>
        <rect class="modules-icon-obj1" y="16" width="4" height="4"/>
        <rect class="modules-icon-obj1" x="8" y="16" width="4" height="4"/>
        <rect class="modules-icon-obj1" x="16" y="16" width="4" height="4"/>
    </svg>
    <span class="visible-xs-inline">
        <i class="fa fa-fw fa-puzzle-piece"></i> Modules <span class="caret"></span>
    </span>
</a>
<ul class="dropdown-menu ui-modules" uib-dropdown-menu>
    <!-- put home first -->
    <li role="menuitem"><a href="/" ng-class="{active: ctrl.isModuleActive('/')}">
        <i class="ui-module-icon fa fa-fw fa-home"></i>
        <span class="ui-module-name">Home</span>
    </a></li>
    <li role="menuitem" ng-repeat="module in ctrl.modules track by module.id" ng-if="module.path && !module.type.includes('library-ui-module')">
        <a ng-href="{{module.path}}" class="module" ng-class="{active: ctrl.isModuleActive(module.path)}">
            <i class="ui-module-icon fa fa-fw {{module.icon}}"></i>
            <span class="ui-module-name">{{module.name}}</span>
        </a>
    </li>
    <li role="menuitem" class="about">
        <a href="/#!/about">About {{ ctrl.productName }}</a>
    </li>
</ul>
