<%- partial('sidebar') %>

<div id='content'>
	<div class='panel'>
		<div class='moon'>
			<% if (locals.current_user && current_user.is_admin) { %>
			<span class='fr'><a href='/tags/edit'><img src="<%- config.site_static_host %>/images/wrench_icon&16.png" title='编辑标签' /></a></span>
			<% } %>
		</div>
		<div class='moon_tags'>
			<% if (locals.tags && tags.length > 0) { %>
				<%- partial('tag/tag', tags) %>
			<% } else { %>
				<p>无标签</p>
			<% } %>
		</div>
		<div class='header'>
			<img src="<%- config.site_static_host %>/images/spechbubble_2_icon&16.png" title='话题'/>
			
			<% if (locals.current_user) { %>
			<a href='/topic/create' class='fr'><button class='btn btn-success fr' id='create_topic_btn'>发布话题</button></a>
			<% } %>
		</div>
		<% if (locals.topics && topics.length > 0) { %>
		<%- partial('topic/list', { 
			topics: topics,
			pages: pages,
			current_pages: current_page,
			base: keyword ? ('/?q=' + keyword) : '/' 
		}) %>
		<% } else { %>
		<div class='inner'>
			<p>无话题</p>
		</div>
		<% } %>
	</div>
</div>