{include file="$template_path/html/header.html"}
<link href="{$template_data}scripts/plug/mobanboxmedia/jquery.mobanboxmedia.css" rel="stylesheet" />
{include file="$template_path/js/arc.html"}
{include file="$template_path/html/jstemplate.html"}
<link href="/mbthemes/assets/font-awesome/css/font-awesome.min.css" rel="stylesheet"/>
<link href="/mbthemes/scripts/libs/jquery/summernote/dist/summernote.css" rel="stylesheet"/>
<script src="/mbthemes/scripts/libs/jquery/summernote/dist/summernote.js"></script>
{literal}
<script>
  $(document).ready(function() {
    $('#summernote').summernote({
      toolbar: [
        ['style', ['bold', 'italic', 'underline']],
        ['color', ['color']],
        ['para', ['ol', 'paragraph']],
        ['fontname', ['fontname']],
        ['fontsize', ['fontsize']],
        ['table', ['table']],
        ['view', ['codeview']],
        ['height', ['height']]
      ]
    });
  });
</script>
<style>
  .note-editor .note-editing-area .note-editable {
    min-height: 150px;
  }
</style>
{/literal}
</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">
    {include file="$template_path/html/pagenav.html"}
    <div class="app-body" id="view">
      <!-- ############ PAGE START-->
      <div class="white">
        <div class="container">
          <div class="row-col">
            <div class="col-sm">
              <div class="box pos-rlt b-l b-r b-b m-b-0">
                <div class="p-a">
                  <div>{$errorMessage}</div>
                  <div class="item dark">
                    <div class="detailimg clr" id="previewdom">
                      <div id="previewobj"></div>
                    </div>
                    <div class="item-overlay black-overlay w-full">
                      <ul class="center nav">
                        <li class="nav-item inline dropdown">
                          <a class="nav-link text-muted" data-toggle="dropdown" aria-expanded="false">
                            <i class="icon-share md-36"></i>
                          </a>
                          <div class="dropdown-menu dropdown-menu-scale pull-right dark">
                            <a class="dropdown-item" href="">微博</a>
                            <a class="dropdown-item" href="">QQ</a>
                            <a class="dropdown-item" href="">QQ空间</a>
                          </div>
                        </li>
                      </ul>
                    </div>
                  </div>
                </div>
                <div class="p-a-md p-t-sm b-b">
                  <h2 class="">
                    {$item.name}
                    {if $item.weekly_to}
                    <a title="这是一件推荐作品" class="btn btn-icon btn-social btn-f-i rounded b-skin text-skin b-a">
                      <i class="ht">荐</i>
                      <i class="icon-like"></i>
                    </a>
                    {/if}

                    {if $item.user.elite_author  == 'true'}
                    <a title="该作品由精英作者发布" class="btn btn-icon btn-social btn-f-i rounded b-danger text-danger b-a">
                      <i class="ht">精</i>
                      <i class="icon-user-following"></i>
                    </a>
                    {/if}

                    {if $item.user.power_elite_author  == 'true'}
                    <a title="该作品由强力精英作者发布" class="btn btn-icon btn-social btn-f-i rounded b-accent text-accent b-a">
                      <i class="ht">强</i>
                      <i class="icon-magnet"></i>
                    </a>
                    {/if}
                  </h2>
                  <p class="text-grey p-t-xs">作品主分类： {foreach from=$item.categories item=e}
                    {foreach from=$e item=c name=foo}
                    <a href="/{$languageURL}categories/{$categories[$c].id}" class="text-skin" title="{$categories[$c].name}">{$categories[$c].name}</a>
                    {if !$smarty.foreach.foo.last}&gt;{/if}
                    {/foreach}
                    {/foreach} 发布时间： <span class="">{$item.datetime|date_format:"%Y-%m-%d"}</span></p>
                  <p class="text-grays m-b-0 text-muted h6">Tags：
                    {foreach from=$item.tags item=t}
                    <a href="" title="{$t.name}" target="_blank" class="text-u-c btn btn-xs rounded grey-200 text-dark">{$t.name}</a>
                    {/foreach}
                    <!--/{$languageURL}items/tag/{$t.name}-->
                  </p>
                  {if check_login_bool() && $smarty.session.user.user_id == $item.user_id}
                  <a class="ribbon ribbon-skin text-md" style="top: 100px">
                    您自己的文件
                  </a>
                  {/if}
                  {if isset($item.is_buyed)}
                  <a class="ribbon ribbon-skin text-md" style="top: 100px">
                    您已购买过此文件
                  </a>
                  {/if}
                  {if check_login_bool() && $smarty.session.user.user_id == $item.user_id}
                  {else}
                  {if $item.free_file == 'true'}
                  {if check_login_bool()}
                  <a href="/{$languageURL}download/{$item.id}" class="ribbon ribbon-skin text-md" style="top: 100px">
                    免费下载
                  </a>
                  {else}
                  <a class="ribbon ribbon-skin text-md" style="top: 100px" href="#" data-toggle="modal" data-target="#loginModal">
                    免费文件（登录下载）
                  </a>
                  {/if}
                  {/if}
                  {/if}
                  {if $item.free_file !== 'true'}
                  {if isset($item.is_buyed)}
                  {else}
                  {if !check_login_bool() || $smarty.session.user.user_id !== $item.user_id}
                  {if isset($item.user.license.personal)}
                  <a class="ribbon ribbon-skin text-md" style="top: 100px; padding: .0em 1.5em .4em;">
                    <span class="price-rmb"><small>{$currency.symbol}</small>{$item.price|string_format:"%.0f"}</span>
                  </a>
                  {/if}
                  {/if}
                  {/if}
                  {/if}



                </div>

                <div class="p-a-md b-b">
                  <div class="">
                    <h4 class="m-b-lg"><span class="p-b-sm b-b b-skin b-3x">作品介绍</span></h4>
                  </div>
                  {foreach from=$item.attributes item=a key=c}
                  <div class="clearfix p-b">
                    {if $a}
                    <p class="arcinfo m-b-sm text-skin-hover">
                      <span class="text-skin m-r-sm _800">{$attributeCategories[$c].name}</span>
                      {if is_array($a)}
                      {assign var=foo value=0}
                      {foreach from=$a item=ai}
                      {if $attributes[$ai].photo != ''}
                      <img class="tooltip" title="{$attributes[$ai].name|escape}" alt="{$attributes[$ai].name|escape}" src="{$data_server}/uploads/attributes/{$attributes[$ai].photo}" />
                      {else}
                      {if $attributeCategories[$c].type == 'input'}
                      <a class="text-muted m-r">{$ai}</a>
                      {else}
                      <a class="text-muted m-r">{$attributes[$ai].name}</a>
                      {/if}
                      {/if}
                      {assign var=foo value=$foo+1}
                      {/foreach}
                      {else}
                      {if $attributes[$a].photo != ''}
                      <img class="tooltip" title="{$attributes[$ai].name|escape}" alt="{$attributes[$a].name|escape}" src="{$data_server}/uploads/attributes/{$attributes[$a].photo}" />
                      {else}
                      {if $attributeCategories[$c].type == 'input'}
                      <a class="text-muted m-r">{$a}</a>
                      {else}
                      <a class="text-muted m-r">{$attributes[$a].name}</a>
                      {/if}
                      {/if}
                      {/if}
                    </p>
                    {/if}
                  </div>
                  {/foreach}
                  <div class="arcinfo">{$item.description}</div>
                </div>

                {if $otherItems}
                <div class="p-x-md p-t-md b-b">
                  <h4 class="m-b-lg"><span class="p-b-sm b-b b-skin b-3x">他的其它作品</span></h4>


                  <div class="row text-skin-hover hidden-md-down">


                    {foreach from=$otherItems item=i}
                    <div class="col-xs-6 col-sm-6 col-md-4">
                      <div class="box mb-co-b b-a">
                        <div class="item dark">
                          <div class="img-container fx-img-rotate-l fx-opt-zoom-out">
                            <img src="{$data_server}uploads/items/{$i.id}/{$i.thumbnail}" class="img-responsive" alt="{$i.name|escape}">
                            <div class="img-options">
                              <div class="img-options-content">
                                <a href="/{$languageURL}items/{$i.id}" target="_blank" class="btn skin m-r-md hidden-xs"><i class="icon-eye"></i></a>
                                <a href="/{$languageURL}items/{$i.id}" target="_blank" class="btn btn-danger text-white">
                                  <i class="icon-magnifier-add"></i>
                                </a>
                              </div>
                            </div>
                          </div>
                        </div>
                        <a href="/{$languageURL}items/{$i.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">
                          <div class="text-muted">
                            <a href="/{$languageURL}items/{$i.id}" target="_blank" class="m-r"><i class="icon-eye m-r-xs"></i> 481</a>
                            <a href="/{$languageURL}items/{$i.id}" target="_blank"><i class="icon-handbag m-r-xs"></i> 8</a>
                          </div>
                          <div class="h-2xx"><a href="/{$languageURL}items/{$i.id}" target="_blank" class="h6">{$i.name|escape}</a></div>
                          <div class="clearfix m-t-xs">
                            <a href="/{$languageURL}user/{$users[$i.user_id].username}" target="_blank" class="pull-left m-r-sm">
                              <span class="w-32 avatar">
                                {if $users[$i.user_id].avatar != ''}
                                <img src="{$data_server}uploads/users/{$i.user_id}/A_{$users[$i.user_id].avatar}" />
                                {else}
                                <span class="circle skin _100 w-32 fs-80">
                                  NP
                                </span>
                                {/if}
                                <i class="on b-white left"></i>
                              </span>
                            </a>
                            <a href="/{$languageURL}user/{$users[$i.user_id].username}" target="_blank" class="pull-left m-t-sm clear">
                              {$users[$i.user_id].nickname}
                            </a>
                            <div class="pull-right">
                              <div class="h-32"><a href="/{$languageURL}items/{$i.id}" target="_blank" class="price">￥<span class="text-lg"> {if $i.free_file == 'true'}0{else}{$i.price}{/if}</span></a></div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                    {/foreach}


                  </div>
                </div>
                {else}
                {if $weeklyItems}
                <div class="p-x-md p-t-md b-b">
                  <h4 class="m-b-lg"><span class="p-b-sm b-b b-skin b-3x">相关作品</span></h4>
                  <div class="row text-skin-hover">
                    {foreach from=$weeklyItems item=i}
                    <div class="col-xs-6 col-sm-6 col-md-4">
                      <div class="box mb-co-b b-a">
                        <div class="item dark">
                          <div class="img-container fx-img-rotate-l fx-opt-zoom-out">
                            <img src="{$data_server}uploads/items/{$i.id}/{$i.thumbnail}" class="img-responsive" alt="{$i.name|escape}">
                            <div class="img-options">
                              <div class="img-options-content">
                                <a href="/{$languageURL}items/{$i.id}" target="_blank" class="btn skin m-r-md hidden-xs"><i class="icon-eye"></i></a>
                                <a href="/{$languageURL}items/{$i.id}" target="_blank" class="btn btn-danger text-white">
                                  <i class="icon-magnifier-add"></i>
                                </a>
                              </div>
                            </div>
                          </div>
                        </div>
                        <a href="/{$languageURL}items/{$i.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">
                          <div class="text-muted">
                            <a href="/{$languageURL}items/{$i.id}" target="_blank" class="m-r"><i class="icon-eye m-r-xs"></i> 481</a>
                            <a href="/{$languageURL}items/{$i.id}" target="_blank"><i class="icon-handbag m-r-xs"></i> 8</a>
                          </div>
                          <div class="h-2xx"><a href="/{$languageURL}items/{$i.id}" target="_blank" class="h6">{$i.name|escape}</a></div>
                          <div class="clearfix m-t-xs">
                            <a href="/{$languageURL}user/{$users[$i.user_id].username}" target="_blank" class="pull-left m-r-sm">
                              <span class="w-32 avatar">
                                {if $users[$i.user_id].avatar != ''}
                                <img src="{$data_server}uploads/users/{$i.user_id}/A_{$users[$i.user_id].avatar}" />
                                {else}
                                <span class="w-32 circle skin fs-80 _100">
                                  NP
                                </span>
                                {/if}
                                <i class="on b-white left"></i>
                              </span>
                            </a>
                            <a href="/{$languageURL}user/{$users[$i.user_id].username}" target="_blank" class="pull-left m-t-sm clear">
                              {$users[$i.user_id].nickname}
                            </a>
                            <div class="pull-right">
                              <div class="h-32"><a href="/{$languageURL}items/{$i.id}" target="_blank" class="price">￥<span class="text-lg"> {if $i.free_file == 'true'}0{else}{$i.price}{/if}</span></a></div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                    {/foreach}
                  </div>
                </div>
                {/if}
                {/if}
                <div class="clearfix" id="comment">
                  <h4 class="m-b-md p-x-md p-t-md"><span class="p-b-sm b-b b-skin b-3x">咨询评论</span></h4>
                  {if $comments}
                  <div class="pinglun">
                    {foreach from=$comments item=c}
                    <div class="sl-item p-x-md">
                      <div class="b-b p-t-md">
                        <div class="sl-left">
                          <a href="/{$languageURL}user/{$users[$c.user_id].username}" class="pull-left w-40 m-r-sm hover" title="{$users[$c.user_id].username}" target="_blank">
                            {if $users[$c.user_id].avatar != ''}
                            <img alt="{$users[$c.user_id].username}" class="w-full img-circle hover-rotate360" src="{$data_server}uploads/users/{$c.user_id}/A_{$users[$c.user_id].avatar}" />
                            {else}
                      <span class="w-40 circle skin _100 hover-rotate360">
                        NP
                      </span>
                            {/if}
                          </a>
                        </div>
                        <div class="sl-content">
                          <div class="sl-date text-muted">{$c.datetime|date_format:"%Y-%m-%d"}</div>
                          <div class="sl-author">
                            <a href="/{$languageURL}user/{$users[$c.user_id].username}" class="comment__username h6" target="_blank">
                              <span class=" text-skin">{$users[$c.user_id].nickname}</span>
                              {if $item.user_id == $c.user_id}
                              <span class="label deep-orange">作者</span>
                              {elseif isset($buyFromUsers[$c.user_id])}
                              <span class="label dark">买家</span>
                              {/if}
                            </a>
                          </div>
                          <div>
                            <p class="arcinfo m-t m-b">
                              {$c.comment|nl2br}
                            </p>
                          </div>
                          <div class="sl-footer m-b-md">
                            {if check_login_bool()}
                            <a href="" class="text-muted" data-toggle="collapse" data-target="#reply-{$c.id}">
                              <i class="icon-action-undo"></i> 回复
                            </a>
                            {else}
                            <a class="text-muted" data-toggle="modal" data-target="#loginModal" title="登录后才可以回复他">
                              <i class="icon-action-undo"></i> 回复
                            </a>
                            {/if}
                          </div>
                          <div id="replyhere_{$c.id}"></div>
                          {if isset($c.reply)}
                          {foreach from=$c.reply item=cc}
                          <div class="sl-item">
                            <div class="sl-left">
                              <a href="/{$languageURL}user/{$users[$cc.user_id].username}" class="pull-right w-32 m-l-sm m-t-xs hover" target="_blank">
                                {if $users[$cc.user_id].avatar != ''}
                                <img alt="{$users[$cc.user_id].username}" class="w-32 img-circle hover-rotate360" src="{$data_server}uploads/users/{$cc.user_id}/A_{$users[$cc.user_id].avatar}" />
                                {else}
                      <span class="w-32 circle skin _100 hover-rotate360">
                        NP
                      </span>
                                {/if}
                              </a>
                            </div>
                            <div class="sl-content">
                              <div class="sl-date text-muted">{$cc.datetime|date_format:"%Y-%m-%d"}</div>
                              <p><a href="/{$languageURL}user/{$users[$cc.user_id].username}" class="comment__username" target="_blank">{$users[$cc.user_id].nickname}</a>
                                {if $item.user_id == $cc.user_id}
                                <span class="label deep-orange">作者</span>
                                {elseif isset($buyFromUsers[$cc.user_id])}
                                <span class="label dark">买家</span>
                                {/if}
                                <span class="text-muted"> {$cc.comment|nl2br}</span>
                              </p>
                            </div>
                          </div>
                          {/foreach}
                          {/if}
                          {literal}
                          <script language="javascript">
                            seajs.use(["jq"], function($){
                              $("{/literal}#replyhere_{$c.id}{literal}").load("{/literal}/{$languageURL}items/reply/{$c.id}{literal}");
                            });
                          </script>
                          {/literal}
                        </div>
                      </div>
                    </div>
                    {/foreach}
                  </div>
                  {else}
                  <div class="clearfix text-center h5 p-a-lg text-muted">暂时没有评论</div>
                  {/if}
                </div>
                <div class="m-a-0 b-t collapse in" aria-expanded="true">
                  <form action="" method="post">
                    <textarea id="summernote" name="comment" rows="4" placeholder="说点什么吧..."></textarea>
                    <div class="box-footer b-t clearfix">
                      <label for="reply_notification" class="md-check m-t-sm">
                        <input type="checkbox" checked="" class="has-value" id="reply_notification" name="reply_notification" value="1">
                        <i class="skin"></i>
                        当我收到一个回复时提醒我
                      </label>
                      {if check_login_bool()}
                      <button type="submit" name="add" class="btn skin b-skin pull-right">提交评论</button>
                      {else}
                      <a class="btn skin b-skin pull-right" data-toggle="modal" data-target="#loginModal" title="登录后才可以发表评论">提交评论</a>
                      {/if}
                    </div>
                  </form>

                </div>



              </div>
            </div>
            <div class="col-sm w-xl w-auto-xs b-r right-bar">
              <div class="box box-bar text-center m-b-0">
                <div class="p-a-md">
                  <p>
                    <a href="/{$languageURL}user/{$item.user.username}/" class="hover">
                      {if $item.user.avatar != ''}
                      <img alt="{$item.user.username}" class="img-circle w-96 hover-rotate360" src="{$data_server}uploads/users/{$item.user.user_id}/A_{$item.user.avatar}" />
                      {else}
                    <span class="w-96 circle skin avatar text-md">
                      <span class="price opacity" style="vertical-align: 0%;">NOPIC</span>
                    </span>
                      {/if}
                    </a>
                  </p>
                  <a href="/{$languageURL}user/{$item.user.username}/" class="text-md block">@{$item.user.nickname}</a>
                  <p class="m-t-xs">
                    {foreach from=$user_badges item=b name=foo}
                    <img class="bphoto" src="{$data_server}{$b.photo}" title="" data-toggle="tooltip" data-placement="bottom" data-original-title="{$b.name|escape}" height="18" width="18">
                    {if $smarty.foreach.foo.last}{/if}
                    {/foreach}
                  </p>
                  <p><small class="h-1x text-grey" style="font-size: 90%">{if $user.profile_title != ''}{$user.profile_title}{else}作者太懒了，没填签名呢{/if}</small></p>
                  <div>
                    {if check_login_bool() && $smarty.session.user.user_id != $user.user_id}
                    <a href="/{$languageURL}users/{$user.username}/?follow" id="follow-user">
                      <button id="follow" class="btn btn-social rounded btn-sm {if $user.is_follow}skin{else}white b-skin{/if}" type="submit">{if $user.is_follow}<i class="icon-minus3 m-r-xs"></i>取消关注{else}<i class="icon-plus2 m-r-xs"></i>关注Ta{/if}</button>
                    </a>

                    <script type="text/javascript">
                      {literal}
                      seajs.use(["jq", "modules/follow"], function($, follow){
                        follow.followBtnInit($("#follow-user"), "/{/literal}{$languageURL}users/{$user.username}/?follow{literal}");
                      });
                      {/literal}
                    </script>
                    {elseif check_login_bool() && $smarty.session.user.user_id == $user.user_id}
                    <a href="/{$languageURL}edit/" class="btn btn-social rounded btn-sm white">
                      编辑资料
                    </a>
                    {else}
                    <button class="btn btn-social rounded btn-sm white" type="submit" data-toggle="modal" data-target="#loginModal" data-toggle="tooltip" data-placement="bottom" data-original-title="您需要登录后才可以添加关注">
                      <i class="icon-plus2 m-r-xs fs-16"></i>关注Ta
                    </button>
                    {/if}
                  </div>
                </div>
                <div class="row no-gutter text-skin-hover b-t b-b">
                  <div class="col-xs-6 b-r">
                    <a class="p-x p-y-sm block text-center" href="#comment" ui-scroll-to="comment">
                      <i class="icon-bubbles md-24 text-muted m-v-sm inline"></i>
                      <span class="block">评论<small>({$item.comments})</small></span>
                    </a>
                  </div>
                  <div class="col-xs-6">
                    {if check_login_bool()}
                    <a class="p-x p-y-sm block text-center" data-toggle="modal" data-target="#cbook">
                      <i class="icon-tag md-24 text-muted m-v-sm inline"></i>
                      <span class="block">收藏</span>
                    </a>
                    {else}
                    <a class="p-x p-y-sm block text-center" data-toggle="modal" data-target="#loginModal">
                      <i class="icon-tag md-24 text-muted m-v-sm inline"></i>
                      <span class="block">收藏</span>
                    </a>
                    {/if}
                  </div>
                </div>
                <div class="clearfix p-a b-b">
                  {if check_login_bool() && $smarty.session.user.user_id == $item.user_id}
                  <a href="###" class="btn btn-block skin text-white btn-lg">您自己的文件</a>
                  {/if}
                  {if isset($item.is_buyed)}
                  <a href="/{$languageURL}download/{$item.id}" class="btn btn-lg btn-block skin text-white">
                    下载 ( <small>已购</small> )
                  </a>
                  {/if}
                  {if check_login_bool() && $smarty.session.user.user_id == $item.user_id}
                  {else}
                  {if $item.free_file == 'true'}
                  {if check_login_bool()}
                  <a href="/{$languageURL}download/{$item.id}" class="btn btn-block skin text-white btn-lg">
                    免费下载
                  </a>
                  {else}
                  <a href="#"  data-toggle="modal" data-target="#loginModal" class="btn btn-block skin text-white btn-lg">
                    免费下载
                  </a>
                  {/if}
                  {/if}
                  {/if}


                  {if $item.free_file !== 'true'}
                  {if isset($item.is_buyed)}
                  {else}
                  {if !check_login_bool() || $smarty.session.user.user_id !== $item.user_id}
                  <form action="/{$languageURL}items/{$item.id}" id="purchase-form" method="post" name="purchase-form">
                    <meta itemprop="price" content="$3">

                    <div class="btn-group block">

                      {if isset($item.user.license.personal)}
                      <div class="licenitem" id="licenitem-price">
                        <button class="btn btn-block skin text-white p-y-sm" type="submit" data-toggle="modal" data-target="#loginModal">购买 <span class="price">{$currency.symbol}<span class="text-lg"> {$item.price|string_format:"%.0f"}</span></span></button>
                      </div>
                      {/if}

                      {if isset($item.user.license.extended)}
                      <div class="licenitem none" id="licenitem-extend">
                        <button class="btn btn-block skin text-white p-y-sm" id="purchase_button2" onclick="" type="submit" data-toggle="modal" data-target="#loginModal">购买 <span class="price">{$currency.symbol}<span class="text-lg"> {$item.extended_price|string_format:"%.0f"}</span></span></button>
                      </div>
                      {/if}

                      <select class="btn btn-danger b-2x btn-lg dropdown-toggle none" name="" id="lchoose">
                        {if isset($item.user.license.personal)}
                        <option value="1">共享许可</option>
                        {/if}
                        {if isset($item.user.license.extended)}
                        <option value="0">专有许可</option>
                        {/if}
                      </select>
                    </div>
                    {literal}
                    <script type="text/javascript">
                      seajs.use(["modules/licence"], function(lens){
                        lens.init({
                          "form": "purchase-form",
                          "price": '{/literal}{$item.price|string_format:"%.0f"}{literal}',
                          "prepaid_price": '{/literal}{$item.prepaid_price|string_format:"%.0f"}{literal}',
                          "extended_price": '{/literal}{if $item.extended_price < 0}0.00{else}{$item.extended_price|string_format:"%.2f"}{/if}{literal}',
                          "discount": '{/literal}{$meta.prepaid_price_discount}{literal}'
                        });
                      });
                    </script>
                    {/literal}

                  </form>
                  {/if}
                  {/if}
                  {/if}


                  <div class="row row-sm m-t">
                    {if $item.demo_url}
                    <div class="col-xs-6">
                      <a href="/{$languageURL}items/preview/{$item.id}" target='_blank' title="在线预览" class="btn btn-outline b-blue-grey-600 text-blue-grey-600 btn-block p-y-sm">
                        在线演示
                      </a>
                    </div>
                    <div class="col-xs-6 arc-btn-group">
                      <a href="/{$languageURL}items/screenshots/{$item.id}" title="截图预览" class="linkbtn screenbtn btn btn-outline b-blue-grey-300 text-blue-grey-300 btn-block p-y-sm">
                        截图演示
                      </a>
                    </div>
                    {else}
                    <div class="col-xs-12 arc-btn-group">
                      <a href="/{$languageURL}items/screenshots/{$item.id}" title="截图预览" class="linkbtn screenbtn btn btn-outline b-blue-grey-300 text-blue-grey-300 btn-block p-y-sm">
                        截图演示
                      </a>
                    </div>
                    {/if}
                  </div>
                </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}
