index.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. <include file="public@header"/>
  2. </head>
  3. <body>
  4. <div class="wrap js-check-wrap">
  5. <ul class="nav nav-tabs">
  6. <li class="active"><a href="javascript:;">所有文章</a></li>
  7. <li><a href="{:url('AdminArticle/add')}">添加文章</a></li>
  8. </ul>
  9. <form class="well form-inline margin-top-20" method="post" action="{:url('AdminArticle/index')}">
  10. 分类:
  11. <select class="form-control" name="category" style="width: 140px;">
  12. <option value='0'>全部</option>
  13. {$category_tree|default=''}
  14. </select> &nbsp;&nbsp;
  15. 时间:
  16. <input type="text" class="form-control js-bootstrap-datetime" name="start_time"
  17. value="{$start_time|default=''}"
  18. style="width: 140px;" autocomplete="off">-
  19. <input type="text" class="form-control js-bootstrap-datetime" name="end_time"
  20. value="{$end_time|default=''}"
  21. style="width: 140px;" autocomplete="off"> &nbsp; &nbsp;
  22. 关键字:
  23. <input type="text" class="form-control" name="keyword" style="width: 200px;"
  24. value="{$keyword|default=''}" placeholder="请输入关键字...">
  25. <input type="submit" class="btn btn-primary" value="搜索"/>
  26. <a class="btn btn-danger" href="{:url('AdminArticle/index')}">清空</a>
  27. </form>
  28. <form class="js-ajax-form" action="" method="post">
  29. <div class="table-actions">
  30. <notempty name="category">
  31. <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
  32. data-action="{:url('AdminArticle/listOrder')}">{:lang('SORT')}
  33. </button>
  34. </notempty>
  35. <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
  36. data-action="{:url('AdminArticle/publish',array('yes'=>1))}" data-subcheck="true">发布
  37. </button>
  38. <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
  39. data-action="{:url('AdminArticle/publish',array('no'=>1))}" data-subcheck="true">取消发布
  40. </button>
  41. <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
  42. data-action="{:url('AdminArticle/top',array('yes'=>1))}" data-subcheck="true">置顶
  43. </button>
  44. <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
  45. data-action="{:url('AdminArticle/top',array('no'=>1))}" data-subcheck="true">取消置顶
  46. </button>
  47. <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
  48. data-action="{:url('AdminArticle/recommend',array('yes'=>1))}" data-subcheck="true">推荐
  49. </button>
  50. <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
  51. data-action="{:url('AdminArticle/recommend',array('no'=>1))}" data-subcheck="true">取消推荐
  52. </button>
  53. <!--
  54. <notempty name="category">
  55. <button class="btn btn-primary btn-sm js-articles-move" type="button">批量移动</button>
  56. </notempty>
  57. <button class="btn btn-primary btn-sm js-articles-copy" type="button">批量复制</button>
  58. -->
  59. <button class="btn btn-danger btn-sm js-ajax-submit" type="submit"
  60. data-action="{:url('AdminArticle/delete')}" data-subcheck="true" data-msg="您确定删除吗?">
  61. {:lang('DELETE')}
  62. </button>
  63. </div>
  64. <table class="table table-hover table-bordered table-list">
  65. <thead>
  66. <tr>
  67. <th width="15">
  68. <label>
  69. <input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">
  70. </label>
  71. </th>
  72. <notempty name="category">
  73. <th width="50">{:lang('SORT')}</th>
  74. </notempty>
  75. <th width="50">ID</th>
  76. <th>标题</th>
  77. <th>分类</th>
  78. <th width="50">作者</th>
  79. <th width="65">点击量</th>
  80. <th width="65">评论量</th>
  81. <th width="160">关键字/来源<br>摘要/缩略图</th>
  82. <th width="160">更新时间</th>
  83. <th width="160">发布时间</th>
  84. <th width="70">状态</th>
  85. <th width="95">操作</th>
  86. </tr>
  87. </thead>
  88. <foreach name="articles" item="vo">
  89. <tr>
  90. <td>
  91. <input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]"
  92. value="{$vo.id}" title="ID:{$vo.id}">
  93. </td>
  94. <notempty name="category">
  95. <td>
  96. <input name="list_orders[{$vo.post_category_id}]" class="input-order" type="text"
  97. value="{$vo.list_order}">
  98. </td>
  99. </notempty>
  100. <td><b>{$vo.id}</b></td>
  101. <td>
  102. <notempty name="category">
  103. <a href="{:cmf_url('portal/Article/index',array('id'=>$vo['id'],'cid'=>$vo['category_id']))}"
  104. target="_blank">{$vo.post_title}</a>
  105. <else/>
  106. <a href="{:cmf_url('portal/Article/index',array('id'=>$vo['id']))}"
  107. target="_blank">{$vo.post_title}</a>
  108. </notempty>
  109. </td>
  110. <td>
  111. <foreach name="vo.categories" item="voo">
  112. <a class="label label-default"
  113. href="{:cmf_url('portal/List/index',array('id'=>$voo['id']))}"
  114. target="_blank"
  115. >{$voo.name}</a>
  116. </foreach>
  117. </td>
  118. <td>{$vo.user_nicename}</td>
  119. <td>{$vo.post_hits|default=0}</td>
  120. <td>
  121. <notempty name="vo.comment_count">
  122. {$vo.comment_count|default='0'}
  123. <!--<a href="javascript:parent.openIframeDialog('{:url('comment/commentadmin/index',array('post_id'=>$vo['id']))}','评论列表')">{$vo.comment_count}</a>-->
  124. <else/>
  125. {$vo.comment_count|default='0'}
  126. </notempty>
  127. </td>
  128. <td>
  129. <notempty name="vo.post_keywords">
  130. <i class="fa fa-check fa-fw"></i>
  131. <else/>
  132. <i class="fa fa-close fa-fw"></i>
  133. </notempty>
  134. <notempty name="vo.post_source">
  135. <i class="fa fa-check fa-fw"></i>
  136. <else/>
  137. <i class="fa fa-close fa-fw"></i>
  138. </notempty>
  139. <notempty name="vo.post_excerpt">
  140. <i class="fa fa-check fa-fw"></i>
  141. <else/>
  142. <i class="fa fa-close fa-fw"></i>
  143. </notempty>
  144. <notempty name="vo.more.thumbnail">
  145. <a href="javascript:parent.imagePreviewDialog('{:cmf_get_image_preview_url($vo.more.thumbnail)}');">
  146. <i class="fa fa-photo fa-fw"></i>
  147. </a>
  148. <else/>
  149. <i class="fa fa-close fa-fw"></i>
  150. </notempty>
  151. </td>
  152. <td>
  153. <notempty name="vo.update_time">
  154. {:date('Y-m-d H:i',$vo['update_time'])}
  155. </notempty>
  156. </td>
  157. <td>
  158. <empty name="vo.published_time">
  159. 未发布
  160. <else/>
  161. {:date('Y-m-d H:i',$vo['published_time'])}
  162. </empty>
  163. </td>
  164. <td>
  165. <notempty name="vo.post_status">
  166. <a data-toggle="tooltip" title="已发布"><i class="fa fa-check"></i></a>
  167. <else/>
  168. <a data-toggle="tooltip" title="未发布"><i class="fa fa-close"></i></a>
  169. </notempty>
  170. <notempty name="vo.is_top">
  171. <a data-toggle="tooltip" title="已置顶"><i class="fa fa-arrow-up"></i></a>
  172. <else/>
  173. <a data-toggle="tooltip" title="未置顶"><i class="fa fa-arrow-down"></i></a>
  174. </notempty>
  175. <notempty name="vo.recommended">
  176. <a data-toggle="tooltip" title="已推荐"><i class="fa fa-thumbs-up"></i></a>
  177. <else/>
  178. <a data-toggle="tooltip" title="未推荐"><i class="fa fa-thumbs-down"></i></a>
  179. </notempty>
  180. </td>
  181. <td>
  182. <a class="btn btn-xs btn-primary" href="{:url('AdminArticle/edit',array('id'=>$vo['id']))}">{:lang('EDIT')}</a>
  183. <a class="btn btn-xs btn-danger js-ajax-delete"
  184. href="{:url('AdminArticle/delete',array('id'=>$vo['id']))}">{:lang('DELETE')}</a>
  185. </td>
  186. </tr>
  187. </foreach>
  188. <tfoot>
  189. <tr>
  190. <th width="15"><label><input type="checkbox" class="js-check-all" data-direction="x"
  191. data-checklist="js-check-x"></label></th>
  192. <notempty name="category">
  193. <th width="50">{:lang('SORT')}</th>
  194. </notempty>
  195. <th width="50">ID</th>
  196. <th>标题</th>
  197. <th>分类</th>
  198. <th width="50">作者</th>
  199. <th width="65">点击量</th>
  200. <th width="65">评论量</th>
  201. <th width="160">关键字/来源<br>摘要/缩略图</th>
  202. <th width="160">更新时间</th>
  203. <th width="160">发布时间</th>
  204. <th width="70">状态</th>
  205. <th width="90">操作</th>
  206. </tr>
  207. </tfoot>
  208. </table>
  209. <div class="table-actions">
  210. <notempty name="category">
  211. <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
  212. data-action="{:url('AdminArticle/listOrder')}">{:lang('SORT')}
  213. </button>
  214. </notempty>
  215. <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
  216. data-action="{:url('AdminArticle/publish',array('yes'=>1))}" data-subcheck="true">发布
  217. </button>
  218. <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
  219. data-action="{:url('AdminArticle/publish',array('no'=>1))}" data-subcheck="true">取消发布
  220. </button>
  221. <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
  222. data-action="{:url('AdminArticle/top',array('yes'=>1))}" data-subcheck="true">置顶
  223. </button>
  224. <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
  225. data-action="{:url('AdminArticle/top',array('no'=>1))}" data-subcheck="true">取消置顶
  226. </button>
  227. <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
  228. data-action="{:url('AdminArticle/recommend',array('yes'=>1))}" data-subcheck="true">推荐
  229. </button>
  230. <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
  231. data-action="{:url('AdminArticle/recommend',array('no'=>1))}" data-subcheck="true">取消推荐
  232. </button>
  233. <!--
  234. <notempty name="category">
  235. <button class="btn btn-primary btn-sm js-articles-move" type="button">批量移动</button>
  236. </notempty>
  237. <button class="btn btn-primary btn-sm js-articles-copy" type="button">批量复制</button>
  238. -->
  239. <button class="btn btn-danger btn-sm js-ajax-submit" type="submit"
  240. data-action="{:url('AdminArticle/delete')}" data-subcheck="true" data-msg="您确定删除吗?">
  241. {:lang('DELETE')}
  242. </button>
  243. </div>
  244. <ul class="pagination">{$page|default=''}</ul>
  245. </form>
  246. </div>
  247. <script src="__STATIC__/js/admin.js"></script>
  248. <script>
  249. function reloadPage(win) {
  250. win.location.reload();
  251. }
  252. $(function () {
  253. setCookie("refersh_time", 0);
  254. Wind.use('ajaxForm', 'artDialog', 'iframeTools', function () {
  255. //批量复制
  256. $('.js-articles-copy').click(function (e) {
  257. var ids = [];
  258. $("input[name='ids[]']").each(function () {
  259. if ($(this).is(':checked')) {
  260. ids.push($(this).val());
  261. }
  262. });
  263. if (ids.length == 0) {
  264. art.dialog.through({
  265. id: 'error',
  266. icon: 'error',
  267. content: '您没有勾选信息,无法进行操作!',
  268. cancelVal: '关闭',
  269. cancel: true
  270. });
  271. return false;
  272. }
  273. ids = ids.join(',');
  274. art.dialog.open("__ROOT__/index.php?g=portal&m=AdminArticle&a=copy&ids=" + ids, {
  275. title: "批量复制",
  276. width: "300px"
  277. });
  278. });
  279. //批量移动
  280. $('.js-articles-move').click(function (e) {
  281. var ids = [];
  282. $("input[name='ids[]']").each(function () {
  283. if ($(this).is(':checked')) {
  284. ids.push($(this).val());
  285. }
  286. });
  287. if (ids.length == 0) {
  288. art.dialog.through({
  289. id: 'error',
  290. icon: 'error',
  291. content: '您没有勾选信息,无法进行操作!',
  292. cancelVal: '关闭',
  293. cancel: true
  294. });
  295. return false;
  296. }
  297. ids = ids.join(',');
  298. art.dialog.open("__ROOT__/index.php?g=portal&m=AdminArticle&a=move&old_term_id={$term.term_id|default=0}&ids=" + ids, {
  299. title: "批量移动",
  300. width: "300px"
  301. });
  302. });
  303. });
  304. });
  305. </script>
  306. </body>
  307. </html>