人人商城

news-category.html 3.2KB

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