<div class="app-header navbar-md white no-radius grey dk no-bg">
  <div class="container">
    <div class="navbar">
      {include file="$template_path/html/logo.html"}
      <!-- nabar right -->
      <ul class="nav navbar-nav pull-right">
        <li class="nav-item main-i hidden-md-up">
          <a data-toggle="modal" data-target="#aside" class="nav-link">
            <span><i class="nav-text icon-list"></i></span>
          </a>
        </li>
        <li class="nav-item main-i m-l-md hidden-md-up">
          <a data-toggle="collapse" data-target="#navbar-4" class="nav-link">
            <span><i class="nav-text icon-magnifier"></i></span>
          </a>
        </li>
        <li class="nav-item main-i dropdown hidden-xs-down">
          <a href class="nav-link" data-toggle="dropdown" title="账户余额">
            <i class="nav-text icon-wallet"></i>
            <span class="label up p-a-0 accent"></span>
          </a>
          {if check_login_bool()}
          <div class="dropdown-menu w-lg text-color no-borders pull-right p-a-0 animated flipInX" style="right: -30px">
            <div class="box r-t r-b grey dk m-b-0">
              <span class="arrow top pull-right b-grey" style="right: 52px;"></span>
              <div class="box-body text-center">
                <h6 class="text-u-c p-v-sm m-a-0 m-t">我的账户</h6>
                <h3 class="m-a-0 m-l m-v p-t-md">
                  <sup class="price text-sm" style="top: -.3rem;">￥</sup>
                  <span class="h2 price">{$smarty.session.user.total|string_format:"%.2f"}</span>
                  <span class="text-xs">/ 可用</span>
                </h3>
              </div>
              <div class="box-footer p-t-sm p-b-md text-center">
                <a href="/{$languageURL}deposit/" target="_blank" class="btn btn-fw p-y-xs skin">充值</a>
              </div>
            </div>
          </div>
          {else}
          <div class="dropdown-menu pull-right dropdown-menu-scale white lt sub-drop b-skin">
            <a href="/{$languageURL}sign_in/" class="dropdown-item"><span class="nav-text">登录</span></a>
            <a href="/{$languageURL}sign_up/" class="dropdown-item"><span class="nav-text">注册</span></a>
          </div>
          {/if}
        </li>
        <li class="nav-item main-i hidden-xs-down" data-toggle="tooltip" data-placement="bottom" title="控制面板" >
          <a href="/{$languageURL}settings/" class="nav-link">
            <span><i class="nav-text icon-settings"></i></span>
          </a>
        </li>
        {if check_login_bool()}
        <li class="nav-item dropdown">
          <a href="/{$languageURL}user/{$smarty.session.user.username}" class="nav-link dropdown-toggle" data-toggle="dropdown">
            {if $smarty.session.user.avatar != ''}
            <span class="w-32 avatar">
              <img alt="{$user.username}" src="{$data_server}uploads/users/{$smarty.session.user.user_id}/A_{$smarty.session.user.avatar}" />
            </span>
            {else}
            <span class="w-32 circle skin _100">
              NP
            </span>
            {/if}
          </a>
          <div class="dropdown-menu w-xxl pull-right dropdown-menu-scale p-a-0">
            <div class="box white text-center m-b-0">
              <span class="arrow top pull-right b-skin" style="right: 42px;"></span>
              <div class="p-a skin b-b">
                <p>
                  <a href="/{$languageURL}user/{$smarty.session.user.username}" class="hover" title="个人主页">
                    {if $smarty.session.user.avatar != ''}
                    <img alt="{$user.username}" src="{$data_server}uploads/users/{$smarty.session.user.user_id}/A_{$smarty.session.user.avatar}" class="img-circle w-96 b-a b-3x b-white hover-rotate360" />
                    {else}
                    <span class="w-96 circle skin text-md b-a b-3x b-white hover-rotate360">
                      <span class="price opacity" style="vertical-align: 0%;">NOPIC</span>
                    </span>
                    {/if}
                  </a>
                </p>
                <a href="/{$languageURL}user/{$smarty.session.user.username}" class="h4 block">
                  {$smarty.session.user.username}
                </a>
                <p class="m-b-0"><small>{if $smarty.session.user.profile_title != ''}{$smarty.session.user.profile_title}{else}您太懒了，未填写签名哦{/if}</small></p>
              </div>
              <div class="row white white lt wr no-gutter text-skin-hover">
                <div class="col-xs-4 b-r b-b">
                  <a href="/{$languageURL}user/{$smarty.session.user.username}" class="p-a block text-center">
                    <i class="icon-home md-24 text-muted m-v-sm"></i>
                    <span class="block">主页</span>
                  </a>
                </div>
                <div class="col-xs-4 b-r b-b">
                  <a href="/{$languageURL}author_dashboard/" class="p-a block text-center">
                    <i class="icon-speedometer md-24 text-muted m-v-sm"></i>
                    <span class="block">控制台</span>
                  </a>
                </div>
                <div class="col-xs-4 b-b">
                  {if $smarty.session.user.quiz == 'true'}
                  <a href="/{$languageURL}upload/" class="p-a block text-center">
                    <i class="icon-note md-24 text-muted m-v-sm"></i>
                    <span class="block">发布作品</span>
                  </a>
                  {else}
                  <a href="/{$languageURL}author_dashboard/" class="p-a block text-center">
                    <i class="icon-note md-24 text-muted m-v-sm"></i>
                    <span class="block">成为作者</span>
                  </a>
                  {/if}
                </div>
                <div class="col-xs-4 b-r">
                  <a href="/{$languageURL}download/" class="p-a block text-center">
                    <i class="icon-cloud-download md-24 text-muted m-v-sm"></i>
                    <span class="block">已购买</span>
                  </a>
                </div>
                <div class="col-xs-4 b-r">
                  <a href="/{$languageURL}user/bookmarks/" class="p-a block text-center">
                    <i class="icon-star md-24 text-muted m-v-sm"></i>
                    <span class="block">书签</span>
                  </a>
                </div>
                <div class="col-xs-4">
                  <a href="/{$languageURL}users/logout/" class="p-a block text-center" id="sign-out-button">
                    <i class="icon-power md-24 text-muted m-v-sm"></i>
                    <span class="block text-sm">退出</span>
                  </a>
                </div>
              </div>
            </div>
          </div>
        </li>
        {else}


        <li class="nav-item dropdown">
          <a href="#" class="nav-link dropdown-toggle clear" data-toggle="dropdown">
            <span class="circle skin _100 w-32">
              NP
            </span>
          </a>
          <!--<div class="dropdown-menu w-sm text-color no-borders pull-right p-a-0 animated flipInX">
            <div class="box r-t r-b m-b-0 skin">
              <span class="arrow top pull-right b-skin" style="right: 42px;"></span>
              <div class="box-body text-center">
                <a href="/{$languageURL}sign_in/" class="dropdown-item"><span class="nav-text">登录</span></a>
                <a href="/{$languageURL}sign_up/" class="dropdown-item m-t-xs"><span class="nav-text">注册</span></a>
              </div>
            </div>
          </div>-->
          <div class="dropdown-menu pull-right dropdown-menu-scale white lt sub-drop b-skin">
            <a href="/{$languageURL}sign_in/" class="dropdown-item"><span class="nav-text">登录</span></a>
            <a href="/{$languageURL}sign_up/" class="dropdown-item"><span class="nav-text">注册</span></a>
          </div>
        </li>
        {/if}
      </ul>
      <!-- / navbar right -->
      <!-- navbar collapse -->
      <div class="collapse navbar-toggleable-sm" id="navbar-4" data-pjax>
        <!-- search form -->
        <form id="search" action="/{$languageURL}search/" method="GET" class="navbar-form form-inline pull-right pull-none-sm navbar-item v-m m-s" role="search">
          <div class="form-group l-h m-a-0">
            <div class="input-group input-group-sm">
              <input type="text" class="form-control p-x b-a rounded" name="term" placeholder="Search projects..." />
              <span class="input-group-btn">
                <button type="submit" class="btn white b-a rounded no-b-l no-shadow"><i class="icon-magnifier"></i></button>
              </span>
            </div>
          </div>
        </form>
        <!-- / search form -->
        <!-- link and dropdown -->
        <div class="nav h-nav navbar-nav pull-left hidden-sm-down b-skin m-l-md">

          {if $mainCategories}
          {foreach from=$mainCategories item=c}
          <li class="nav-item main-nav dropdown myDrop">
            <a href="/{$languageURL}categories/{$c.id}" class="nav-link dropdown-toggle">
              <span class="nav-text">{$c.name}</span>
            </a>
            {if isset($allCats[$c.id])}
            <div class="dropdown-menu dropdown-menu-scale white lt sub-drop b-skin">
              <a href="/{$languageURL}categories/{$c.id}?sort_by=sales_count&order=desc" class="dropdown-item p-y-sm"><span class="nav-text">热门作品</span></a>
              {foreach from=$allCats[$c.id] item=s}
              <a href="/{$languageURL}categories/{$s.id}" class="dropdown-item p-y-sm"><span class="nav-text">{$s.name}</span></a>
              {/foreach}
            </div>
            {/if}
          </li>
          {/foreach}
          {/if}
        </div>
        <!-- / link and dropdown -->
      </div>
      <!-- / navbar collapse -->
    </div>
  </div>
</div>