<script type="text/javascript">
  seajs.use(["pageui", "modules/screenshot"], function(ui, scre){
    ui.imgMagnifier("a.landscape-image-magnifier");
    scre.init("#previewdom", ".screenbtn", {
      preurl: "{/literal}{$item.theme_preview}{literal}",
      prename: "{/literal}{$item.name|escape}{literal}",
      preimgs: "{/literal}{foreach from=$previewFiles item=file name=foo}{$file}{if !$smarty.foreach.foo.last}|{/if}{/foreach}{literal}",
      prelink: "{/literal}/{$languageURL}items/screenshots/{$item.id}{literal}"
    });
  });
</script>

<style>
  .opacity{
    opacity: 1;
  }
  .screenbtn img{
    width: 100%;
  }
  .pinglun .sl-item:last-child .b-b{border-bottom-width: 0;}
  .sl-content {
    padding-bottom:5px;
  }
  .sl-left+.sl-content {
    margin-left: 50px;
  }
  .sl-content .label {
    padding: .35em .75em .25em;
  }
  .sl-left{
    margin-left: 0;
  }
  .sl-item .sl-item .sl-left{
    margin-left: -10px;
  }
  .sl-item .sl-item .sl-left+.sl-content {
    margin-left: 40px;
  }
  .sl-item .b-b{
    border-bottom-style: dotted;
  }
  .sl-content p.h6{
    line-height: 1.6;
  }
  .sl-item:hover{
    background-color: rgba(0,0,0,0.008)
  }
  .sl-item:hover .sl-item{
    background-color: transparent;
  }
