{include file="$template_path/html/header.html"}
</head>
<body class="">
<section class="vbox">
  {include file="$template_path/html/pagenav.html"}
  <section>
    <section class="hbox stretch">
      {include file="$template_path/html/mobile-nav.html"}
      <section id="content" class="p-t-llg-xs">

        <section class="clearfix">
          <div class="container m-t-lg m-b-lg m-xs-t-none m-xs-b-md">

            <div class="row">



              <div class="col-xs-12 col-md-7 col-lg-8">
                <div class="row m-b-lg m-xs-b">
                  <div class="col-xs-5">
                    <h3 class="m-t-xs text-black">公开书签集</h3>
                  </div>
                  <div class="col-xs-7 text-right text-left-xs">
                    <form action="" id="sortbyform" method="get" class="pull-right" style="z-index:3;">
                      <input id="order-type" name="order" type="hidden" value="{if $smarty.get.order == 'asc'}desc{else}asc{/if}" />
                      <input type="hidden" id="sort_by" name="sort_by" />
                      <div class="">
                        <a href="javascript: void(0);" onclick="document.getElementById('sort_by').value='average_rating';document.getElementById('sortbyform').submit();"{if $smarty.get.sort_by == 'average_rating'} class="btn btn-icon btn-rounded btn-ghost-info m-b-xs m-l-sm active pull-right" {else} class="btn btn-icon btn-rounded btn-ghost-info m-b-xs m-l-sm pull-right" {/if} title="" data-toggle="tooltip" data-placement="bottom" data-original-title="按评分排序">
                        <i class="i i-like"></i>
                        </a>
                        <a href="javascript: void(0);" onclick="document.getElementById('sort_by').value='name';document.getElementById('sortbyform').submit();"{if $smarty.get.sort_by == 'name'} class="btn btn-icon btn-rounded btn-ghost-info m-b-xs m-l-sm active pull-right" {else} class="btn btn-icon btn-rounded btn-ghost-info m-b-xs m-l-sm pull-right"{/if} title="" data-toggle="tooltip" data-placement="bottom" data-original-title="按标题排序">
                        <i class="i i-shuffle"></i>
                        </a>
                        <a href="javascript: void(0);" onclick="document.getElementById('sort_by').value='published_at';document.getElementById('sortbyform').submit();"{if $smarty.get.sort_by == 'published_at'} class="btn btn-icon btn-rounded btn-ghost-info m-b-xs m-l-sm active pull-right" {else} class="btn btn-icon btn-rounded btn-ghost-info m-b-xs m-l-sm pull-right"{/if} data-toggle="tooltip" data-placement="bottom" data-original-title="按日期排序">
                        <i class="i i-down"></i>
                        </a>
                      </div>
                    </form>
                  </div>
                </div>


                {if $collections}
                <div class="row">
                  {foreach from=$collections item=c}
                  <div class="col-xs-6 col-md-6 col-lg-4">
                    <section class="panel mb-col no-radius no-shadow">
                      <div class="panel-body no-padder">
                        <div class="img-container fx-img-rotate-l">
                          {if $c.photo != ''}
                          <img alt="{$c.name|escape}" src="{$data_server}/uploads/collections/{$c.photo}" class="img-responsive" />
                          {else}
                          <img alt="{$c.name|escape}" src="{$template_data}img/default-collection.jpg" class="img-responsive" />
                          {/if}
                          <div class="img-options">
                            <div class="img-options-content">
                              <a href="/{$languageURL}collections/view/{$c.id}" class="btn btn-info btn-lg hidden-xs" data-toggle="tooltip" data-placement="bottom" data-original-title="查看书签集">
                                <i class="i i-layer2"></i>
                              </a>
                            </div>
                          </div>
                        </div>
                        <div class="cate-bg cates-2">
                          <span class="cate-text"><span class="fs-16 fm-sf m-r-sm">{$c.votes}</span><small>评分</small></span>
                        </div>
                      </div>
                      <div class="panel-footer pos-rlt bg-white-only panel-shadow no-radius">
                        <div class="ss-underline">
                          <a href="/{$languageURL}collections/view/{$c.id}">
                            {$c.name}
                          </a>
                        </div>
                        <div class="clearfix">
                          <div class="datetime m-r-sm pull-left hidden-xs">
                            <span class="date">{$c.items}</span>
                            <span class="month">{$lang.items}</span>
                          </div>
                          <h4 class="m-t-none m-b-none-xs"><a href="/{$languageURL}collections/view/{$c.id}" class="height-h4">{$c.text|nl2br}</a></h4>
                        </div>

                        <a href="/{$languageURL}user/{$users[$c.user_id].username}" class="panel-thumb hidden-xs" data-toggle="tooltip" data-placement="bottom" data-original-title="{$users[$c.user_id].username}">
                          {if $users[$c.user_id].avatar != ''}
                          <img alt="{$users[$c.user_id].nickname}" class="img-circle" src="{$data_server}uploads/users/{$c.user_id}/A_{$users[$c.user_id].avatar}" />
                          {else}
                          <img alt="{$users[$c.user_id].nickname}" class="img-circle" src="{$data_server}home/default/img/default-user.jpg" />
                          {/if}
                        </a>

                      </div>
                    </section>
                  </div>
                  {/foreach}
                </div>
                {$paging}
                {else}
                <div class="row">
                  <div class="col-xs-12 text-center">
                    <section class="panel no-radius p-t-lg p-b-lg panel-shadow">
                      <div class="panel-body bg-white-only no-radius">
                        <h3>{$lang.no_collections}</h3>
                      </div>
                    </section>
                  </div>
                </div>
                {/if}
              </div>


              <div class="col-xs-12 col-md-5 col-lg-4">
                <div class="m-b-lg m-xs-b-md h3">
                  <span class="font-thin text-danger">书签集</span>
                  <span class="font-thin h4 text-black">是什么？</span>
                  <span class="badge bg-warning lt v-middle font-thin">
                    <a class="text-white-i" href="/{$languageURL}user/bookmarks/" target="_blank"> 我要创建</a>
                  </span>
                </div>


                <div class="row">
                  <div class="col-xs-12">
                    <section class="panel mb-col no-radius no-shadow">
                      <div class="panel-body">
                        <div class="img-container fx-img-rotate-l">
                          <img class="w-full" alt="{$collection.name|escape}" src="{$template_data}img/default-collection.jpg" />
                          <div class="img-options">
                            <div class="img-options-content">

                            </div>
                          </div>
                        </div>
                      </div>
                      <div class="panel-footer pos-rlt bg-white-only panel-shadow no-radius">
                        <div class="ss-underline">
                          <h4>书签集是用户喜欢的作品的集合。</h4>
                        </div>
                        <div class="clearfix">
                          {if check_login_bool()}
                          {if $smarty.session.user.quiz == 'true'}
                            <a href="/{$languageURL}author_dashboard/" class="thumb pull-left m-r-md">
                              {else}
                            <a href="/{$languageURL}user/{$smarty.session.user.username}" class="thumb pull-left m-r-md">
                          {/if}
                          {if $smarty.session.user.avatar != ''}
                          <img class="img-circle" alt="{$user.username}" src="{$data_server}uploads/users/{$smarty.session.user.user_id}/A_{$smarty.session.user.avatar}" />
                              {else}
                          <img class="img-circle" alt="{$smarty.session.user.username}" src="{$template_data}img/default-user.jpg" />
                          {/if}
                            </a>
                              {else}
                              <a href="/{$languageURL}sign_in/" class="thumb pull-left m-r-md">
                                <img class="img-circle" alt="请登录" src="{$template_data}img/default-user.jpg" />
                              </a>
                          {/if}
                          <p class="m-t-xs">
                            书签集分为公开和私人两种，这里显示的是公开书签集。
                          </p>
                        </div>



                        {if check_login_bool() && $collection.user_id == $smarty.session.user.user_id}
                        <div class="clearfix m-t-md p-t-md m-b-sm b-t">
                          <div class="col-xs-6">
                            <button class="btn btn-ghost-dark btn-rounded btn-xs-xs btn-block" type="submit" data-toggle="modal" data-target="#cbook">
                              <i class="fa fa-star m-r-xs fs-16"></i>编辑书签集
                            </button>
                          </div>
                          <div class="col-xs-6">
                            <form class="block" action="" method="post">
                              <input type="hidden" name="delete" value="yes" />
                              <button type="submit" onclick="return confirm('确定删除这个书签集吗？');" class="btn btn-ghost-danger btn-rounded btn-xs-xs btn-block">删除此书签</button>
                            </form>
                          </div>
                        </div>
                        {/if}

                      </div>
                    </section>
                  </div>
                </div>
              </div>


            </div>

          </div>
        </section>
        {include file="$template_path/html/footer.html"}

      </section>
    </section>
  </section>
</section>
</body>
</html>