#include("./common/header.html", {active:"recent", title : node_name ?! ''})
<div class="container">
    <div class="row">
        <div class="col-md-9">
			<div class="panel panel-default">
				<div class="panel-heading home-panel">
					<div class="box-tab">
						<ul class="nav nav-tabs">
							<li #if(null==tab)class="active"#end><a href="${base_url('/recent')}" data-toggle="tab">最新</a></li>
							#for(node : hot_nodes)
							<li #if(tab==node.slug)class="active"#end><a href="${base_url('/recent?tab=') + node.slug}" data-toggle="tab">${node.title}</a></li>
							#end
						</ul>
						<div class="tab-content">
							<div class="tab-pane active" id="home">
								#if(null == topicPage.results || topicPage.results.size() == 0)
								<div class="alert alert-info alert-dismissable">
									该节点下暂时还木有帖子呢 <i class="twa twa-lg twa-sparkles"></i>
								</div>
								#else
								<section class="widget bg-white post-comments">
									
									#for(topic : topicPage.results)
									<div class="media">
										<a class="pull-left" href="${base_url('/member/') + topic.user_name}"> 
											<img class="media-object avatar avatar-sm" src="${topic.avatar}" alt="${topic.user_name}">
										</a>
										<div class="comment">
											<div class="comment-author h6 no-margin">
												#if(topic.comments > 0)
												<div class="comment-meta small">
													<a href="${base_url('/topic/') + topic.tid + '#Reply' + topic.comments}" class="badge-comment">${topic.comments}</a>
												</div>
												<a href="${base_url('/topic/') + topic.tid + '#Reply' + topic.comments}">${topic.title}</a>
												#else
												<a href="${base_url('/topic/') + topic.tid}">${topic.title}</a>
												#end
											</div>
											<div class="comment-bt">
												<span class="label label-default"><a href="${base_url('/go/') + topic.node_slug}">${topic.node_name}</a></span> &nbsp;•&nbsp; 
												<strong><a href="${base_url('/member/') + topic.user_name}">${topic.user_name}</a></strong>
												 &nbsp;•&nbsp; <span>${timespan(topic.update_time)}</span>
												 #if(topic.comments > 0)
												 &nbsp;•&nbsp; 最后回复来自
												 <strong><a href="${base_url('/member/') + topic.reply_name}">${topic.reply_name}</a></strong>
												 #end
											</div>
										</div>
									</div>
									<hr/>
									#end
								</section>								
								#end
								
								#if(topicPage.totalPage > 1)
								<ul class="pager">
									#if(topicPage.page > 1)
									<li class="pull-left"><a href="${base_url('/?p=') + topicPage.prev_page}">上一页</a></li>
									#end
									#if(topicPage.totalPage > 1 && topicPage.page != topicPage.totalPage)
									<li class="pull-right"><a href="${base_url('/?p=') + topicPage.next_page}">下一页</a></li>
									#end
								</ul>
								#end
							</div>
						</div>
					</div>
				</div>
			</div>
            
			<div class="panel panel-default">
				<div class="panel-heading">
				    <h3 class="panel-title">社区节点导航</h3>
				</div>
				<div class="panel-body">
					#for(node : nodes)
                    	#if(node.pid == 0 && node.childs > 0)
                    		<div class="row">
                    			<div class="col-sm-2" style="line-height: 30px;">${node.node_name}</div>
                    			<div class="col-sm-10"><p>
		                     	#for(nodeitem : node.items)
		                     	<a href="${base_url('/go/') + nodeitem.node_slug}" class="btn btn-node btn-xs nodes" role="button">${nodeitem.node_name}</a>
		                     	#end
		                     	</p></div>
		                     </div>
                    	#end
                    #end
                    
                    <div class="row"><div class="col-sm-offset-2 col-sm-10"><p>
                    
                    #for(node : nodes)
                    	#if(node.pid == 0 && node.childs == 0)
                     	<a class="btn btn-node btn-xs nodes" role="button">${node.node_name}</a>
                    	#end
                    #end
                    </p></div></div>
                    
				</div>
			</div>
			        	
        </div>
        #include("./common/sidebar.html")
    </div>
</div>
#include("./common/footer.html")
</body>
</html>