{include file="$template_path/html/header.html"}
{include file="$template_path/js/space.html"}
{include file="$template_path/html/jstemplate.html"}
<script src="/mbthemes/scripts/canvas/animation.js"></script>
</head>
<body>
<div class="app" id="app">
  {include file="$template_path/html/mobile-nav.html"}
  <!-- content -->
  <div id="content" class="app-content box-shadow-z4" role="main">

    <div ui-view class="app-body" id="view">
      <!-- ############ PAGE START-->

      {include file="$template_path/html/user-top.html"}

      <div class="clearfix white">
        <div class="container">
          {$errorMessage}
          <div class="row-col">
            <div class="col-sm b-r b-l">
              <div class="box edit pos-rlt m-b-0">
                <div class="p-a-md">
                  <div class="clearfix">
                    <h3 class="pull-left p-t-xs">公开书签集</h3>
                    <a data-toggle="modal" data-target="#cbook" class="btn btn-outline b-skin text-skin btn-sm pull-right" >
                      创建书签集
                    </a>
                  </div>


                  {if $collections.true}
                  <div class="row text-skin-hover m-t">
                    {foreach from=$collections.true item=c name=foo}
                    <div class="col-xs-6">
                      <div class="box mb-co-b b-a">
                        <div class="item dark">
                          <div class="img-container fx-img-rotate-l fx-opt-zoom-out">
                            {if $c.photo != ''}
                            <img class="w-full" src="{$data_server}/uploads/collections/{$c.photo}" alt="{$i.name|escape}">
                            {else}
                            <img class="w-full" src="{$template_data}img/default-collection.jpg" alt="{$i.name|escape}">
                            {/if}
                            <div class="img-options">
                              <div class="img-options-content">
                                <a href="/{$languageURL}collections/view/{$c.id}" target="_blank" class="btn skin text-white">
                                  <i class="icon-magnifier-add"></i>
                                </a>
                              </div>
                            </div>
                          </div>
                        </div>
                        <a href="/{$languageURL}collections/view/{$c.id}" target="_blank" class="md-btn md-raised md-fab md-mini m-r pos-rlt md-fab-offset pull-right white"><i class="icon-plus2 md-24"></i></a>
                        <div class="p-a">
                          <p class="h-1x m-b-0 text-grey">{$c.text|nl2br}</p>
                          <div class="h-2xx"><a href="/{$languageURL}collections/view/{$c.id}" target="_blank" class="h6">{$c.name}</a></div>
                          <div class="clearfix m-t-xs">
                            <a href="/{$languageURL}user/{$users[$c.user_id].username}" target="_blank" class="pull-left m-r-sm">
                              <span class="w-32 avatar">
                                {if $users[$c.user_id].avatar != ''}
                                <img src="{$data_server}uploads/users/{$c.user_id}/A_{$users[$c.user_id].avatar}" />
                                {else}
                                <span class="circle skin _100 w-32 fs-80">
                                  NP
                                </span>
                                {/if}
                              </span>
                            </a>
                            <a href="/{$languageURL}user/{$users[$c.user_id].username}" target="_blank" class="pull-left m-t-sm clear">
                              {$users[$c.user_id].nickname}
                            </a>
                            <div class="pull-right">
                              <div class="h-32"><a class="price text-grey">{$lang.items}<span class="text-lg"> {$c.items}</span></a></div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                    {/foreach}
                  </div>
                  {else}
                  <div class="row">
                    <div class="col-xs-12 text-center">
                      <section class="box p-y-lg no-shadow no-borders">
                        <div class="box-body h4 p-y-lg text-muted no-radius">
                          还没有公开的书签集
                        </div>
                      </section>
                    </div>
                  </div>
                  {/if}



                </div>
              </div>
            </div>
            <div class="col-sm b-r">

              <div class="box edit pos-rlt m-b-0">
                <div class="p-a-md">
                  <div class="clearfix">
                    <h3 class="pull-left p-t-xs">私人书签集</h3>
                    <a data-toggle="modal" data-target="#cbook" class="btn btn-outline b-danger text-danger btn-sm pull-right">
                      创建私人书签集
                    </a>
                  </div>

                  {if $collections.false}
                  <div class="row text-danger-hover m-t">
                    {foreach from=$collections.false item=c name=foo}
                    <div class="col-xs-6">
                      <div class="box mb-co-b b-a">
                        <div class="item dark">
                          <div class="img-container fx-img-rotate-l fx-opt-zoom-out">
                            {if $c.photo != ''}
                            <img class="w-full" src="{$data_server}/uploads/collections/{$c.photo}" alt="{$i.name|escape}">
                            {else}
                            <img class="w-full" src="{$template_data}img/default-collection.jpg" alt="{$i.name|escape}">
                            {/if}
                            <div class="img-options">
                              <div class="img-options-content">
                                <a href="/{$languageURL}collections/view/{$c.id}" target="_blank" class="btn btn-danger text-white">
                                  <i class="icon-magnifier-add"></i>
                                </a>
                              </div>
                            </div>
                          </div>
                        </div>
                        <a href="/{$languageURL}collections/view/{$c.id}" target="_blank" class="md-btn md-raised md-fab md-mini m-r pos-rlt md-fab-offset pull-right white"><i class="icon-plus2 md-24"></i></a>
                        <div class="p-a">
                          <p class="h-1x m-b-0 text-grey">{$c.text|nl2br}</p>
                          <div class="h-2xx"><a href="/{$languageURL}collections/view/{$c.id}" target="_blank" class="h6">{$c.name}</a></div>
                          <div class="clearfix m-t-xs">
                            <a href="/{$languageURL}user/{$users[$c.user_id].username}" target="_blank" class="pull-left m-r-sm">
                              <span class="w-32 avatar">
                                {if $users[$c.user_id].avatar != ''}
                                <img src="{$data_server}uploads/users/{$c.user_id}/A_{$users[$c.user_id].avatar}" />
                                {else}
                                <span class="circle skin _100 w-32 fs-80">
                                  NP
                                </span>
                                {/if}
                              </span>
                            </a>
                            <a href="/{$languageURL}user/{$users[$c.user_id].username}" target="_blank" class="pull-left m-t-sm clear">
                              {$users[$c.user_id].nickname}
                            </a>
                            <div class="pull-right">
                              <div class="h-32"><a class="price text-grey">{$lang.items}<span class="text-lg"> {$c.items}</span></a></div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                    {/foreach}
                  </div>
                  {else}
                  <div class="row">
                    <div class="col-xs-12 text-center">
                      <section class="box p-y-lg no-shadow no-borders">
                        <div class="box-body h4 p-y-lg text-muted no-radius">
                          还没有私人书签集
                        </div>
                      </section>
                    </div>
                  </div>
                  {/if}


                </div>
              </div>

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


    </div>
    <!-- ############ PAGE END-->
    {include file="$template_path/html/footer.html"}
  </div>
  {include file="$template_path/html/backtop.html"}
  {include file="$template_path/html/mb-settings.html"}
  <!-- ############ LAYOUT END-->
