news-category.html 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. {template 'common/header'}
  2. <div class="we7-page-title">文章管理</div>
  3. <ul class="we7-page-tab">
  4. <li {if $do == 'list'}class="active"{/if}><a href="{php echo url('article/news/list');}">新闻列表</a></li>
  5. <li {if $do == 'category' || $do == 'category_post'}class="active"{/if}><a href="{php echo url('article/news/category');}">新闻分类</a></li>
  6. <!--<li {if $do == 'post' && !$id}class="active"{/if}><a href="{php echo url('article/news/post');}">添加新闻</a></li>
  7. {if $do == 'post' && $id}<li class="active"><a href="{php echo url('article/news/post');}">编辑新闻</a></li>{/if}-->
  8. </ul>
  9. {if $do == 'category'}
  10. <div class="clearfix">
  11. <form action="{php echo url('article/news/category');}" method="post" class="we7-form" role="form">
  12. <div class="form-group">
  13. <div class="pull-right">
  14. <a href="{php echo url('article/news/category_post');}" class="btn btn-primary">添加分类</a>
  15. </div>
  16. </div>
  17. <table class="table we7-table table-hover">
  18. <col width="100px"/>
  19. <col />
  20. <col width="100px"/>
  21. <tr>
  22. <th>排序</th>
  23. <th>分类名称</th>
  24. <th class='text-right'>操作</th>
  25. </tr>
  26. {loop $data $da}
  27. <input type="hidden" name="ids[]" value="{$da['id']}"/>
  28. <tr>
  29. <td><input type="text" name="displayorder[]" value="{$da['displayorder']}" class="form-control"/></td>
  30. <td><input type="text" name="title[]" value="{$da['title']}" class="form-control"/></td>
  31. <td>
  32. <div class="link-group"><a href="{php echo url('article/news/category_del', array('id' => $da['id']));}" class="del" onclick="if(!confirm('删除分类后,该分类下新闻也会被删除,确定删除吗?')) return false;">删除</a></div>
  33. </td>
  34. </tr>
  35. {/loop}
  36. </table>
  37. <div class="form-group">
  38. <div class="col-sm-8 col-lg-9 col-xs-12">
  39. <input type="submit" class="btn btn-primary" name="submit" value="提交" />
  40. <input type="hidden" name="token" value="{$_W['token']}" />
  41. </div>
  42. </div>
  43. </form>
  44. </div>
  45. {elseif $do == 'category_post'}
  46. <div class="clearfix">
  47. <form action="{php echo url('article/news/category_post');}" method="post" class="form-horizontal" role="form">
  48. <div class="panel panel-default">
  49. <div class="panel-body">
  50. <div id="tpl">
  51. <div class="form-group">
  52. <label class="col-xs-12 col-sm-2 col-md-2 control-label">分类名称</label>
  53. <div class="col-sm-8 col-lg-9 col-xs-12">
  54. <input type="text" class="form-control" name="title[]" vlaue="" placeholder="分类名称"/>
  55. <div class="help-block">请填写分类名称</div>
  56. </div>
  57. </div>
  58. <div class="form-group">
  59. <label class="col-xs-12 col-sm-2 col-md-2 control-label">排序</label>
  60. <div class="col-sm-8 col-lg-9 col-xs-12">
  61. <input type="text" class="form-control" name="displayorder[]" vlaue="" placeholder="排序"/>
  62. <div class="help-block">数字越大,越靠前</div>
  63. </div>
  64. </div>
  65. <hr/>
  66. </div>
  67. <div id="container"></div>
  68. <div class="form-group">
  69. <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label"></label>
  70. <div class="col-sm-8 col-lg-9 col-xs-12">
  71. <a href="javascript:;" id="category-add"><i class="fa fa-plus-circle"></i> 继续添加分类</a>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. <div class="form-group">
  77. <div class="col-sm-8 col-lg-9 col-xs-12">
  78. <input type="submit" class="btn btn-primary" name="submit" value="提交" />
  79. <input type="hidden" name="token" value="{$_W['token']}" />
  80. </div>
  81. </div>
  82. </form>
  83. </div>
  84. {/if}
  85. <script>
  86. $(function(){
  87. $('#category-add').click(function(){
  88. var html = $('#tpl').html();
  89. $('#container').append(html);
  90. return false;
  91. });
  92. });
  93. </script>
  94. {template 'common/footer'}