{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 p-t-md">
        <div class="container">
          {$errorMessage}
          <h3 class="m-t-none m-b-none phone-h2 m-t-xs">
            <i class="icon-daimaj text-skin"></i> 我已购买的作品
            <b class="label text-sm rounded danger up">{$smarty.session.user.buy}</b>
          </h3>
        </div>
      </div>


      <div class="clearfix p-t white">
        <div class="container">
          {if $items}
          <div class="row">
            {foreach from=$items item=i name=foo}

            <div class="col-xs-6 col-sm-6 col-md-4">
              <section class="box mb-col b-a pos-rlt image">
                <div class="browser clearfix">
                  <span class="col-xs-3 col-sm-3">
                    <i class="yuan"></i>
                  </span>
                  <span class="col-xs-6 col-sm-6">
                    <em>
                    </em>
                  </span>
                  <span class="col-xs-3 col-sm-3 three">
                    <i class="icon-cross2"></i>
                    <i class="icon-check_box_outline_blank"></i>
                    <i class="icon-minus3"></i>
                  </span>
                </div>
                <div class="box-body pic">
                  <div class="img-container fx-img-rotate-l fx-opt-zoom-out">
                    <img src="{$data_server}uploads/items/{$i.id}/{$i.thumbnail}" alt="{$i.name|escape}" class="img-responsive">
                    <div class="img-options">
                      <div class="img-options-content text-lg">
                        {if isset($ratedItems[$i.id])}
                        {section name=foo start=1 loop=6 step=1}
                        {if $ratedItems[$i.id].rate >= $smarty.section.foo.index}
                        <i class="icon-star-full text-warn"></i>
                        {else}
                        <i class="icon-star-empty text-white"></i>
                        {/if}
                        {/section}
                        {else}
                        <div id="stars_div_{$i.id}" class="stars" data-star-set-id="{$i.id}_star" data-rating="0">
                          {section name=foo start=1 loop=6 step=1}
                          <a data-toggle="ajaxStar" href="/{$languageURL}users/downloads/{$i.id}?rating={$smarty.section.foo.index}">
                            <i class="icon-star-empty text-white" alt="{$smarty.section.foo.index}" id="{$i.id}_star_{$smarty.section.foo.index}" ></i>
                          </a>
                          {/section}
                        </div>
                        {/if}
                      </div>
                      {literal}
                      <script>
                        seajs.use(["modules/rating"], function(rating){
                          rating.init("stars_div_{/literal}{$i.id}{literal}");
                        });
                      </script>
                      {/literal}
                    </div>
                    <span class="sale">
                      <a href="/{$languageURL}users/downloads/{$i.id}/?certificate">
                        许可文件下载
                      </a>
                    </span>
                  </div>
                </div>
                <form id="download{$i.id}" action="/{$languageURL}download/{$i.id}" method="post">
                  <input type="hidden" name="download" id="download" value="regular" />
                  <a class="ribbon ribbon-skin" href="javascript:;" onclick="document.getElementById('download{$i.id}').submit();"><span class="cate-text">点我下载</span></a>
                </form>
                <div class="mb-footer">
                  <div class="text-muted m-b-xs">
                    <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> {$i.sales|escape}</a>
                  </div>
                  <div class="h-2xx"><a href="/{$languageURL}items/{$i.id}" target="_blank" class="h5">{$i.name|escape}</a></div>
                  <div class="clearfix m-t-xs">
                    <a href="/{$languageURL}user/{$userss[$i.user_id].username}" target="_blank" title="{$users[$i.user_id].nickname}" class="pull-left m-r-sm">
                      <span class="w-32 avatar">
                        {if $userss[$i.user_id].avatar != ''}
                        <img src="{$data_server}uploads/users/{$i.user_id}/A_{$userss[$i.user_id].avatar}" />
                        {else}
                        <span class="w-32 circle skin fs-80 _100">
                          NP
                        </span>
                        {/if}
                      </span>
                    </a>
                    <a href="/{$languageURL}user/{$userss[$i.user_id].username}" target="_blank" class="pull-left m-t-sm clear">
                      {$userss[$i.user_id].nickname}
                    </a>
                    <div class="pull-right">
                      <div class="h-32"><span class="price-rmb text-skin"><small>￥</small>{$i.price|escape}</span></div>
                    </div>
                  </div>
                </div>
              </section>
            </div>
            {/foreach}

          </div>

          {else}
          <div class="row">
            <div class="col-xs-12 text-center">
              <div class="h-v-5 row-col">
                <div class="row-cell v-m text-center animated fadeIn">
                  <h3 class="m-t text-muted"><i class="icon-sad h1 m-r" style="vertical-align: -7px"></i>还没有购买过任何作品</h3>
                </div>
              </div>
            </div>
          </div>
          {/if}
        </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>
<!-- 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>