list.htm 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. ##tlayout("admin/layout.htm"){
  2. <div class="breadcrumbs" style="padding-top:10px;height: 50px;">
  3. <div class="col-xs-4">
  4. <a href="/admin/diy/add" class="btn btn-info btn-sm"style="margin-top: -12px;margin-left: 10px;">+添加模板</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/diyType?type=1">用途</a>
  8. <a class="btn btn-sm" style="margin-top: -12px;margin-left: 10px;" href="/admin/diyType?type=2">行业</a>
  9. <a class="btn btn-sm" style="margin-top: -12px;margin-left: 10px;" href="/admin/diyType?type=3">节日</a>
  10. <a class="btn btn-sm" style="margin-top: -12px;margin-left: 10px;" href="/admin/diyType?type=4">风格</a>
  11. </div>
  12. </div>
  13. <div class="page-content">
  14. <div class="row">
  15. <div class="col-xs-12">
  16. <div class="table-responsive">
  17. <table class="table table-striped table-bordered table-hover">
  18. <thead>
  19. <tr>
  20. <th>图片</th>
  21. <th>标题</th>
  22. <th>状态</th>
  23. <th>创建时间</th>
  24. <th>操作</th>
  25. </tr>
  26. </thead>
  27. <tbody>
  28. ##if(results!=null && results.list.~size!=0){
  29. ##for(_item in results.list!){
  30. <tr>
  31. <td>
  32. <a href="${_item.img_url!}" target="_blank"><img src="${_item.img_url!}" style="height: 400px;" /></a>
  33. </td>
  34. <td>
  35. <div style="border-bottom: 1px dashed #ccc;padding-bottom: 10px;">${_item.title!}</div>
  36. <div style="margin-top: 10px;">用途:${_item.purpose_title!}</div>
  37. <div style="margin-top: 10px;">行业:${_item.industry_title!}</div>
  38. <div style="margin-top: 10px;">节日:${_item.festival_title!}</div>
  39. <div style="margin-top: 10px;">风格:${_item.style_title!}</div>
  40. <div style="margin-top: 10px;">专题:${_item.subject_title!}</div>
  41. </td>
  42. <td>
  43. ##if(_item.status==1){
  44. <div>启用</div>
  45. ##}else if(_item.status==0){
  46. <div>禁用</div>
  47. ##}else{
  48. <div>信息不完整</div>
  49. ##}
  50. ##if(_item.top==1){
  51. <div style="margin-top: 10px;">置顶</div>
  52. ##}
  53. </td>
  54. <td>${_item.create_date!,dateFormat='yyyy-MM-dd HH:mm'}</td>
  55. <td style="width:100px;">
  56. <div class="btn-group">
  57. <button class="btn btn-info btn-sm dropdown-toggle" data-toggle="dropdown">
  58. 操作<span class="icon-caret-down icon-on-right"></span>
  59. </button>
  60. <ul class="dropdown-menu dropdown-info pull-right">
  61. <li><a href="/admin/diy/edit?id=${_item.id!}">编辑</a></li>
  62. ##if(_item.status==1){
  63. <li><a href="javascript:changeStatus(${_item.id!}, 0, '禁用')">禁用</a></li>
  64. ##}else if(_item.status==0){
  65. <li><a href="javascript:changeStatus(${_item.id!}, 1, '启用')">启用</a></li>
  66. ##}
  67. ##if(_item.top==1){
  68. <li><a href="javascript:changeTop(${_item.id!}, 0, '取消置顶')">取消置顶</a></li>
  69. ##}else{
  70. <li><a href="javascript:changeTop(${_item.id!}, 1, '置顶')">置顶</a></li>
  71. ##}
  72. <li><a href="javascript:changeStatus(${_item.id!}, 9, '删除')">删除</a></li>
  73. </ul>
  74. </div>
  75. </td>
  76. </tr>
  77. ##}
  78. ##}
  79. </tbody>
  80. </table>
  81. ##if(totalPage>1){
  82. <div class="fenye">
  83. <#_pagination page="${results!}">
  84. <ul id="Pagination"></ul>
  85. </#_pagination>
  86. </div>
  87. ##}
  88. </div>
  89. </div>
  90. </div>
  91. </div>
  92. <script>
  93. function changeStatus(id, status, msg){
  94. if(confirm("确定要" + msg + "该记录吗?")){
  95. $.post("/admin/diy/changeStatus",{id:id,status:status},function(data){
  96. alert(data.msg);
  97. if(data.success){
  98. location.reload();
  99. }
  100. });
  101. }
  102. }
  103. function changeTop(id, top, msg){
  104. if(confirm("确定要" + msg + "该记录吗?")){
  105. $.post("/admin/diy/changeTop",{id:id,top:top},function(data){
  106. alert(data.msg);
  107. if(data.success){
  108. location.reload();
  109. }
  110. });
  111. }
  112. }
  113. </script>
  114. ##}