set.html 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. {%include '../inc/header.html'%}
  5. <link rel="stylesheet" type="text/css" href="{{static_url('lib/simditor/styles/simditor.css')}}">
  6. <link rel="stylesheet" type="text/css" href="{{static_url('lib/simditor/plugins/html/simditor-html.css')}}">
  7. </head>
  8. <body>
  9. <div class="x-nav">
  10. <span class="layui-breadcrumb">
  11. {% block breadcrumb %}
  12. <a><cite>首页</cite></a>
  13. <a><cite><script>document.write(parent.config.parentTitle)</script></cite></a>
  14. <a><cite><script>document.write(parent.config.subTitle)</script></cite></a>
  15. {% end %}
  16. </span>
  17. <span id="currentUrl"><script>var cur = parent.config.cur;</script></span>
  18. <a class="layui-btn layui-btn-small" style="margin-top:3px;float:right" href="javascript:window.history.back();" title="返回"><i class="layui-icon">&#xe619;</i></a>
  19. </div>
  20. <div class="x-body">
  21. <div class="layui-tab layui-tab-brief">
  22. <div class="layui-tab-content" >
  23. <div class="layui-tab-item layui-show">
  24. <form class="layui-form layui-form-pane" action="{% block action %}{% end %}" method="post" autocomplete="off" target="f1">
  25. {% module xsrf_form_html() %}
  26. <input type="hidden" name="function" id="function" value="msg"/>
  27. <input type="hidden" name="url" id="url" value="{% block url %}{% end %}" />
  28. <input type="hidden" name="project" id="project" value="ai" />
  29. <input type="hidden" name="table" id="table" value="col" />
  30. <input type="hidden" name="id" id="id" value="{% if data['info'] and 'id' in data['info'] and data['info']['id'] > 0 %}{{data['info']['id']}}{% end %}" />
  31. <iframe id="f1" name="f1" style="display:none;"></iframe>
  32. {% block form %}
  33. <div class="layui-form-item">
  34. <label class="layui-form-label">
  35. <span class='x-red'>*</span>网站名称
  36. </label>
  37. <div class="layui-input-block">
  38. <input type="text" name="title" autocomplete="off" placeholder="控制在25个字、50个字节以内"
  39. class="layui-input">
  40. </div>
  41. </div>
  42. <div class="layui-form-item">
  43. <label class="layui-form-label">
  44. <span class='x-red'>*</span>关键词
  45. </label>
  46. <div class="layui-input-block">
  47. <input type="text" name="title" autocomplete="off" placeholder="5个左右,8汉字以内,用英文,隔开"
  48. class="layui-input">
  49. </div>
  50. </div>
  51. <div class="layui-form-item">
  52. <label class="layui-form-label">
  53. <span class='x-red'>*</span>描述
  54. </label>
  55. <div class="layui-input-block">
  56. <input type="text" name="title" autocomplete="off" placeholder="空制在80个汉字,160个字符以内"
  57. class="layui-input">
  58. </div>
  59. </div>
  60. <div class="layui-form-item">
  61. <label class="layui-form-label">
  62. <span class='x-red'>*</span>css、js、images路径配置
  63. </label>
  64. <div class="layui-input-block">
  65. <input type="text" name="title" autocomplete="off" placeholder="默认为空,为相对路径"
  66. class="layui-input">
  67. </div>
  68. </div>
  69. <div class="layui-form-item">
  70. <label class="layui-form-label">
  71. <span class='x-red'>*</span>上传目录配置
  72. </label>
  73. <div class="layui-input-block">
  74. <input type="text" name="title" autocomplete="off" placeholder="默认为uploadfile"
  75. class="layui-input">
  76. </div>
  77. </div>
  78. <div class="layui-form-item">
  79. <label class="layui-form-label">
  80. <span class='x-red'>*</span>底部版权信息
  81. </label>
  82. <div class="layui-input-block">
  83. <input type="text" name="title" autocomplete="off" placeholder="&copy; 2016 X-admin"
  84. class="layui-input">
  85. </div>
  86. </div>
  87. <div class="layui-form-item">
  88. <label class="layui-form-label">
  89. <span class='x-red'>*</span>备案号
  90. </label>
  91. <div class="layui-input-block">
  92. <input type="text" name="title" autocomplete="off" placeholder="京ICP备00000000号"
  93. class="layui-input">
  94. </div>
  95. </div>
  96. <div class="layui-form-item layui-form-text">
  97. <label class="layui-form-label">
  98. <span class='x-red'>*</span>统计代码
  99. </label>
  100. <div class="layui-input-block">
  101. <textarea placeholder="请输入内容" class="layui-textarea"></textarea>
  102. </div>
  103. </div>
  104. {% end %}
  105. <div class="layui-form-item">
  106. <button class="layui-btn" lay-submit lay-filter="update">
  107. 保存
  108. </button>
  109. </div>
  110. </form>
  111. <div style="height:100px;"></div>
  112. </div>
  113. </div>
  114. </div>
  115. </div>
  116. {%include '../inc/footer.html'%}
  117. {%include '../inc/script.html'%}
  118. <!-- 加载文本编辑器 -->
  119. <script type="text/javascript" src="{{static_url('lib/simditor/scripts/module.min.js')}}"></script>
  120. <script type="text/javascript" src="{{static_url('lib/simditor/scripts/hotkeys.min.js')}}"></script>
  121. <script type="text/javascript" src="{{static_url('lib/simditor/scripts/uploader.min.js')}}"></script>
  122. <script type="text/javascript" src="{{static_url('lib/simditor/scripts/simditor.min.js')}}"></script>
  123. <script type="text/javascript" src="{{static_url('lib/simditor/plugins/html/beautify-html.js')}}"></script>
  124. <script type="text/javascript" src="{{static_url('lib/simditor/plugins/html/simditor-html.js')}}"></script>
  125. <script type="text/javascript" src="{{static_url('lib/simditor/plugins/dropzone/simditor-dropzone.js')}}"></script>
  126. <script>
  127. layui.use(['laydate', 'form','layer','layedit','upload'], function(){
  128. $ = layui.jquery;
  129. var form = layui.form()
  130. var layer = layui.layer
  131. var layedit = layui.layedit;
  132. if ($('.time').length) {
  133. laydate = layui.laydate;//日期插件
  134. var date = {
  135. //min: laydate.now()
  136. max: '2099-06-16 23:59:59'
  137. ,format: 'YYYY-MM-DD hh:mm:ss'
  138. ,istoday: true
  139. ,istime: true
  140. };
  141. $('.time').each(function()
  142. {
  143. $(this).click(function()
  144. {
  145. date.elem = this;
  146. laydate(date);
  147. })
  148. })
  149. }
  150. var xsrf = getCookie("_xsrf");
  151. var uploadUrl = '/upload?_xsrf='+xsrf;
  152. initEditor();
  153. /*
  154. layedit.set({
  155. uploadImage: {
  156. url: uploadUrl
  157. ,type: 'post'
  158. }
  159. });
  160. if ($('.layui-editor').length) {
  161. $('.layui-editor').each(function()
  162. {
  163. id = $(this).attr('id');
  164. var index = layedit.build(id);
  165. layedit.sync(index)
  166. });
  167. }
  168. */
  169. layui.upload({
  170. url: uploadUrl
  171. ,success: function(res, input){ //上传成功后的回调
  172. var id = $(input).attr('id').replace('upload_', '');
  173. $('#upload_' + id + '_show').attr('src',res.data.src + '?v' + Date.parse(new Date())).show();
  174. $('#update_' + id).val(res.data.src);
  175. }
  176. });
  177. {% block script %}
  178. {% end %}
  179. form.on('submit(update)');
  180. });
  181. </script>
  182. </body>
  183. </html>