<commit_before> <#if msg??>
	<div class="alert alert-danger alert-dismissible fade in" role="alert">
		<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
		${msg!}
	</div>
</#if>

<div class="row panel-body">
	<div class="col-xs-2">
		<button class="btn btn-primary btn-block" type="button" id="addBtn"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> 新增分类</button>
		<input id="page" name="page" type="hidden" value="0"/>		
    </div>
</div>
<div id="data" style="display:block">
    <table class="table table-striped table-hover">        	
        <thead>
            <tr>
                <th class="align-center">分类名称</th>
                <th class="align-center">文章数</th>
                <th class="align-center">类型</th>
                <th class="align-center">创建时间</th>
                <th class="align-center">编辑人</th>
                <th class="align-center">操作</th>
        	</tr>
        </thead>
            <#if categories.numberOfElements == 0>
            <tr>
	            <td colspan="6" class="align-center"><@messages key="common.table.empty" /></td>
            </tr>
            <#else>        
            <#list categories.content as l>
            <tr>
                <td class="align-center">${l.name}</td>
                <td class="align-center">1</td>
                <td class="align-center">${l.level!''}</td>
                <td class="align-center">${l.createTime?string('yyyy-MM-dd hh:mm:ss')}</td>
                <td class="align-center">admin</td>
                <td class="align-center">
                    <#if l.level?? && l.level == "一级">
                        <button type="button" class="btn btn-link deleteBtn" id="deleteBtn"></button>  
                    <#elseif l.name?? && l.name == "公司介绍">
                         <button type="button" class="btn btn-link deleteBtn" id="deleteBtn"></button> 
                    <#elseif l.name?? && l.name == "其他分类">
                         <button type="button" class="btn btn-link deleteBtn" id="deleteBtn"></button>                                                                                                               
                    <#elseif l.name?? && l.name == "公告">
                         <button type="button" class="btn btn-link deleteBtn" id="deleteBtn"></button>                                                                                                               
	                <#else>
                        <button type="button" class="btn btn-link editBtn" id="editBtn" pid="${l.id}">编辑</button>   
                        <button type="button" class="btn btn-link deleteBtn" id="deleteBtn" pid="${l.id}">删除</button>                                             			  			                
	                </#if>                            
                </td>
            </tr>
            </#list>
            </#if>
    </table>
           <ul class="pagination" data-number="${categories.number}" data-total-pages="${categories.totalPages}"></ul>      
</div>
        
        
<script type="text/javascript">
	jQuery(function($) {
		$('.pagination').pagination({
		handler: function(elem) {
			$('#page').val(elem.data().page);
			$('#searchForm').trigger('submit');
		}
	});
	    //点击删除按钮
		$(".deleteBtn").on("click",function(){
			$.post("${app}/content/deleteCategory",
			      {id:$(this).attr("pid")},<commit_msg>bug解决 ：分类列表默认的三级可以删除，删除各个页面就会报错<commit_after> <#if msg??>
	<div class="alert alert-danger alert-dismissible fade in" role="alert">
		<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
		${msg!}
	</div>
</#if>

<div class="row panel-body">
	<div class="col-xs-2">
		<button class="btn btn-primary btn-block" type="button" id="addBtn"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> 新增分类</button>
		<input id="page" name="page" type="hidden" value="0"/>		
    </div>
</div>
<div id="data" style="display:block">
    <table class="table table-striped table-hover">        	
        <thead>
            <tr>
                <th class="align-center">分类名称</th>
                <th class="align-center">文章数</th>
                <th class="align-center">类型</th>
                <th class="align-center">创建时间</th>
                <th class="align-center">编辑人</th>
                <th class="align-center">操作</th>
        	</tr>
        </thead>
            <#if categories.numberOfElements == 0>
            <tr>
	            <td colspan="6" class="align-center"><@messages key="common.table.empty" /></td>
            </tr>
            <#else>        
            <#list categories.content as l>
            <tr>
                <td class="align-center">${l.name}</td>
                <td class="align-center">1</td>
                <td class="align-center">${l.level!''}</td>
                <td class="align-center">${l.createTime?string('yyyy-MM-dd hh:mm:ss')}</td>
                <td class="align-center">admin</td>
                <td class="align-center">
                    <#if l.level?? && l.level == "一级">
                        <button type="button" class="btn btn-link deleteBtn" id="deleteBtn"></button>  
                    <#elseif l.name?? && l.name == "公司介绍">
                         <button type="button" class="btn btn-link deleteBtn" id="deleteBtn"></button> 
                    <#elseif l.name?? && l.name == "其他分类">
                         <button type="button" class="btn btn-link deleteBtn" id="deleteBtn"></button>                                                                                                               
                    <#elseif l.name?? && l.name == "公告">
                         <button type="button" class="btn btn-link deleteBtn" id="deleteBtn"></button>                                                                                                               
                    <#elseif l.name?? && l.name == "平台简介">
                         <button type="button" class="btn btn-link deleteBtn" id="deleteBtn"></button>                                                                                                               
	                <#else>
                        <button type="button" class="btn btn-link editBtn" id="editBtn" pid="${l.id}">编辑</button>   
                        <button type="button" class="btn btn-link deleteBtn" id="deleteBtn" pid="${l.id}">删除</button>                                             			  			                
	                </#if>                            
                </td>
            </tr>
            </#list>
            </#if>
    </table>
           <ul class="pagination" data-number="${categories.number}" data-total-pages="${categories.totalPages}"></ul>      
</div>
        
        
<script type="text/javascript">
	jQuery(function($) {
		$('.pagination').pagination({
		handler: function(elem) {
			$('#page').val(elem.data().page);
			$('#searchForm').trigger('submit');
		}
	});
	    //点击删除按钮
		$(".deleteBtn").on("click",function(){
			$.post("${app}/content/deleteCategory",
			      {id:$(this).attr("pid")},
{'fraction_non_alphanumeric': 0.17700097100846165, 'fraction_numerical': 0.0013871549452073796, 'mean_word_length': 1.494809688581315, 'pattern_counts': {'":': 0, '<': 174, '<?xml version=': 0, '>': 174, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 29, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1891639', 'n_tokens_mistral': 2132, 'n_tokens_neox': 2061, 'n_words': 352}