<template name="header">
    <nav class="navbar navbar-default" role="navigation">
        <div class="container-fluid">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navigation">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="{{pathFor 'home'}}">
                    <span class="glyphicon glyphicon-home" aria-hidden="true"></span> mCotton </a>
                <a class="navbar-brand" href="{{pathFor 'projectsList'}}">
                    <span class="glyphicon glyphicon-ice-lolly" aria-hidden="true"></span> Projects </a>

                {{#if currentUser}}
                    <a class="navbar-brand" href="{{pathFor 'devicesList'}}">
                        <span class="glyphicon glyphicon-ice-lolly-tasted" aria-hidden="true"></span> Devices </a>
                    <!--<a class="navbar-brand" href="{{pathFor 'myModulesList'}}">-->
                    <!--<span class="glyphicon glyphicon-tree-conifer" aria-hidden="true"></span> My Modules </a>-->
                {{/if}}

                {{#if isInRole 'admin'}}
                    <a href="#" class="navbar-brand dropdown-toggle" data-toggle="dropdown"
                       role="button" aria-haspopup="true" aria-expanded="false">
                        <span class="glyphicon glyphicon-cog" aria-hidden="true"></span>
                        Admin <b class="caret"></b>
                    </a>
                    <ul class="dropdown-menu navbar-nav">
                        <li><a href="/admin"> Admin </a></li>
                        <li><a href="{{pathFor 'modulesList'}}"> Modules </a></li>
                        <li><a href="{{pathFor 'imageStore'}}"> Image Store </a></li>
                    </ul>
                {{/if}}
            </div>
            <div class="collapse navbar-collapse" id="navigation">
                <ul class="nav navbar-nav navbar-right">
                    {{> loginButtons}}
                </ul>
            </div>
        </div>
    </nav>
</template>