list.htm 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. ##tlayout("admin/layout.htm"){
  2. <div class="breadcrumbs" style="padding-top:10px;height: 50px;">
  3. <div class="col-xs-12">
  4. <a class="btn btn-info btn-sm"style="margin-top: -12px;margin-left: 10px;" href="/admin/article/add">+添加文章</a>
  5. </div>
  6. </div>
  7. <div class="page-content">
  8. <div class="row" style="margin-top:10px;">
  9. <div class="col-xs-12">
  10. <div class="table-responsive">
  11. <table class="table table-striped table-bordered table-hover">
  12. <thead>
  13. <tr>
  14. <th style="width: 35%;">标题</th>
  15. <th>状态</th>
  16. <th>添加时间</th>
  17. <th>操作</th>
  18. </tr>
  19. </thead>
  20. <tbody>
  21. ##if(results!=null && results.list.~size!=0){
  22. ##for(_item in results.list!){
  23. <tr>
  24. <td>${_item.title!}</td>
  25. <td>
  26. ##if(_item.status==1){
  27. 启用
  28. ##}else{
  29. 禁用
  30. ##}
  31. </td>
  32. <td>${_item.create_date!,dateFormat='yyyy-MM-dd HH:mm'}</td>
  33. <td style="width:100px;">
  34. <div class="btn-group">
  35. <button class="btn btn-info btn-sm dropdown-toggle" data-toggle="dropdown">
  36. 操作<span class="icon-caret-down icon-on-right"></span>
  37. </button>
  38. <ul class="dropdown-menu dropdown-info pull-right">
  39. <li><a href="/admin/article/msg?id=${_item.id}" target="_blank">详细信息</a></li>
  40. <li><a href="/admin/article/edit?id=${_item.id}">编辑</a></li>
  41. ##if(_item.type==1){
  42. ##if(_item.status==1){
  43. <li><a href="javascript:changeStatus(${_item.id!}, 0, '禁用')">禁用</a></li>
  44. ##}else{
  45. <li><a href="javascript:changeStatus(${_item.id!}, 1, '启用')">启用</a></li>
  46. ##}
  47. <li><a href="javascript:changeStatus(${_item.id!}, 9, '删除')">删除</a></li>
  48. ##}
  49. </ul>
  50. </div>
  51. </td>
  52. </tr>
  53. ##}
  54. ##}
  55. </tbody>
  56. </table>
  57. ##if(totalPage>1){
  58. <div class="fenye">
  59. <#_pagination page="${results!}">
  60. <ul id="Pagination"></ul>
  61. </#_pagination>
  62. </div>
  63. ##}
  64. </div>
  65. </div>
  66. </div>
  67. </div>
  68. <script>
  69. function changeStatus(id, status, msg){
  70. if(confirm("确定要" + msg + "该记录吗?")){
  71. $.post("/admin/article/changeStatus",{id:id,status:status},function(data){
  72. alert(data.msg);
  73. if(data.success){
  74. location.reload();
  75. }
  76. });
  77. }
  78. }
  79. </script>
  80. ##}