{include file="$admin_template_path/html/header.html"}
<link href="{$admin_template_data}css/resource.css" media="screen" rel="stylesheet" type="text/css" />
</head>
<body>
{include file="$admin_template_path/html/pagetops.html"}
{if $errorMessage}
<div id="errormsg">
<div class="msg">
  <div class="closebtn"><i data-icon="" class="icon-close"></i></div>
  {$errorMessage}
</div>
</div>
{literal}
<script type="text/javascript">
seajs.use(["modules/pageui/msg"], function(msg){
    msg.msginit("#errormsg");
});
</script>
{/literal}
{/if}

<div class="pagebg">
  <div class="mcontent pagemain clr">
    {include file="$admin_template_path/html/leftmenu.html"}
    <div class="pagemainconent">

    <div class="rightdetail_admin">
      <div class="sideblock">
        <div class="sideheader">更新作品审核</div>
        <div class="sidebody">
          <form id="sampleform" class="" action="" method="post">
            <div class="input-group clr">
              <label class="control-label">卖家</label>
              <div class="inputs">
                <label class="checktext"><a href="/{$languageURL}admin/?m=users&c=edit&id={$item.user.user_id}" title="" target="_blank">{$item.user.username}</a></label>
              </div>
            </div>
            <div class="input-group clr">
              <label class="control-label"{if $data.thumbnail!=''} style="color: #f00;font-weight:bold;"{/if}>缩略图</label>
              <div class="inputs uploadobjs clr" id="thumbnail">
                <input autocomplete="off" type="hidden" class="hiddenvalue" name="thumbnail" value="{if $data.thumbnail!=''}{$data.thumbnail}{else}{$item.thumbnail}{/if}" />
              </div>
            </div>
            <div class="input-group clr">
              <label class="control-label"{if $data.main_file!=''} style="color: #f00;font-weight:bold;"{/if}>{$lang.main_file}</label>
              <div class="inputs uploadobjs clr" id="main_file">
                <input autocomplete="off" type="hidden" class="hiddenvalue" name="main_file" value="{if $data.main_file!=''}{$data.main_file}{else}{$item.main_file}{/if}" />
              </div>
            </div>
            <div class="input-group clr">
              <label class="control-label"{if $data.first_preview!=''} style="color: #f00;font-weight:bold;"{/if}>封面预览文件</label>
              <div class="inputs uploadobjs clr" id="first_preview">
                <input autocomplete="off" type="hidden" class="hiddenvalue" name="first_preview" value="{if $data.first_preview!=''}{$data.first_preview}{else}{$item.theme_preview}{/if}" />
              </div>
            </div>
            <div class="input-group clr">
              <label class="control-label"{if $data.preview_status == 0} style="color: #f00;font-weight:bold;"{/if}>其他预览文件</label>
              <div class="inputs uploadobjs clr" id="theme_preview">
                <input autocomplete="off" type="hidden" class="hiddenvalue" name="theme_preview" value="{foreach from=$data.preview item=s name=foo}{$s.dir}{if !$smarty.foreach.foo.last},{/if}{/foreach}" />
              </div>
            </div>
            <div class="input-group clr">
              <label class="control-label">{$lang.comment}</label>
              <div class="inputs">
                <label class="checktext">{$data.reviewer_comment}</label>
              </div>
            </div>
            <div class="form-submit" style="width:100%;">
              <button type="button" id="approvebtn" class="btntheme btnsize btn-primary">{$lang.approve}</button>
              <button type="button" id="deletebtn" class="btntheme btnsize btn-primary">{$lang.remove_item_update}</button>
            </div>
            <div class="input-group clr" id="approve_item" {if $smarty.post.action != 'approve'}style="display: none;"{/if}>
              <label class="control-label" for="newprice">{$lang.new_price}</label>
              <div class="inputs">
                <input type="text" id="newprice" class="ipttheme" style="width:182px" value="{$smarty.post.price|escape}" name="price" >
                <label class="checktext">{$lang.old_price}: ¥{$item.price|string_format:"%.0f"}</label>
              </div>
            </div>
            <input id="item_action" type="hidden" name="action" value="{$smarty.post.action}" />
            <div class="input-group clr" id="unapprove_item" {if $smarty.post.action != 'delete'}style="display: none;"{/if}>
              <label class="control-label" for="comm">{$lang.comment}</label>
              <div class="inputs">
                <textarea class="ipttheme area" id="comm" name="comment_to_user"></textarea>		
              </div>
            </div>
            <div id="submit_form" {if $smarty.post.action == ''}style="display: none;"{/if}>
              <input class="btntheme btnsize btn-primary" type="submit" name="submit" value="{$lang.save}" onclick="return confirm('{$lang.are_you_sure_submit}');" />
            </div>
          </form>
        </div>
      </div>
    </div>
    
    </div>
  </div>
</div>
{literal}
<script type="text/javascript">
seajs.use(["jq", "modules/pageui/admin", "modules/pageui/upload"], function($, adm, ui){
  $("#approvebtn").on("click", function(){
    adm.showFields("approve");
  });
  $("#deletebtn").on("click", function(){
    adm.showFields("delete");
  });
  ui.uploadInit("", "", "viewonly");
});
</script>
{/literal}
</body>
</html>