{include file="$template_path/html/header.html"}
<link href="{$template_data}scripts/plug/mobanboxmedia/jquery.mobanboxmedia.css" rel="stylesheet" />
</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-xs-t-sm">
            <div class="row">
              <div class="col-md-10 col-md-offset-1">
                <div class="post-item panel-shadow">
                  <div class="post-img pos-rlt">
                    <div class="detailimg clr" id="previewdom">
                      <div id="previewobj"></div>
                    </div>
                    <div class="b-cover">
                      <div class="share">
                        <a href="#" class="btn btn-link hover m-l-none">
                          <i class="fa fa-weibo hover-rotate360"></i>
                        </a>
                        <a href="#" class="btn btn-link hover">
                          <i class="fa fa-weixin-weibo hover-rotate360"></i>
                        </a>
                        <a href="#" class="btn btn-link hover">
                          <i class="fa fa-qq hover-rotate360"></i>
                        </a>
                        <a href="#" class="btn btn-link hover">
                          <i class="fa fa-weixin hover-rotate360"></i>
                        </a>
                      </div>
                    </div>

                    {if check_login_bool() && $smarty.session.user.user_id == $item.user_id}
                    <div class="cate-bg cates-4" style="left: -9px;">
                      <span class="cate-text">您自己的文件</span>
                    </div>
                    {/if}


                    {if isset($item.is_buyed)}
                    <div class="cate-bg cates-6" style="left: -9px;">
                      <span class="cate-text">您已购买过此文件</span>
                    </div>
                    {/if}

                    {if check_login_bool() && $smarty.session.user.user_id == $item.user_id}
                    {else}
                    {if $item.free_file == 'true'}
                    {if check_login_bool()}
                    <div class="cate-bg cates-2" style="left: -9px;">
                      <span class="cate-text">免费文件</span>
                    </div>
                    {else}
                    <div class="cate-bg cates-2" style="left: -9px;">
                      <span class="cate-text">免费文件（登录下载）</span>
                    </div>
                    {/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)}
                    <div class="cate-bg cates-1" style="left: -9px;">
                      <span class="cate-text fs-20 fm-sf"><small>{$currency.symbol}</small> <span class="p-r-xs">{$item.price|string_format:"%.0f"}</span> </span>
                    </div>
                    {/if}

                    {/if}
                    {/if}
                    {/if}



                  </div>
                  <div class="post-body wrapper-lg">
                    <div class="post-user clearfix">
                      <div class="pull-right pull-none-xs m-xs-b-md">
                        {if check_login_bool() && $smarty.session.user.user_id == $item.user_id}
                        <a href="###" class="btn btn-info btn-xs-xs">您自己的文件</a>
                        {/if}


                        {if isset($item.is_buyed)}
                        <a href="/{$languageURL}download/{$item.id}" class="btn btn-info btn-xs-xs">点击下载 ( <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-info btn-xs-xs">免费下载</a>

                          {else}
                        <a href="/{$languageURL}sign_in/" class="btn btn-info btn-xs-xs">免费下载 ( <small>需登录</small> )</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" class="inline">
                            <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-info btn-xs-xs" type="submit" data-toggle="modal" data-target="#myModal"><i class="icon-handbag m-r-sm"></i>马上购买 ( <small>{$currency.symbol}</small> {$item.price|string_format:"%.0f"} )</button>
                              </div>
                              {/if}

                              {if isset($item.user.license.extended)}
                              <div class="licenitem none" id="licenitem-extend">
                                <button class="btn btn-info btn-xs-xs" id="purchase_button2" onclick="" type="submit" data-toggle="modal" data-target="#myModal"><i class="icon-handbag m-r-sm"></i>马上购买 ( <small>{$currency.symbol}</small> {$item.extended_price|string_format:"%.0f"} )</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}


                        {if $item.demo_url}
                        <a class="btn btn-ghost-warning btn-xs-xs m-l-sm" href="/{$languageURL}items/preview/{$item.id}" target='_blank' title="在线预览">
                          在线预览
                        </a>
                        {/if}
                        <a class="linkbtn screenbtn btn btn-ghost-success btn-xs-xs m-l-xs" href="/{$languageURL}items/screenshots/{$item.id}" target='_blank' title="截图预览" screenshot-img="{foreach from=$previewFiles item=file name=foo}{$file}{if !$smarty.foreach.foo.last}|{/if}{/foreach}" screenshot-tit="{$item.name|escape}">
                          截图预览
                        </a>
                      </div>
                      <a href="/{$languageURL}user/{$item.user.username}/" class="thumb pull-left m-r" target="_blank">
                        {if $item.user.avatar != ''}
                        <img alt="{$item.user.username}" class="img-circle m-t-xs" src="{$data_server}uploads/users/{$item.user.user_id}/A_{$item.user.avatar}" />
                        {else}
                        <img alt="{$item.user.username}" class="img-circle m-t-xs" src="{$template_data}img/default-user.jpg" />
                        {/if}
                      </a>
            <span class="clear">
              <a href="/{$languageURL}user/{$item.user.username}/" class="text-llg" target="_blank"> {$item.user.nickname}</a>
              <p class="block text-muted">
                {foreach from=$user_badges item=b name=foo}
                <img class="bbphoto" src="{$data_server}{$b.photo}" alt="权威精英作者" title="" data-toggle="tooltip" data-placement="bottom" data-original-title="{$b.name|escape}">
                {if $smarty.foreach.foo.last}{/if}
                {/foreach}
              </p>
            </span>


                    </div>
                    <div class="ss-underlines font-normal"><h2 class="text-black h2-xs">{$item.name}</h2></div>
                    <p>
                      <small class="inline b-r p-r">
                        <i class="i i-clock m-r-xs"></i>{$item.datetime|date_format:"%Y-%m-%d"}
                      </small>
                      <small class="inline b-r p-r p-l" data-toggle="tooltip" data-placement="bottom" data-original-title="评论">
                        <i class="i i-chat3 m-r-xs"></i><span class="fm-sf fs-18">{$item.comments}</span> 评论
                      </small>
                      <small class="inline p-r p-l" data-toggle="tooltip" data-placement="bottom" data-original-title="已售出">
                        <i class="i i-data2 m-r-xs"></i><span class="fm-sf fs-18">{$item.sales}</span>
                      </small>
                    </p>
                    <div class="post-arc m-t-lg">
                      <!--{if $item.weekly_to}
                      <blockquote class="inline">
                        <small class="text-danger">这是一件推荐作品.</small>
                      </blockquote>
                      {/if}

                      {if $item.user.elite_author  == 'true'}
                      <blockquote class="inline">
                        <small class="">该作品由精英作者发布.</small>
                      </blockquote>
                      {/if}

                      {if $item.user.power_elite_author  == 'true'}
                      <blockquote class="inline">
                        <small class="">该作品由强力精英作者发布.</small>
                      </blockquote>
                      {/if}-->
                      {$item.description}
                    </div>

                    <div class="post-bookmarks m-t-lg text-center">
                      <a href="#" class="btn btn-ghost-dark btn-rounded">
                        <i class="fa fa-star"></i>加入书签
                      </a>
                    </div>



                    {if check_login_bool()}
                    <div class="sideblock follow">
                      <form id="bookmark_form"  method="post" action="" enctype="multipart/form-data">
                        <select id="collection_id" name="collection_id" style="width: 100%">
                          {if $bookCollections}
                          {foreach from=$bookCollections item=c}
                          <option value="{$c.id}">{$c.name}</option>
                          {/foreach}
                          {/if}
                        </select>
                        <p id="collection_create_link">{$lang.or} <a list-show="0" href="#">新建书签集</a></p>
                        <div style="display:none;" id="collection_create_form" class="vertical-form">
                          <hr>
                          <div class="input-group">
                            <label for="name">分类名称：</label>
                            <div class="inputs">
                              <input id="name" class="ipttheme" name="name" type="text" value="" />
                            </div>
                          </div>
                          <div class="input-group">
                            <label for="description">分类描述：</label>
                            <div class="inputs">
                              <textarea id="description" name="description" rows="6" style="width: 300px"></textarea>
                            </div>
                          </div>
                          <div class="input-group">
                            <label for="file_upload">分类图片：</label>
                            <div class="inputs">
                              <input id="file_upload" name="file_upload" size="12" style="width: 170px;" type="file" />
                              <small>(260 x 140px)</small>
                            </div>
                          </div>
                          <div class="input-group">
                            <div class="inputs">
                              <label for="publically_visible">
                                <input id="publically_visible" name="publically_visible" style="border:1px" type="checkbox" value="1" /> 分类是否公开?
                              </label>
                            </div>
                          </div>
                        </div>
                        <div class="form-submit" href="javascript: void(0);" >
                          <input type="hidden" name="add_collection" value="yes" />
                          <button type="submit" class="btntheme bookmark btnsize">添加至书签集！</button>
                        </div>
                      </form>
                      <script>
                        {literal}
                        seajs.use(["jq", "modules/collection"], function($, coll){
                          coll.btninit("#collection_create_link a", "#collection_create_form");
                        });
                        {/literal}
                      </script>
                    </div>
                    {/if}



                  </div>




                </div>

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

        </section>


        <section class="bg-white-only-xs m-t-md clearfix">
          <div class="container">
            <div class="row">
              <div class="col-md-10 col-md-offset-1">
                <div class="post-item no-shadow-xs m-xs-b-none m-xs-t-sm">
                  <div class="post-body wrapper-lg p-xs-l-none p-xs-r-none">
                    <div class="ss-underlines">
                      <h2 class="text-black m-t-none h2-xs">咨询/买家说</h2>

                    </div>


                    <div class="post-about row m-t-sm m-xs-t-none">
                      <section class="panel no-shadow m-b-none">
                        <div class="panel-body">
                          <!-- 多说评论框 start -->
                          <div class="ds-thread" data-thread-key="{$item.id}" data-title="{$item.name}" data-url="/{$languageURL}items/{$item.id}"></div>
                          <!-- 多说评论框 end -->
                          <!-- 多说公共JS代码 start (一个网页只需插入一次) -->
                          {literal}
                          <script type="text/javascript">
                            var duoshuoQuery = {short_name:"mobanbox123"};
                            (function() {
                              var ds = document.createElement('script');
                              ds.type = 'text/javascript';
                              ds.async = true;
                              ds.src = (document.location.protocol == 'https:' ? 'https:': 'http:') + '//static.duoshuo.com/embed.js';
                              ds.charset = 'UTF-8'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ds);
                            })();
                          </script>
                          {/literal}
                          <!-- 多说公共JS代码 end -->
                        </div>
                      </section>
                      <link rel="stylesheet" href="/mbthemes/css/duoshuo.css" type="text/css">


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

        {if $otherItems}
        <section class="bg-white-only clearfix m-t-md">
          <div class="container">
            <div class="row">
              <div class="col-md-12">
                <div class="post-body p-t-lg p-b-lg p-xs-b-sm">
                  <div class="ss-underlines">
                    <a href="/{$languageURL}user/{$item.user.username}" class="btn btn-ghost-info btn-xs-xs pull-right">更多</a>
                    <h2 class="text-black h2-xs m-t-none">{$item.user.nickname}的其它作品</h2>
                  </div>


                  <div class="post-about row m-t-sm">


                    {foreach from=$otherItems item=i}
                    <div class="col-xs-6 col-sm-6 col-md-3 ">
                      <section class="panel mb-col no-radius no-shadow">
                        <div class="panel-body no-padder">
                          <div class="img-container fx-img-rotate-l">
                            <img class="img-responsive" src="{$data_server}uploads/items/{$i.id}/{$i.thumbnail}" alt="{$i.name|escape}">
                            <div class="img-options">
                              <div class="img-options-content">
                                <a href="/{$languageURL}items/{$i.id}" class="btn btn-success btn-lg m-r-md hidden-xs" data-toggle="tooltip" data-placement="bottom" data-original-title="查看演示">
                                  <i class="i i-layer2"></i>
                                </a>
                                <a href="/{$languageURL}items/{$i.id}" class="btn btn-danger btn-lg" data-toggle="tooltip" data-placement="bottom" data-original-title="了解详情">
                                  <i class="i i-eye"></i>
                                </a>
                              </div>
                            </div>
                          </div>
                        </div>
                        <div class="panel-footer pos-rlt bg-white-only panel-shadow no-radius">
                          <div class="ss-underline">
                            <a href="#">
                              {foreach from=$i.categories item=e}
                              {foreach from=$e item=c name=foo}
                              {if $smarty.foreach.foo.last}{$categories[$c].name}{/if}
                              {/foreach}
                              {/foreach}
                            </a>
                          </div>
                          <div class="clearfix">
                            <div class="datetime m-r-sm pull-left hidden-xs">
                              <span class="date">{if $i.free_file == 'true'}0{else}{$i.price}{/if}</span>
                              <span class="month">￥</span>
                            </div>
                            <h4 class="m-t-none m-b-none-xs"><a href="/{$languageURL}items/{$i.id}" class="height-h4">{$i.name|escape}</a></h4>
                          </div>
                          <a href="/{$languageURL}user/{$users[$i.user_id].username}" class="panel-thumb hidden-xs" data-toggle="tooltip" data-placement="bottom" data-original-title="{$users[$i.user_id].nickname}">
                            {if $users[$i.user_id].avatar != ''}
                            <img alt="{$users[$i.user_id].nickname}" class="img-circle" src="{$data_server}uploads/users/{$i.user_id}/A_{$users[$i.user_id].avatar}" />
                            {else}
                            <img alt="{$users[$i.user_id].nickname}" class="img-circle" src="{$data_server}home/default/img/default-user.jpg" />
                            {/if}
                          </a>

                        </div>
                      </section>
                    </div>
                    {/foreach}

                  </div>
                </div>
              </div>
            </div>
          </div>
        </section>
        {else}

        {if $weeklyItems}
        <section class="bg-white-only clearfix m-t-md">
          <div class="container">
            <div class="row">
              <div class="col-md-12">
                <div class="post-body p-t-lg p-b-lg p-xs-b-sm">
                  <div class="ss-underlines">
                    <a href="/{$languageURL}feature/" class="btn btn-ghost-info btn-xs-xs pull-right">更多</a>
                    <h2 class="text-black h2-xs m-t-none">精心为您推荐</h2>
                  </div>


                  <div class="post-about row m-t-sm">


                    {foreach from=$weeklyItems item=i}
                    <div class="col-xs-6 col-sm-6 col-md-3 ">
                      <section class="panel mb-col no-radius no-shadow">
                        <div class="panel-body no-padder">
                          <div class="img-container fx-img-rotate-l">
                            <img class="img-responsive" src="{$data_server}uploads/items/{$i.id}/{$i.thumbnail}" alt="{$i.name|escape}">
                            <div class="img-options">
                              <div class="img-options-content">
                                <a href="/{$languageURL}items/{$i.id}" class="btn btn-success btn-lg m-r-md hidden-xs" data-toggle="tooltip" data-placement="bottom" data-original-title="查看演示">
                                  <i class="i i-layer2"></i>
                                </a>
                                <a href="/{$languageURL}items/{$i.id}" class="btn btn-danger btn-lg" data-toggle="tooltip" data-placement="bottom" data-original-title="了解详情">
                                  <i class="i i-eye"></i>
                                </a>
                              </div>
                            </div>
                          </div>
                        </div>
                        <div class="panel-footer pos-rlt bg-white-only panel-shadow no-radius">
                          <div class="ss-underline">
                            <a href="#">
                              {foreach from=$i.categories item=e}
                              {foreach from=$e item=c name=foo}
                              {if $smarty.foreach.foo.last}{$categories[$c].name}{/if}
                              {/foreach}
                              {/foreach}
                            </a>
                          </div>
                          <div class="clearfix">
                            <div class="datetime m-r-sm pull-left hidden-xs">
                              <span class="date">{if $i.free_file == 'true'}0{else}{$i.price}{/if}</span>
                              <span class="month">￥</span>
                            </div>
                            <h4 class="m-t-none m-b-none-xs"><a href="/{$languageURL}items/{$i.id}" class="height-h4">{$i.name|escape}</a></h4>
                          </div>
                          <a href="/{$languageURL}user/{$users[$i.user_id].username}" class="panel-thumb hidden-xs" data-toggle="tooltip" data-placement="bottom" data-original-title="{$users[$i.user_id].nickname}">
                            {if $users[$i.user_id].avatar != ''}
                            <img alt="{$users[$i.user_id].nickname}" class="img-circle" src="{$data_server}uploads/users/{$i.user_id}/A_{$users[$i.user_id].avatar}" />
                            {else}
                            <img alt="{$users[$i.user_id].nickname}" class="img-circle" src="{$data_server}home/default/img/default-user.jpg" />
                            {/if}
                          </a>

                        </div>
                      </section>
                    </div>
                    {/foreach}

                  </div>
                </div>
              </div>
            </div>
          </div>
        </section>
        {/if}


        {/if}

        {include file="$template_path/html/footer.html"}

      </section>
    </section>
  </section>
</section>
{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}"
    });
    scre.init(".post-user", ".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>
{/literal}
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    {include file="$template_path/items/purchase_panel.html"}
  </div>
</div>
</body>
</html>