</div>
{literal}
<style>
  .h-1x{
    height: 21px;
    line-height: 21px;
    overflow: hidden;
  }
</style>
{/literal}

{if check_login_bool()}


<div id="cbook" class="modal black-overlay in" data-backdrop="true">
  <div class="modal-dialog modal-sm">


    <form action="" enctype="multipart/form-data" id="new_collection" method="post">
      <div class="modal-content black lt">

        <fieldset>

        <div class="modal-header">
          <h4 class="modal-title">新建书签集</h4>
        </div>
        <div class="modal-body">

          <div class="form-group text-left">
            <label for="name">书签名称</label>
            <input id="collection_name" class="form-control" name="name" type="text" />
          </div>
          <div class="form-group text-left">
            <label for="description">{$lang.description}</label>
            <textarea class="form-control" id="collection_description" name="description" rows="6"></textarea>
          </div>
          <div class="form-group text-left">
            <label for="file_upload">书签封面图</label>
            <input id="file_upload" name="file_upload" class="form-control" type="file">
            <span class="help-block m-b-none">(260 x 140px)</span>
          </div>
          <label class="md-switch" for="collection_publically_visible">
            <input id="collection_publically_visible" name="publically_visible" type="checkbox" checked="" value="1">
            <i class="skin"></i>
            是否为公开书签集?
          </label>
        </div>
        </fieldset>
        <div class="modal-footer" href="javascript: void(0);">
          <button type="button" class="btn white btn-sm" data-dismiss="modal">关闭</button>
          <input type="hidden" name="add" value="yes" />
          <button type="submit" class="btn skin btn-sm p-x-md">{$lang.create}</button>
        </div>
      </div>
    </form>
  </div>
</div>

{/if}

</body>
</html>