{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="m-b-md m-xs-b h3">
              <span class="font-thin h3-xs text-black">
                {$catenames}
              </span>
              <span class="badge bg-danger lt v-middle">{$allRows}</span>
            </div>
            <div class="row m-b-lg m-xs-b">
              <div class="col-sm-9">
                <span class="m-l-n-sm">{$categoriesList2}</span>
              </div>
              <div class="col-sm-3 text-right text-left-xs visible-lg">
                <form action="" id="sortbyform" method="get" class="hidden-xs 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='sales_count';document.getElementById('sortbyform').submit();"{if $smarty.get.sort_by == 'sales_count'} 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-data2"></i>
                    </a>
                    <a href="javascript: void(0);" onclick="document.getElementById('sort_by').value='cost';document.getElementById('sortbyform').submit();"{if $smarty.get.sort_by == 'cost'} 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 $items}
            <div class="row">
              {foreach from=$items item=i name=foo}
              <div class="col-xs-6 col-sm-6 col-md-3 m-b-sm m-xs-b-none">
                <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-info 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}
                        <span class="font-thin"> {$i.sales}<small>{$lang.sales}</small></span>
                      </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>
            {$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>还没有作品</h3>
                  </div>
                </section>
              </div>
            </div>
            {/if}

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

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