</style>
{/literal}

<!-- small modal -->


<div class="modal animated zoomIn" id="loginModal">
  <div class="row-col h-v">
    <div class="row-cell v-m">
      <div class="modal-dialog">
        {include file="$template_path/items/purchase_panel.html"}
      </div>
    </div>
  </div>
</div>
<!-- / .modal -->


{if check_login_bool()}

<!-- Modal -->
<div class="modal fade" id="cbook" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-sm">

    <form id="bookmark_form" method="post" action="#bookmark" enctype="multipart/form-data">
      <div class="modal-content">



        <div class="modal-header">
          <div class="clearfix form-group">
            <select class="form-control" id="collection_id" name="collection_id">
              {if $bookCollections}
              {foreach from=$bookCollections item=c}
              <option value="{$c.id}">{$c.name}</option>
              {/foreach}
              {else}
              <option value="none">请先新建书签集</option>
              {/if}
            </select>
          </div>
          <h4 class="modal-title" id="collection_create_link"><a list-show="0" href="#">新建书签集</a></h4>
        </div>
        <div class="modal-body" style="display:none;" id="collection_create_form">



          <div class="form-group">
            <label for="name">书签名称</label>
            <input id="name" class="form-control" name="name" type="text" value="" />
          </div>

          <div class="form-group">
            <label for="description">书签描述</label>
            <textarea id="description" class="form-control" name="description" rows="6"></textarea>
          </div>


          <div class="form-group">
            <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>

          <div class="checkbox i-checks">
            <label for="publically_visible">
              <input id="publically_visible" name="publically_visible" type="checkbox" checked="" value="1"><i></i> 分类是否公开?
            </label>
          </div>
        </div>
        <div class="modal-footer" href="javascript: void(0);">
          <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
          <input type="hidden" name="add_collection" value="yes" />
          <button type="submit" class="btn skin b-skin">添加至书签集！</button>
        </div>
      </div>
    </form>
    <script>
      {literal}
      seajs.use(["jq", "modules/collection"], function($, coll){
        coll.btninit("#collection_create_link a", "#collection_create_form");
      });
      {/literal}
    </script>
  </div>
</div>

{/if}
</body>
</html>