<!-- .aside -->
<aside class="bg-black aside-md hidden-print visible-xs-block shift" id="nav">
  <section class="vbox">
    <section class="w-f scrollable">
      <div class="slim-scroll" data-height="auto" data-disable-fade-out="true" data-distance="0" data-size="10px" data-railOpacity="0.2">
        <div class="clearfix wrapper nav-users p-t-llg-xs m-xs-t p-xs-b-xs hidden-xs">
          <div class="dropdown">
            {if check_login_bool()}
            {if $smarty.session.user.quiz == 'true'}<a href="/{$languageURL}author_dashboard/" class="dropdown-toggle" data-toggle="dropdown">{else}<a href="/{$languageURL}user/{$smarty.session.user.username}" class="dropdown-toggle" data-toggle="dropdown">{/if}
                      <span class="thumb avatar pull-left m-r">
                        {if $smarty.session.user.avatar != ''}
              <img class="dker" alt="{$user.username}" src="{$data_server}uploads/users/{$smarty.session.user.user_id}/A_{$smarty.session.user.avatar}" />
              {else}
              <img class="dker" alt="{$smarty.session.user.username}" src="{$template_data}img/default-user.jpg" />
              {/if}
                        <i class="on md b-black"></i>
                      </span>
                      <span class="hidden-nav-xs clear">
                        <span class="block">
                          <strong class="font-bold text-lt">{$smarty.session.user.username}</strong>
                          <b class="caret"></b>
                        </span>
                        <span class="text-muted text-xs block m-t-xs">
                          {if $smarty.session.user.quiz == 'true'}
              <a href="/{$languageURL}author_dashboard/" class="text-muted">控制面板</a>
              {else}
              <a href="/{$languageURL}make_money/become_an_author/" class="text-muted">成为作者</a>
              {/if}
                        </span>
                      </span>
            </a>
            <ul class="dropdown-menu animated fadeInRight m-t-xs">
              <li><span class="arrow top hidden-nav-xs"></span>
                <a href="/{$languageURL}user/{$smarty.session.user.username}/"><i class="i i-home m-r-sm text-imuted"></i>我的主页</a>
              </li>
              <li><a href="/{$languageURL}edit/"><i class="i i-settings m-r-sm text-imuted"></i>个人设置</a></li>
              <li><a href="/{$languageURL}download/"><i class="i i-folder-download m-r-sm text-imuted"></i>已购买的</a></li>
              <li><a href="/{$languageURL}user/bookmarks/"><i class="fa fa-bookmark m-r-sm text-imuted"></i>我的书签</a></li>
              <li><a href="/{$languageURL}statement/"><i class="i i-stats m-r-sm text-imuted"></i>出售统计</a></li>
              <li><a href="/{$languageURL}withdrawal/"><i class="fa fa-credit-card m-r-sm text-imuted"></i>我要提现</a></li>
              {if $smarty.session.user.access}
              <li><a href="/{$languageURL}admin/"><i class="i i-gauge m-r-sm text-imuted"></i>管理面板</a></li>
              {/if}

              <li>
                <form action="/{$languageURL}users/logout/" method="post">
                  <button type="submit" class="btn btn-info btn-block text-left-xs" id="sign-out-button"><i class="i i-logout m-r-xs m-l-xs"></i> 退出登录</button>
                </form>
              </li>
            </ul>
            {else}
            <a href="/{$languageURL}sign_in/" class="dropdown-toggle" data-toggle="dropdown">
                      <span class="thumb avatar pull-left m-r">
                        <img src="{$template_data}img/default-user.jpg" class="dker" alt="...">
                        <i class="off md b-black"></i>
                      </span>
                      <span class="hidden-nav-xs clear">
                        <span class="block m-t-xs">
                          <strong class="font-bold text-lt">未登录</strong>
                          <b class="caret"></b>
                        </span>
                        <span class="text-muted text-xs block">喵喵喵</span>
                      </span>
            </a>
            <ul class="dropdown-menu animated fadeInRight m-t-xs">

              <li><span class="arrow top hidden-nav-xs"></span>
                <a href="/{$languageURL}sign_up/"><i class="i i-earth m-r-sm text-imuted"></i>创建账号</a>
              </li>
              <li><a href="/{$languageURL}sign_in/"><i class="i i-user2 m-r-sm text-imuted"></i>登录</a></li>
            </ul>
            {/if}
          </div>
        </div>
        <div class="line hidden-nav-xs box-shadow"></div>
        <!-- nav -->
        <nav class="nav-primary hidden-xs">
          <div class="text-muted text-sm hidden-nav-xs padder m-t-sm m-b-sm">网站导航</div>
          <ul class="nav nav-main" data-ride="collapse">
            <li >
              <a href="#" class="auto">
                        <span class="pull-right text-muted">
                          <i class="i i-circle-sm-o text"></i>
                          <i class="i i-circle-sm text-active"></i>
                        </span>
                <b class="badge bg-info pull-right">{$itemsCount}</b>
                <i class="i i-statistics icon">
                </i>
                <span class="font-bold">全部文件</span>
              </a>
              <ul class="nav dk">
                <li >
                  <a href="/{$languageURL}categories/all/" class="auto">
                    <i class="i i-dot"></i>
                    <span>全部文件</span>
                  </a>
                </li>
                <li><a href="/{$languageURL}top_sellers/" class="auto"><i class="i i-dot"></i><span>本周热门</span></a></li>
                <li><a href="/{$languageURL}categories/all/?order=desc&sort_by=sales_count" class="auto"><i class="i i-dot"></i><span>按销量查看</span></a></li>
                <li><a href="/{$languageURL}collections/" class="auto"><i class="i i-dot"></i><span>公开书签集</span></a></li>
                <li><a href="/{$languageURL}top_authors/" class="auto"><i class="i i-dot"></i><span>王牌作者</span></a></li>
              </ul>
            </li>

            {if $mainCategories}
            {foreach from=$mainCategories item=c}
            <li>
              <a href="#" class="auto">
                <span class="pull-right text-muted">
                  <i class="i i-circle-sm-o text"></i>
                  <i class="i i-circle-sm text-active"></i>
                </span>
                <i class="i i-docs icon"></i>
                <span class="font-bold">{$c.name}</span>
              </a>
              {if isset($allCats[$c.id])}
              <ul class="nav dk">
                <li><a href="/{$languageURL}categories/{$c.id}" class="auto"><i class="i i-bar"></i>全部作品</a></li>
                <li><a href="/{$languageURL}categories/{$c.id}?sort_by=sales_count&order=desc" class="auto"><i class="i i-health2"></i>热门作品</a></li>
                {foreach from=$allCats[$c.id] item=s}
                <li><a href="/{$languageURL}categories/{$s.id}" class="auto"><i class="i i-dot"></i><span>{$s.name}</span></a></li>
                {/foreach}
              </ul>
              {/if}
            </li>
            {/foreach}
            {/if}

          </ul>
          <div class="line hidden-nav-xs box-shadow"></div>
          <div class="text-muted text-xs hidden-nav-xs padder m-t-sm m-b-sm">常用入口</div>
          <ul class="nav">
            <li>
              <a href="/{$languageURL}categories/1?order=desc&sort_by=cost">
                <i class="i i-circle-sm text-info-dk"></i>
                <span>热门作品</span>
              </a>
            </li>
            <!--<li>
              <a href="#">
                <i class="i i-circle-sm text-success-dk"></i>
                <span>最新作品</span>
              </a>
            </li>
            <li>
              <a href="#">
                <i class="i i-circle-sm text-danger-dk"></i>
                <span>推荐作品</span>
              </a>
            </li>-->
          </ul>
          <div class="text-muted text-xs hidden-nav-xs padder m-t-sm m-b-sm">其它链接</div>
          <div class="col-xs-12">
            <a href="/{$languageURL}upload/" class="btn btn-sm btn-info btn-xs-xs">上传作品</a>
            <a href="/{$languageURL}deposit/" class="btn btn-sm btn-danger btn-xs-xs m-l-sm">我要充值</a>
          </div>
        </nav>
        <!-- / nav -->
      </div>
    </section>
  </section>
</aside>
<!-- /.aside -->