add_edit_article.html 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. <{include file="./admin/header.html"}>
  2. <{include file="get_kindeditor.html"}>
  3. <style>
  4. <!--
  5. .container, .container5 {
  6. width:780px;
  7. margin: 0 auto;
  8. padding-top: 20px;
  9. padding-left:20px;
  10. padding-right:20px;
  11. }
  12. .containerBox {
  13. border-radius: 5px;
  14. box-shadow: 0 2px 2px rgba(0,0,0,0.1);
  15. moz-border-radius: 5px;
  16. moz-box-shadow: 0 2px 2px rgba(0,0,0,0.1);
  17. padding: 14px 22px 20px 20px;
  18. webkit-border-radius: 5px;
  19. webkit-box-shadow: 0 2px 2px rgba(0,0,0,0.1);
  20. background-color: #f8f8f8;
  21. border: 1px solid #b8b8b8;
  22. padding:15px 20px 20px 20px;
  23. margin-top:10px;
  24. }
  25. input[type="text"] {
  26. background-color: #fff;
  27. border: 1px solid #d3d3d3;
  28. color: #666;
  29. max-width: 480px;
  30. padding: 2px 8px;
  31. width: 480px;
  32. display: inline-block;
  33. }
  34. .fileUpload {
  35. display:none!important;
  36. }
  37. .container .block, .container5 .block {
  38. cursor: default;
  39. padding-bottom: 4px;
  40. padding-top: 10px;
  41. display: block;
  42. font-size: 14px;
  43. }
  44. .upload-tip {
  45. color: #666;
  46. font-size: 12px;
  47. margin-top: 2px;
  48. float: right;
  49. cursor: default;
  50. line-height: 1.5;
  51. }
  52. .desctextarea{
  53. width: 480px;
  54. height: 50px;
  55. outline: 0;
  56. overflow: auto;
  57. vertical-align: top;
  58. padding: 2px 8px;
  59. background-color: #fff;
  60. border: 1px solid #d3d3d3;
  61. }
  62. .sub-add-btn {
  63. line-height: 30px;
  64. color: red;
  65. border: 2px dotted #b8b8b8;
  66. border-radius: 3px;
  67. -webkit-border-radius: 3px;
  68. -moz-border-radius: 3px;
  69. display: block;
  70. margin-top: 10px;
  71. text-align: center;
  72. background-color: #f8f8f8;
  73. }
  74. a:visited, a:link {
  75. text-decoration: none;
  76. }
  77. a:hover {
  78. text-decoration: underline;
  79. }
  80. .msg-btn {
  81. padding: 12px 0 20px;
  82. text-align: center;
  83. font-size: 14px;
  84. }
  85. a.btnGreen:link {
  86. text-decoration: none;
  87. margin: 0 20px;
  88. text-align: center;
  89. overflow: visible;
  90. border-radius: 3px;
  91. -moz-border-radius: 3px;
  92. -webkit-border-radius: 3px;
  93. border: 1px solid #3d810c;
  94. padding: 5px 20px;
  95. cursor: pointer;
  96. display: inline-block;
  97. text-align: center;
  98. overflow: visible;
  99. border-radius: 3px;
  100. -moz-border-radius: 3px;
  101. -webkit-border-radius: 3px;
  102. color: #fff;
  103. border: 1px solid #3d810c;
  104. background-color: #5aaa4b;
  105. background-image: -moz-linear-gradient(top,#60b452 0,#56a447 100%);
  106. background-image: -webkit-gradient(linear,0 0,0 100%,from(#60b452),to(#56a447));
  107. background-image: -webkit-linear-gradient(top,#60b452 0,#56a447 100%);
  108. background-image: -o-linear-gradient(top,#60b452 0,#56a447 100%);
  109. background-image: linear-gradient(to bottom,#60b452 0,#56a447 100%);
  110. }
  111. a.btnGreen:hover {
  112. background-color: #53a046;
  113. background-image: -moz-linear-gradient(top,#5aab4d 0,#4f9841 100%);
  114. background-image: -webkit-gradient(linear,0 0,0 100%,from(#5aab4d),to(#4f9841));
  115. background-image: -webkit-linear-gradient(top,#5aab4d 0,#4f9841 100%);
  116. background-image: -o-linear-gradient(top,#5aab4d 0,#4f9841 100%);
  117. background-image: linear-gradient(to bottom,#5aab4d 0,#4f9841 100%);
  118. color: #fff;
  119. color: #fff;
  120. box-shadow: 0 1px 1px #aaa;
  121. -moz-box-shadow: 0 1px 1px #aaa;
  122. -webkit-box-shadow: 0 1px 1px #aaa;
  123. }
  124. .imgPreview {
  125. display:none;
  126. }
  127. .b {width:320px; height:160px;}
  128. .s {width:100px; height:100px;}
  129. .ke-container {
  130. width:100%!important;
  131. }
  132. textarea[name="content"] {
  133. height:320px;
  134. }
  135. -->
  136. </style>
  137. <script type="text/javascript">
  138. $(document).ready(function(){
  139. $('#preview').click(function(){
  140. $("form").target = '';
  141. $("form").action = '';
  142. $("form").submit();
  143. });
  144. $('#save').click(function(){
  145. $("form").target = '';
  146. $("form").action = '';
  147. $("form").submit();
  148. });
  149. $("#start_time").live("click", function(){
  150. $("#start_time").val('');
  151. showCalendar('start_time', 'y-mm-dd');
  152. });
  153. $("#end_time").live("click", function(){
  154. $("#end_time").val('');
  155. showCalendar('end_time', 'y-mm-dd');
  156. });
  157. var ROOT_DOMAIN = '<{$web_cfg.domain}>';
  158. KindEditor.ready(function(K) {
  159. var editor = K.create('textarea[name=content]', {
  160. allowFileManager : true,
  161. uploadJson : ROOT_DOMAIN + '/?c=kindeditor&a=updateJson',
  162. fileManagerJson : ROOT_DOMAIN + '/?c=kindeditor&a=fileManagerJson'
  163. });
  164. });
  165. $("input[type=radio]").click(function () {
  166. var type_id = $(this).attr("id");
  167. if (type_id == 'type_TYPE_TRY') {
  168. var html = $("#hiddenDIv").html();
  169. $(".ordinary").html(html);
  170. } else {
  171. $(".ordinary").html("");
  172. }
  173. });
  174. $("input[type=submit]").click(function () {
  175. var title = $.trim($("#title").val());
  176. if (title == '') {
  177. alert('请填写文章标题');
  178. return false;
  179. }
  180. if (!confirm("确认<{if $article}>修改<{else}>创建<{/if}>?")) {
  181. return false;
  182. }
  183. });
  184. });
  185. </script>
  186. <{include file="./admin/nav.html"}>
  187. <div class="container">
  188. <form method="post" action="<{$web_cfg.domain}>">
  189. <input name="c" type="hidden" value="admin_articles" />
  190. <{if $article}>
  191. <input name="a" type="hidden" value="edit" />
  192. <input name="id" type="hidden" value="<{$article.id}>" />
  193. <input name="cas_token" type="hidden" value="<{$article.cas_token}>" />
  194. <{else}>
  195. <input name="a" type="hidden" value="add" />
  196. <{/if}>
  197. <div class="containerBox">
  198. <{if $article.friendlyUrl}>
  199. <label class="block"><span class="upload-tip"></span>文章链接地址</label>
  200. <a href="<{$web_cfg.domain}>/article/<{$article.friendlyUrl}>" target="_blank"><{$web_cfg.domain}>/article/<{$article.friendlyUrl}></a>
  201. <{/if}>
  202. <label class="block">标题</label>
  203. <input type="text" name="title" id="title" value="<{$article.title}>"/>
  204. <label class="block">作者</label>
  205. <input type="text" name="author" id="author" value="<{$article.author}>"/>
  206. <label class="block">内容</label>
  207. <textarea name="content"><{$article.content}></textarea>
  208. </div>
  209. <div class="msg-btn">
  210. <input type="submit" class="btn btn-success" value="<{if $article}>修改<{else}>创建<{/if}>">
  211. </div>
  212. </form>
  213. </div>
  214. </body>
  215. </html>