list.htm 2.6 KB

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