blletin_up.html 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. <form id="up_blletin_form">
  31. <div class="col-md-8" style="padding-left: 30px;">
  32. <div class="form-group">
  33. <input type="hidden" name="bulletin_id" value="<{$bulletinData.id}>">
  34. <label class="control-label rowlabel">标题</label>
  35. <input name="title" type="text" class="form-control" value="<{$bulletinData.title}>" >
  36. </div>
  37. <div class="form-group">
  38. <label class="control-label rowlabel">内容</label>
  39. <textarea name="content" rows="2" class="form-control" style="width:100%;height: 400px;" id="content"><{$bulletinData.content}></textarea>
  40. </div>
  41. <div>
  42. <a id="up_blletin_btn" href="javascript:;" class="button button-primary button-small">修改公告</a>
  43. </div>
  44. </div>
  45. </form>
  46. <script>
  47. var content_editor;
  48. KISSY.use('node, io, uri', function (S, Node, IO, Uri) {
  49. var $ = S.all;
  50. var Query = Uri.Query;
  51. $("#up_blletin_btn").on('click', function () {
  52. var title = $("input[name=title]").val();
  53. if (!title) {
  54. alert('请填写公告标题');
  55. return false;
  56. }
  57. var content = content_editor.html();
  58. if (!content) {
  59. alert('请填公告内容');
  60. return false;
  61. }
  62. var formData = IO.serialize("#up_blletin_form");
  63. formData = new Query(formData).set('content', content).toString();
  64. new IO({
  65. type: "post"
  66. , url: VG.conf.root_domain + '/?c=Admin_Platform_Bulletin&a=ReqUp'
  67. , data: formData
  68. , success: function (data) {
  69. if (data.ok) { //ok
  70. location.href = '<{$web_cfg.domain}>?c=Admin_Platform_Bulletin&a=PageList';
  71. } else {
  72. alert('操作失败,原因:'+data.msg);
  73. location.href = location.href;
  74. }
  75. return false;
  76. }
  77. , error: function (NULL, textStatus) {
  78. alert("请求服务器失败,原因:"+textStatus);
  79. }
  80. , dataType: "json"
  81. });
  82. });
  83. });
  84. var KCONFIG = {
  85. allowFileManager : true,
  86. uploadJson : VG.conf.root_domain + '/?c=kindeditor&a=updateJson',
  87. fileManagerJson : VG.conf.root_domain + '/?c=kindeditor&a=fileManagerJson',
  88. items : [
  89. 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
  90. 'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
  91. 'insertunorderedlist', '|', 'emoticons', 'image', 'link', 'lineheight']
  92. }
  93. KindEditor.ready(function(K) {
  94. content_editor = K.create('textarea[name=content]', KCONFIG);
  95. });
  96. </script>
  97. <{include file="./admin/bottom.html"}>