<div id="forum">
	{include file="forum/forum_bar.tpl"}
	{if $smarty.get.search}<div class="forum-search">{t}Вы искали{/t}: <em class="muted">{$smarty.get.search|escape}</em></div>{/if}
	{if $pager.pages}
	<div>
		<ul class="pagination">
		{foreach $pager.pages as $page}
			{if !$page}
				<li class="disabled"><a>...</a></li>
			{else}
				<li{if $page==$pager.current} class="active"{/if}><a href="{url action=$smarty.get.action var1=$smarty.get.var1|default:0 var2=$page var3=$smarty.get.search}">{$page}</a></li>
			{/if}
		{/foreach}
		</ul>
	</div>
	{/if}

	{if $_user->isNotGuest() && $theme}
		<script type="text/javascript">
			var token='{$_user->token}';
			var ajax_url='{url action="ajax" type="json"}';
		</script>
		<div class="clearfix"></div>
		<form class="checkbox">
			<label><input {if $item_subscribed}checked="checked" {/if}type="checkbox" onchange="subscribe(this, {$theme->id})" /> Подписаться на тему</label>
		</form>
	{/if}

	<table class="current-theme table table-bordered">
		{if $theme}
			<tr class="info">
				<td colspan="2" class="subj">{$theme->subject|escape}</td>
			</tr>
		{/if}
		{foreach $posts as $post}
			{include file="forum/post_item.tpl"}
		{/foreach}
	</table>

	{if $pager.pages}
	<div>
		<ul class="pagination">
		{foreach $pager.pages as $page}
			{if !$page}
				<li class="disabled"><a>...</a></li>
			{else}
				<li{if $page==$pager.current} class="active"{/if}><a href="{url action=$smarty.get.action var1=$smarty.get.var1|default:0 var2=$page var3=$smarty.get.search}">{$page}</a></li>
			{/if}
		{/foreach}
		</ul>
	</div>
	{/if}
</div>
{if $_cfg.current.rating_enable}
	<script type="text/javascript">
		voter.url['post']='{url action="vote" type="json"}';
		voter.token='{$_user->token}';
	</script>
{/if}