{include file="$admin_template_path/html/header.html"}
</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{if $paging !=""} paging{/if}">

		{if $paging !=""}
		<div class="page-controls">
			{$paging}
		</div>
		{/if}
		<div class="rightdetail_admin">
			{if is_array($data)}
			<div class="general_table_border">
				<table id="commentlist" class="general_table" cellspacing="0" cellpadding="0" border="0">
					<thead>
						<tr>
							<th width="400">{$lang.comment}</th>
							<th>{$lang.item}</th>
							<th>{$lang.reported_by}</th>
							<th width="250">操作</th>
						</tr>
					</thead>
					<tbody>
						{foreach from=$data item=d}
						<tr id="row{$d.user_id}" class="{cycle values="no,alt"}">
							<td><a href="?m={$smarty.get.m}&c=comments&item={$d.item_id}">{$d.comment|nl2br}</a></td>
							<td><a href="/{$languageURL}items/{$d.item_id}/" title="" target="_blank">{$d.item_name}</a></td>
							<td>{$users[$d.report_by].username}</td>
							<td>
							<a href="?m={$smarty.get.m}&c=comments&check={$d.id}" title="{$lang.report_check}"><img class="middle" src="{$template_data}admin/images/icons/16x16/edit.png" /> 忽略</a>
							<a class="deletebtn" ajax-url="/apps/{$smarty.get.m}/ajax/delete.php" item-id="{$d.id}" href="javascript:void(0);" title="{$lang.delete}"><i class="fa fa-trash-o text-danger m-r-xs"></i> 删除</a>
							</td>
						</tr>
						{/foreach}
					</tbody>
				</table>
			</div>
			{literal}
			<script type="text/javascript">
			seajs.use(["modules/ajax/btns"], function(aj){
			aj.deletebtninit("#commentlist .deletebtn", "ajax-url", "item-id", {'deleteComment':true,'id':''}, "deleteRow", true);
			});
			</script>
			{/literal}
			{else}
			<div>暂无内容</div>
			{/if}
		</div>
		
		</div>
	</div>
</div>
</body>
</html>