label_list.tpl 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <title>标签管理 - Powered by MinDoc</title>
  8. <!-- Bootstrap -->
  9. <link href="{{cdncss "/static/bootstrap/css/bootstrap.min.css"}}" rel="stylesheet" type="text/css">
  10. <link href="{{cdncss "/static/font-awesome/css/font-awesome.min.css"}}" rel="stylesheet" type="text/css">
  11. <link href="{{cdncss "/static/css/main.css"}}" rel="stylesheet">
  12. <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
  13. <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  14. <!--[if lt IE 9]>
  15. <script src="{{cdnjs "/static/html5shiv/3.7.3/html5shiv.min.js"}}"></script>
  16. <script src="{{cdnjs "/static/respond.js/1.4.2/respond.min.js" }}"></script>
  17. <![endif]-->
  18. </head>
  19. <body>
  20. <div class="manual-reader">
  21. {{template "widgets/header.tpl" .}}
  22. <div class="container manual-body">
  23. <div class="row">
  24. <div class="page-left">
  25. <ul class="menu">
  26. <li><a href="{{urlfor "ManagerController.Index"}}" class="item"><i class="fa fa-dashboard" aria-hidden="true"></i> 仪表盘</a> </li>
  27. <li><a href="{{urlfor "ManagerController.Users" }}" class="item"><i class="fa fa-users" aria-hidden="true"></i> 用户管理</a> </li>
  28. <li><a href="{{urlfor "ManagerController.Books" }}" class="item"><i class="fa fa-book" aria-hidden="true"></i> 项目管理</a> </li>
  29. {{/*<li><a href="{{urlfor "ManagerController.Comments" }}" class="item"><i class="fa fa-comments-o" aria-hidden="true"></i> 评论管理</a> </li>*/}}
  30. <li><a href="{{urlfor "ManagerController.Setting" }}" class="item"><i class="fa fa-cogs" aria-hidden="true"></i> 配置管理</a> </li>
  31. <li><a href="{{urlfor "ManagerController.AttachList" }}" class="item"><i class="fa fa-cloud-upload" aria-hidden="true"></i> 附件管理</a> </li>
  32. <li class="active"><a href="{{urlfor "ManagerController.LabelList" }}" class="item"><i class="fa fa-bookmark" aria-hidden="true"></i> 标签管理</a> </li>
  33. </ul>
  34. </div>
  35. <div class="page-right">
  36. <div class="m-box">
  37. <div class="box-head">
  38. <strong class="box-title">标签管理</strong>
  39. </div>
  40. </div>
  41. <div class="box-body">
  42. <div class="attach-list" id="labelList">
  43. <table class="table">
  44. <thead>
  45. <tr>
  46. <th width="10%">#</th>
  47. <th width="55%">标签名称</th>
  48. <th width="20%">使用数量</th>
  49. <th>操作</th>
  50. </tr>
  51. </thead>
  52. <tbody>
  53. {{range $index,$item := .Lists}}
  54. <tr>
  55. <td>{{$item.LabelId}}</td>
  56. <td>{{$item.LabelName}}</td>
  57. <td>{{$item.BookNumber}}</td>
  58. <td>
  59. <button type="button" data-method="delete" class="btn btn-danger btn-sm" data-id="{{$item.LabelId}}" data-loading-text="删除中...">删除</button>
  60. <a href="{{urlfor "LabelController.Index" ":key" $item.LabelName}}" class="btn btn-success btn-sm" target="_blank">详情</a>
  61. </td>
  62. </tr>
  63. {{else}}
  64. <tr><td class="text-center" colspan="6">暂无数据</td></tr>
  65. {{end}}
  66. </tbody>
  67. </table>
  68. <nav class="pagination-container">
  69. {{.PageHtml}}
  70. </nav>
  71. </div>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. {{template "widgets/footer.tpl" .}}
  77. </div>
  78. <script src="{{cdnjs "/static/jquery/1.12.4/jquery.min.js"}}"></script>
  79. <script src="{{cdnjs "/static/bootstrap/js/bootstrap.min.js"}}"></script>
  80. <script src="{{cdnjs "/static/js/jquery.form.js"}}" type="text/javascript"></script>
  81. <script src="{{cdnjs "/static/layer/layer.js" }}" type="text/javascript"></script>
  82. <script type="text/javascript">
  83. $(function () {
  84. $("#labelList").on("click","button[data-method='delete']",function () {
  85. var id = $(this).attr("data-id");
  86. var $this = $(this);
  87. $(this).button("loading");
  88. $.ajax({
  89. url : "{{urlfor "ManagerController.LabelDelete" ":id" ""}}" + id,
  90. type : "post",
  91. dataType : "json",
  92. success : function (res) {
  93. if(res.errcode === 0){
  94. $this.closest("tr").remove().empty();
  95. }else {
  96. layer.msg(res.message);
  97. }
  98. },
  99. error : function () {
  100. layer.msg("服务器异常");
  101. },
  102. complete : function () {
  103. $this.button("reset");
  104. }
  105. });
  106. });
  107. });
  108. </script>
  109. </body>
  110. </html>