michahell/pinbored-nwjs

View on GitHub
App/views/partials/mainnav.html

Summary

Maintainability
Test Coverage
<nav class="navbar navbar-default">
  <div class="container-fluid">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <a class="navbar-brand" href="#/about">
        <img src="images/pinbored/icons/pinbored-icon-48.png">
      </a> 
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="main-nav-bar">
      <ul class="nav navbar-nav">
        <li ng-repeat="navItem in model.navItems" ui-sref-active="active" 
        ng-class="{active: model.activeSection == navItem.name}">
          <a ui-sref="{{navItem.name}}" href="#/{{navItem.name}}">{{navItem.name}}</a>
        </li>
      </ul>
      <ul class="nav navbar-nav navbar-right">
        
        <!-- Single button -->
        <div class="btn-group user-menu-dropdown" uib-dropdown is-open="status.isopen">
          <button type="button" class="btn btn-sm btn-default dropdown-toggle" uib-dropdown-toggle ng-disabled="disabled">
            {{model.username}}<span class="caret"></span>
          </button>
          <ul class="dropdown-menu" role="menu">
            <li ng-repeat="userMenuItem in model.userMenuItems">
              <a ng-click="doAction(userMenuItem.action)">{{userMenuItem.name}}</a>
            </li>
            <li class="divider"></li>
            <li><a ng-click="quit()">quit</a></li>
          </ul>
        </div>

      </ul>
    </div><!-- /.navbar-collapse -->
  </div><!-- /.container-fluid -->
</nav>