list.htm 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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/carousel/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>标题</th>
  15. <th>图片</th>
  16. <th>链接</th>
  17. <th>顺序</th>
  18. <th>状态</th>
  19. <th>操作</th>
  20. </tr>
  21. </thead>
  22. <tbody>
  23. ##for(_item in carousel_list!){
  24. <tr>
  25. <td>${_item.title!}</td>
  26. <td>
  27. <a href="${_item.img_url!}" target="_blank">
  28. <img src="${_item.img_url!}" style="height: 100px;" />
  29. </a>
  30. </td>
  31. <td>
  32. <a href="${_item.url!}" target="_blank">${_item.url!}</a>
  33. </td>
  34. <td>${_item.idx!}</td>
  35. <td>
  36. ##if(_item.status==1){
  37. 启用
  38. ##}else{
  39. 禁用
  40. ##}
  41. </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="/admin/carousel/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. </tbody>
  61. </table>
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. <script>
  67. function changeStatus(id, status, msg){
  68. if(confirm("确定要" + msg + "该记录吗?")){
  69. $.post("/admin/carousel/changeStatus",{id:id,status:status},function(data){
  70. alert(data.msg);
  71. if(data.success){
  72. location.reload();
  73. }
  74. });
  75. }
  76. }
  77. </script>
  78. ##}