{include file='common/header' /}
<div class="row">
	<div class="col-md-2">
		{include file='common/left' /}
	</div>
	<div class="col-md-10">
		{php}
			$order = input('order','id');
			$sort = input('sort','desc');
			$order = in_array($order,['id','rethread_time','views','rethreads'])?$order:'id';
			$sort = in_array($sort,['desc','asc'])?$sort:'desc';
			$lists = \app\forum\model\Thread::with('user') -> where(['forum_id'=>$forum['id'],'status'=>1]) -> order($order.' '.$sort) -> paginate(15, false, [
				'query' => input('get.')
			]);
			$page = $lists -> render();
			$moderator = $forum['moderator'];
		{/php}
		<div style="margin-bottom: 15px;padding: 10px 0;border-bottom: 3px solid #ddd;">
			本版版主：
			{foreach name='moderator' item='vo'}
				<a href="{$vo.space_url}">{$vo.nickname}</a>
			{/foreach}
		</div>
		<table class="table table-bordered table-hover" style="table-layout: fixed;">
			<tr>
				<th style="width: 100px;">作者</th>
				<th>标题</th>
				<th style="width: 140px;" class="hidden-xs">
					<a href="{:url('forum/index/index',['id'=>$forum['id']])}?order=id&sort=desc" rel="nofollow">发帖时间</a>
				</th>
				<th style="width: 50px;" class="hidden-xs">
					<a href="{:url('forum/index/index',['id'=>$forum['id']])}?order=views&sort=desc" rel="nofollow">阅读</a>
				</th>
				<th style="width: 50px;" class="hidden-xs">
					<a href="{:url('forum/index/index',['id'=>$forum['id']])}?order=rethreads&sort=desc" rel="nofollow">跟帖</a>
				</th>
				<th style="width: 140px;" class="hidden-xs">
					<a href="{:url('forum/index/index',['id'=>$forum['id']])}?order=rethread_time&sort=desc" rel="nofollow">最后回帖</a>
				</th>
			</tr>
			{include file='index/moderator' /}
			{if condition="input('page')<=1"}
				{include file='index/top2' /}
				{include file='index/top1' /}
			{/if}
			{foreach name='lists' item='vo'}
			<tr>
				<td>{notempty name='vo.user.nickname'}<a href="{$vo.user.space_url}" class="text-overflow"><img src="{$vo.user.avatar|thumb=14,14,3}" width="14" height="14" alt=""> {$vo.user.nickname}</a>{else}<img src="__ROOT__/system/image/avatar.gif" width="14" height="14" alt=""> 游客{/notempty}</td>
				<td>
					<a href="{$vo.url}" style="{$vo.style}">{$vo.title}</a>
				</td>
				<td class="hidden-xs">{$vo.create_time|date='Y-m-d H:i',###}</td>
				<td class="hidden-xs">{$vo.views}</td>
				<td class="hidden-xs">{$vo.rethreads}</td>
				<td class="hidden-xs">{$vo.rethread_time|date='Y-m-d H:i',###}</td>
			</tr>
			{/foreach}
		</table>
		{$page}
	</div>
</div>
{include file='common/footer' /}