notice-category.html 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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/notice/list');}">公告列表</a></li>
  5. <li {if $do == 'category' || $do == 'category_post'}class="active"{/if}><a href="{php echo url('article/notice/category');}">公告分类</a></li>
  6. <!--<li {if $do == 'post' && !$id}class="active"{/if}><a href="{php echo url('article/notice/post');}">添加公告</a></li>
  7. {if $do == 'post' && $id}<li class="active"><a href="{php echo url('article/notice/post');}">编辑公告</a></li>{/if}-->
  8. </ul>
  9. {if $do == 'category'}
  10. <div class="clearfix">
  11. <form action="{php echo url('article/notice/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/notice/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="150px" />
  21. <tr>
  22. <th>排序</th>
  23. <th class="text-left">分类名称</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/notice/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="">
  39. <input type="submit" class="btn btn-primary we7-padding-horizontal" 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/notice/category_post');}" method="post" class="we7-form" role="form">
  48. <div id="tpl">
  49. <div class="form-group">
  50. <label class="col-xs-12 col-sm-2 col-md-2 control-label">分类名称</label>
  51. <div class="col-sm-8 col-lg-9 col-xs-12">
  52. <input type="text" class="form-control" name="title[]" vlaue="" placeholder="分类名称"/>
  53. <div class="help-block">请填写分类名称</div>
  54. </div>
  55. </div>
  56. <div class="form-group">
  57. <label class="col-xs-12 col-sm-2 col-md-2 control-label">排序</label>
  58. <div class="col-sm-8 col-lg-9 col-xs-12">
  59. <input type="text" class="form-control" name="displayorder[]" vlaue="" placeholder="排序"/>
  60. <div class="help-block">数字越大,越靠前</div>
  61. </div>
  62. </div>
  63. <hr/>
  64. </div>
  65. <div id="container"></div>
  66. <div class="form-group">
  67. <label class="col-xs-12 col-sm-2 col-md-2 control-label"></label>
  68. <div class="col-sm-8 col-lg-9 col-xs-12">
  69. <a href="javascript:;" id="category-add"><i class="fa fa-plus-circle"></i> 继续添加分类</a>
  70. </div>
  71. </div>
  72. <div class="form-group">
  73. <div class="col-sm-8 col-lg-9 col-xs-12">
  74. <input type="submit" class="btn btn-primary" name="submit" value="提交" />
  75. <input type="hidden" name="token" value="{$_W['token']}" />
  76. </div>
  77. </div>
  78. </form>
  79. </div>
  80. {/if}
  81. <script>
  82. $(function(){
  83. $('#category-add').click(function(){
  84. var html = $('#tpl').html();
  85. $('#container').append(html);
  86. return false;
  87. });
  88. });
  89. </script>
  90. {template 'common/footer'}