blletin_list.html 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <{include file="./admin/header.html"}>
  2. <{include file="./admin/left.html"}>
  3. <{include file="./admin/nav.html"}>
  4. <{include file="get_kindeditor.html"}>
  5. <script type="text/javascript" src="<{$web_cfg.cdn}>/public/static/js/jquery-1.7.2.min.js"></script>
  6. <link rel="stylesheet" href="<{$web_cfg.cdn}>/public/static/js/jquery.minicolors.css" />
  7. <script type="text/javascript" src="<{$web_cfg.cdn}>/public/static/js/jquery.minicolors.js"></script>
  8. <style>
  9. .set-nav {
  10. margin: 0 auto;
  11. }
  12. .set-nav-hr {
  13. background-color: #ddd;
  14. height: 1px;
  15. position: relative;
  16. }
  17. .form-group label {
  18. font-weight: 600;
  19. }
  20. .checkbox-inline, .radio-inline {
  21. font-weight: 400!important;
  22. }
  23. .rowlabel {
  24. font-weight: 300!important;
  25. }
  26. .music_play_hide {
  27. display:none;
  28. }
  29. </style>
  30. <div class="panel panel-default col-md-7">
  31. <div class="panel-body">
  32. <table class="table">
  33. <thead>
  34. <tr>
  35. <th>公告ID</th>
  36. <th>标题</th>
  37. <th>日期</th>
  38. <th>操作</th>
  39. </tr>
  40. </thead>
  41. <tbody>
  42. <{if !$bulletinsData}>
  43. <tr><td colspan="5" align="center">暂无公告</td></tr>
  44. <{/if}>
  45. <{foreach from=$bulletinsData item=item}>
  46. <tr>
  47. <td><{$item.id}></td>
  48. <td><a href="<{$web_cfg.domain}>/?c=Admin_Platform_Bulletin&a=PageShow&bulletin_id=<{$item.id}>"><{$item.title}></a></td>
  49. <td><{$item.update_time|date_format:'%Y-%m-%d'}></td>
  50. <{if $isSuperadmin}>
  51. <td><a href="<{$web_cfg.domain}>/?c=Admin_Platform_Bulletin&a=PageUp&bulletin_id=<{$item.id}>">编辑</a></td>
  52. <td><a href="<{$web_cfg.domain}>/?c=Admin_Platform_Bulletin&a=PageShow&bulletin_id=<{$item.id}>">查看</a></td>
  53. <{else}>
  54. <td><a href="<{$web_cfg.domain}>/?c=Admin_Platform_Bulletin&a=PageShow&bulletin_id=<{$item.id}>">查看</a></td>
  55. <{/if}>
  56. </tr>
  57. <{/foreach}>
  58. </tbody>
  59. </table>
  60. <div class="page"><{$page_html}></div>
  61. </div>
  62. </div>
  63. <{if $isSuperadmin}>
  64. <form id="add_blletin_form">
  65. <div class="col-md-5" style="padding-left: 30px;">
  66. <div class="form-group">
  67. <label class="control-label rowlabel">标题</label>
  68. <input name="title" type="text" class="form-control" >
  69. </div>
  70. <div class="form-group">
  71. <label class="control-label rowlabel">内容</label>
  72. <textarea name="content" rows="2" class="form-control" style="width:100%;height:260px;" id="content"></textarea>
  73. <div class="note">只有管理员有这部分操作权限,其他人没有</div>
  74. </div>
  75. <div>
  76. <a id="add_blletin_btn" href="javascript:;" class="button button-primary button-small">添加新公告</a>
  77. </div>
  78. </div>
  79. </form>
  80. <{/if}>
  81. <script>
  82. var content_editor;
  83. KISSY.use('node, io, uri', function (S, Node, IO, Uri) {
  84. var $ = S.all;
  85. var Query = Uri.Query;
  86. $("#add_blletin_btn").on('click', function () {
  87. var title = $("input[name=title]").val();
  88. if (!title) {
  89. alert('请填写公告标题');
  90. return false;
  91. }
  92. var content = content_editor.html();
  93. if (!content) {
  94. alert('请填公告内容');
  95. return false;
  96. }
  97. var formData = IO.serialize("#add_blletin_form");
  98. formData = new Query(formData).set('content', content).toString();
  99. new IO({
  100. type: "post"
  101. , url: VG.conf.root_domain + '/?c=Admin_Platform_Bulletin&a=ReqCreate'
  102. , data: formData
  103. , success: function (data) {
  104. if (data.ok) { //ok
  105. location.href = location.href;
  106. } else {
  107. alert('操作失败,原因:'+data.msg);
  108. location.href = location.href;
  109. }
  110. return false;
  111. }
  112. , error: function (NULL, textStatus) {
  113. alert("请求服务器失败,原因:"+textStatus);
  114. }
  115. , dataType: "json"
  116. });
  117. });
  118. });
  119. var KCONFIG = {
  120. allowFileManager : true,
  121. uploadJson : VG.conf.root_domain + '/?c=kindeditor&a=updateJson',
  122. fileManagerJson : VG.conf.root_domain + '/?c=kindeditor&a=fileManagerJson',
  123. items : [
  124. 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
  125. 'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
  126. 'insertunorderedlist', '|', 'emoticons', 'image', 'link', 'lineheight']
  127. }
  128. KindEditor.ready(function(K) {
  129. content_editor = K.create('textarea[name=content]', KCONFIG);
  130. });
  131. </script>
  132. <{include file="./admin/bottom.html"}>