<nav class="navbar navbar-inverse navbar-fixed-top">
  <div class="container-fluid">
    <div class="row">
      <div class="col-md-12">
        <div class="navbar-header">
          <button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target="#navbar-collapse">
            <span class="sr-only">{{t "header.toggle_navigation"}}</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a href="/stream" class="navbar-brand" data-stream-title="{{t "my_stream"}}">
            <span class="hidden-xs">{{ podname }}</span>
            <div class="visible-xs-block header-title">
              <img src="{{imageUrl 'branding/logos/asterisk_white_mobile.png'}}" alt="{{ podname }}" />
            </div>
          </a>
          <ul class="nav navbar-nav hidden-xs">
            <li><a href="/stream">{{t "my_stream"}}</a></li>
            <li><a href="/activity">{{t "my_activity"}}</a></li>
          </ul>
          <ul class="nav navbar-nav nav-badges">
            <li class="dropdown" id="notification-dropdown">
              <a id="notifications-link" href="/notifications" title="{{t "header.notifications"}}" class="notifications-link nav-badge"
                role="button" data-toggle="dropdown" aria-expanded="false" data-target=" ">
                <i class="entypo-bell"></i>
                <span class="badge badge-important {{#unless current_user.notifications_count}} hidden {{/unless}}">
                  {{current_user.notifications_count}}
                </span>
              </a>
              <ul class="dropdown-menu" role="menu">
                <div class="header">
                  <div class="pull-right">
                    <a href="#" id="mark-all-read-link" class="btn btn-default btn-sm {{#unless current_user.notifications_count}}disabled{{/unless}}">
                      {{t "header.mark_all_as_read"}}
                    </a>
                  </div>
                  <h4>
                    {{t "header.recent_notifications"}}
                  </h4>
                </div>
                <div class="ajax-loader">
                  <div class="spinner"></div>
                </div>
                <div class="notifications"></div>
                <div class="view_all">
                  <a href="/notifications" id="view_all_notifications">
                    {{t "header.view_all"}}
                  </a>
                </div>
              </ul>
            </li>
            <li>
              <a id="conversations-link" href="/conversations" title="{{t "header.conversations"}}" class="conversations-link nav-badge">
                <i class="entypo-mail"></i>
                <span class="badge badge-important {{#unless current_user.unread_messages_count}} hidden {{/unless}}">
                  {{current_user.unread_messages_count}}
                </span>
              </a>
            </li>
          </ul>
        </div>
        <div class="collapse navbar-collapse" id="navbar-collapse">
          <ul class="nav navbar-nav navbar-left visible-sm-block visible-xs-block">
            <li class="visible-xs-block"><a href="/stream">{{t "my_stream"}}</a></li>
            <li class="visible-xs-block"><a href="/activity">{{t "my_activity"}}</a></li>
            <li><a href="/mobile/toggle">{{t "header.toggle_mobile"}}</a></li>
          </ul>

          <ul class="nav navbar-nav navbar-right">
            <li class="dropdown user-menu" id="user-menu">
              <a href="{{urlTo "person" current_user.guid}}" class="dropdown-toggle hidden-xs hidden-sm" data-toggle="dropdown" role="button" aria-expanded="false">
                <span class="user-avatar pull-left">
                  {{{personImage current_user "small"}}}
                </span>
                <span class="user-name">{{current_user.name}}</span>
                <span class="caret"></span>
              </a>

              <ul class="dropdown-menu user-menu-dropdown" role="menu">
                <li><a href="/people/{{current_user.guid}}">{{t "header.profile"}}</a></li>
                <li><a href="/contacts">{{t "header.contacts"}}</a></li>
                <li><a href="/user/edit">{{t "header.settings"}}</a></li>
                <li><a href="/help">{{t "header.help"}}</a></li>
                {{#if current_user.admin}}
                  <li><a href="/admins/dashboard">{{t "header.admin"}}</a></li>
                {{else if current_user.moderator}}
                   <li><a href="/report">{{t "header.moderator"}}</a></li>
                {{/if}}
                <li><a href="/users/sign_out" data-method="delete">{{t "header.log_out"}}</a></li>
              </ul>
            </li>
          </ul>

          <form id="header-search-form" accept-charset="UTF-8" action="/search" class="navbar-form navbar-right" role="search" method="get">
            <div class="form-group">
              <input id="q" name="q" placeholder="{{t "header.search"}}" results="5" type="search" autocomplete="off" class="form-control input-sm">
            </div>
            <input name="utf8" type="hidden" value="✓">
          </form>
        </div>
      </div>
      </div>
    </div>
  </div>
</nav>
