<div class='wrap'>
  <div class='contents clearfix'>
    {{home-logo minimized=showExtraInfo}}
    {{plugin-outlet "header-after-home-logo"}}

    <div class='panel clearfix'>
      {{#unless currentUser}}
        {{#if showSignUpButton}}
          {{d-button action="showCreateAccount" class="btn-primary btn-small sign-up-button" label="sign_up"}}
        {{/if}}
        {{d-button action="showLogin" class="btn-primary btn-small login-button" icon="user" label="log_in"}}
      {{/unless}}
      <ul class='icons clearfix' role='navigation'>
        {{#if currentUser}}
          {{plugin-outlet "header-before-notifications"}}
        {{/if}}

        {{#header-dropdown iconId="search-button"
                           icon="search"
                           toggleVisible=searchVisible
                           mobileAction="fullPageSearch"
                           loginAction="showLogin"
                           title="search.title"}}
        {{/header-dropdown}}

        {{#header-dropdown iconId="toggle-hamburger-menu"
                           icon="bars"
                           toggleVisible=hamburgerVisible
                           loginAction="showLogin"
                           title="hamburger_menu"}}
          {{#if flaggedPostsCount}}
            <a href='/admin/flags/active' title='{{i18n 'notifications.total_flagged'}}' class='badge-notification flagged-posts'>{{flaggedPostsCount}}</a>
          {{/if}}
        {{/header-dropdown}}

        {{#if currentUser}}
          {{#header-dropdown iconId="current-user"
                             class="current-user"
                             showUser="true"
                             toggleVisible=userMenuVisible
                             loginAction="showLogin"
                             title="user.avatar.header_title"}}
            {{#if currentUser.unread_notifications}}
              <a href {{action "showUserMenu"}} class='badge-notification unread-notifications'>{{currentUser.unread_notifications}}</a>
            {{/if}}
            {{#if currentUser.unread_private_messages}}
              <a href {{action "showUserMenu"}} class='badge-notification unread-private-messages'>{{currentUser.unread_private_messages}}</a>
            {{/if}}
          {{/header-dropdown}}
        {{/if}}
      </ul>
        {{plugin-outlet "header-before-dropdowns"}}
        {{user-menu visible=userMenuVisible logoutAction="logout"}}
        {{hamburger-menu visible=hamburgerVisible showKeyboardAction="showKeyboardShortcutsHelp"}}
        {{search-menu visible=searchVisible}}
    </div>

    {{#if showExtraInfo}}
      {{header-extra-info topic=topic}}
    {{/if}}
  </div>
</div>
