add.html 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <include file="public@header"/>
  2. <style type="text/css">
  3. .pic-list li {
  4. margin-bottom: 5px;
  5. }
  6. </style>
  7. <script type="text/html" id="photos-item-tpl">
  8. <li id="saved-image{id}">
  9. <input id="photo-{id}" type="hidden" name="photo_urls[]" value="{filepath}">
  10. <input class="form-control" id="photo-{id}-name" type="text" name="photo_names[]" value="{name}"
  11. style="width: 200px;" title="图片名称">
  12. <img id="photo-{id}-preview" src="{url}" style="height:36px;width: 36px;"
  13. onclick="imagePreviewDialog(this.src);">
  14. <a href="javascript:uploadOneImage('图片上传','#photo-{id}');">替换</a>
  15. <a href="javascript:(function(){$('#saved-image{id}').remove();})();">移除</a>
  16. </li>
  17. </script>
  18. <script type="text/html" id="files-item-tpl">
  19. <li id="saved-file{id}">
  20. <input id="file-{id}" type="hidden" name="file_urls[]" value="{filepath}">
  21. <input class="form-control" id="file-{id}-name" type="text" name="file_names[]" value="{name}"
  22. style="width: 200px;" title="文件名称">
  23. <a id="file-{id}-preview" href="{preview_url}" target="_blank">下载</a>
  24. <a href="javascript:uploadOne('文件上传','#file-{id}','file');">替换</a>
  25. <a href="javascript:(function(){$('#saved-file{id}').remove();})();">移除</a>
  26. </li>
  27. </script>
  28. </head>
  29. <body>
  30. <div class="wrap js-check-wrap">
  31. <ul class="nav nav-tabs">
  32. <li><a href="{:url('AdminPage/index')}">所有页面</a></li>
  33. <li class="active"><a href="{:url('AdminPage/add')}">添加页面</a></li>
  34. </ul>
  35. <form action="{:url('AdminPage/addPost')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
  36. <div class="row">
  37. <div class="col-md-9">
  38. <table class="table table-bordered">
  39. <tr>
  40. <th width="100">标题<span class="form-required">*</span></th>
  41. <td>
  42. <input class="form-control" type="text" style="width: 400px;" name="post[post_title]"
  43. required
  44. placeholder="请输入标题"/>
  45. </td>
  46. </tr>
  47. <tr>
  48. <th>关键词</th>
  49. <td>
  50. <input class="form-control" type="text" name="post[post_keywords]" style="width:400px"
  51. placeholder="请输入关键字">
  52. <p class="help-block">多关键词之间用空格隔开</p>
  53. </td>
  54. </tr>
  55. <tr>
  56. <th>摘要</th>
  57. <td><textarea class="form-control" name="post[post_excerpt]" style="height: 50px;"></textarea>
  58. </td>
  59. </tr>
  60. <tr>
  61. <th>内容</th>
  62. <td>
  63. <script type="text/plain" id="content" name="post[post_content]"></script>
  64. </td>
  65. </tr>
  66. <tr>
  67. <th>相册</th>
  68. <td>
  69. <ul id="photos" class="pic-list list-unstyled form-inline"></ul>
  70. <a href="javascript:uploadMultiImage('图片上传','#photos','photos-item-tpl');"
  71. class="btn btn-default btn-sm">选择图片</a>
  72. </td>
  73. </tr>
  74. <tr>
  75. <th>附件</th>
  76. <td>
  77. <ul id="files" class="pic-list list-unstyled form-inline">
  78. </ul>
  79. <a href="javascript:uploadMultiFile('附件上传','#files','files-item-tpl','file');"
  80. class="btn btn-sm btn-default">选择文件</a>
  81. </td>
  82. </tr>
  83. </tbody>
  84. </table>
  85. <div class="form-group">
  86. <div class="col-sm-offset-2 col-sm-10">
  87. <button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button>
  88. <a class="btn btn-default" href="{:url('AdminPage/index')}">{:lang('BACK')}</a>
  89. </div>
  90. </div>
  91. </div>
  92. <div class="col-md-3">
  93. <table class="table table-bordered">
  94. <tr>
  95. <th>缩略图</th>
  96. </tr>
  97. <tr>
  98. <td>
  99. <div style="text-align: center;">
  100. <input type='hidden' name='post[more][thumbnail]' id='thumbnail'>
  101. <a href="javascript:uploadOneImage('图片上传','#thumbnail');">
  102. <img src="__TMPL__/public/assets/images/default-thumbnail.png"
  103. id='thumbnail-preview'
  104. width='135' height='135' style='cursor: hand'/>
  105. </a>
  106. <input type="button" class="btn btn-sm"
  107. onclick="$('#thumbnail-preview').attr('src','__TMPL__/public/assets/images/default-thumbnail.png');$('#thumbnail').val('');return false;"
  108. value="取消图片">
  109. </div>
  110. </td>
  111. </tr>
  112. <tr>
  113. <th>发布时间</th>
  114. </tr>
  115. <tr>
  116. <td><input class="form-control js-bootstrap-datetime" type="text" name="post[published_time]"
  117. value="{:date('Y-m-d H:i',time())}"></td>
  118. </tr>
  119. <tr>
  120. <th>状态</th>
  121. </tr>
  122. <tr>
  123. <td>
  124. <div class="checkbox">
  125. <label><input type="checkbox" name="post[post_status]" value="1" checked>发布</label>
  126. </div>
  127. </td>
  128. </tr>
  129. <tr>
  130. <th>模板</th>
  131. </tr>
  132. <tr>
  133. <td>
  134. <select class="form-control" name="post[more][template]" id="more-template-select">
  135. <option value="">请选择模板</option>
  136. <foreach name="page_theme_files" item="vo">
  137. <php>$value=preg_replace('/^portal\//','',$vo['file']);</php>
  138. <option value="{$value}">{$vo.name} {$vo.file}.html</option>
  139. </foreach>
  140. </select>
  141. </td>
  142. </tr>
  143. </table>
  144. </div>
  145. </div>
  146. </form>
  147. </div>
  148. <script type="text/javascript" src="__STATIC__/js/admin.js"></script>
  149. <script type="text/javascript">
  150. //编辑器路径定义
  151. var editorURL = GV.WEB_ROOT;
  152. </script>
  153. <script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
  154. <script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
  155. <script type="text/javascript">
  156. $(function () {
  157. editorcontent = new baidu.editor.ui.Editor();
  158. editorcontent.render('content');
  159. try {
  160. editorcontent.sync();
  161. } catch (err) {
  162. }
  163. $('#more-template-select').val('page');
  164. });
  165. </script>
  166. </body>
  167. </html>