edit.html 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <include file="public@header" />
  2. <style>
  3. blockquote {
  4. border-left:#eee solid 5px;
  5. padding-left:20px;
  6. }
  7. ul li {
  8. line-height: 20px;
  9. }
  10. code {
  11. color:#D34B62;
  12. background: #F6F6F6;
  13. }
  14. table{width:100%;max-width:100%;margin-bottom:20px}
  15. table>thead>tr>th,table>tbody>tr>th,table>tfoot>tr>th,table>thead>tr>td,table>tbody>tr>td,table>tfoot>tr>td{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}
  16. table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}
  17. </style>
  18. <script>
  19. $(function(){
  20. $("#title").blur(function(){
  21. var zhi = $("#title").val();
  22. $.post('/admin/news/chongfu',{title:zhi},function(data){
  23. if(data=='1'){
  24. alert('标题重复');
  25. }
  26. })
  27. })
  28. })
  29. </script>
  30. </head>
  31. <body>
  32. <div class="wrap">
  33. <ul class="nav nav-tabs">
  34. <li><a href="{:url('News/index')}">资讯列表</a></li>
  35. <li><a href="{:url('News/add')}">添加资讯</a></li>
  36. <li><a href="{:url('News/cateList')}">资讯分类</a></li>
  37. <li><a href="{:url('News/cateAdd')}">添加分类</a></li>
  38. <li class="active"><a href="#">编辑资讯</a></li>
  39. </ul>
  40. <form method="post" class="form-horizontal js-ajax-form margin-top-20" action="{:url('News/editPost')}">
  41. <input type="hidden" name="page" value="{$_SERVER['HTTP_REFERER']}">
  42. <input type="hidden" name="id" value="{$info.id}">
  43. <!-- <input type="hidden" name="page" value="{$page}" /> -->
  44. <div class="form-group">
  45. <label for="title" class="col-sm-2 control-label"><span class="form-required">*</span>资讯分类</label>
  46. <div class="col-md-6 col-sm-10">
  47. <select name="ncatid" id="" class="form-control" style="width:200px;">
  48. <?php foreach($article_cates as $k=>$v){ ?>
  49. <option <?php if($info['ncatid']==$k) echo 'selected'; ?> value="{$k}">{$v}</option>
  50. <?php } ?>
  51. </select>
  52. </div>
  53. </div>
  54. <div class="form-group">
  55. <label for="title" class="col-sm-2 control-label"><span class="form-required">*</span>品牌分类</label>
  56. <div class="col-md-6 col-sm-10">
  57. <select name="catid" id="" class="singleSelect" style="width:200px;">
  58. <?php foreach($cates as $k=>$v){ ?>
  59. <option <?php if($info['catid']==$v['id']) echo 'selected'; ?> value="{$v['id']}" >{$v['catname']}</option>
  60. <?php foreach($v['son'] as $kk=>$vv){ ?>
  61. <option <?php if($info['catid']==$vv['id']) echo 'selected'; ?> value="{$vv['id']}" >{$vv['catname']}</option>
  62. <?php } ?>
  63. <?php } ?>
  64. </select>
  65. </div>
  66. </div>
  67. <div class="form-group">
  68. <label for="title" class="col-sm-2 control-label"><span class="form-required">*</span>标题</label>
  69. <div class="col-md-6 col-sm-10">
  70. <input type="text" class="form-control" id="title" name="title" value="{$info.title}">
  71. </div>
  72. </div>
  73. <div class="form-group">
  74. <label for="title" class="col-sm-2 control-label">关键词</label>
  75. <div class="col-md-6 col-sm-10">
  76. <input type="text" class="form-control" id="keywords" name="keywords" value="{$info.keywords}">
  77. </div>
  78. </div>
  79. <div class="form-group">
  80. <label for="seo_title" class="col-sm-2 control-label"><span class="form-required">*</span>seo标题</label>
  81. <div class="col-md-6 col-sm-10">
  82. <input type="text" class="form-control" id="seo_title" name="seo_title" value="{$info.seo_title}">
  83. </div>
  84. </div>
  85. <!-- <div class="form-group">
  86. <label for="seo_keywords" class="col-sm-2 control-label"><span class="form-required">*</span>seo关键词</label>
  87. <div class="col-md-6 col-sm-10">
  88. <input type="text" class="form-control" id="seo_keywords" name="seo_keywords" value="{$info.seo_keywords}">
  89. </div>
  90. </div> -->
  91. <div class="form-group">
  92. <label for="photo-1" class="col-sm-2 control-label"><span class="form-required">*</span>标题图片</label>
  93. <div class="col-md-6 col-sm-10">
  94. <input id="photo-1" type="hidden" name="thumb" value="{$info.thumb}">
  95. <input id="photo-1-name" type="text" title="图片名称" size="40" value="{$info.thumb}">
  96. <a href="javascript:uploadOneImage('图片上传','#photo-1','case_title/');">上传</a>
  97. <br>
  98. <img id="photo-1-preview" width="200" src="/upload/{$info.thumb}">
  99. </div>
  100. </div>
  101. <div class="form-group">
  102. <label for="seo_description" class="col-sm-2 control-label">资讯描述</label>
  103. <div class="col-md-6 col-sm-10">
  104. <textarea class="form-control" style="height: 76px;" id="description" name="description">{$info.description} </textarea>
  105. </div>
  106. </div>
  107. <div class="form-group">
  108. <label for="title" class="col-2 col-sm-2 control-label"><span class="form-required">*</span>详情</label>
  109. <div class="col-5 col-md-5 col-sm-5" style="width:50%">
  110. <script id="content" name="content" type="text/plain">
  111. {$info.content}
  112. </script>
  113. </div>
  114. </div>
  115. <div class="form-group">
  116. <label for="title" class="col-sm-2 control-label"><span class="form-required">*</span>排序</label>
  117. <div class="col-md-6 col-sm-10">
  118. <input type="text" class="form-control" id="list_order" name="list_order" value="{$info.list_order}">
  119. </div>
  120. </div>
  121. <if condition="$iseditor==0">
  122. <div class="form-group">
  123. <label for="status" class="col-sm-2 control-label"><span class="form-required">*</span>状态</label>
  124. <div class="col-md-6 col-sm-10">
  125. <select name="status" id="status" class="form-control">
  126. <option <if condition="$info.status==1">selected</if> value="1">审核通过</option>
  127. <option <if condition="$info.status==0">selected</if> value="0">未审核</option>
  128. <option <if condition="$info.status==2">selected</if> value="2">审核不通过</option>
  129. </select>
  130. </div>
  131. </div>
  132. </if>
  133. <div class="form-group">
  134. <label for="title" class="col-sm-2 control-label">信息等级</label>
  135. <div class="col-md-6 col-sm-10">
  136. <select class="form-control" name="level">
  137. <option <if condition="$info.level==0"> selected </if> value="0">0无</option>
  138. <option <if condition="$info.level==1"> selected </if> value="1">1首页加盟课堂</option>
  139. <!-- <option <if condition="$info.level==2"> selected </if> value="2">2首页加盟课堂</option> -->
  140. <!-- <option <if condition="$info.level==3"> selected </if> value="3">3首页加盟动态</option>
  141. <option <if condition="$info.level==4"> selected </if> value="4">4首页新闻中心</option>
  142. <option <if condition="$info.level==5"> selected </if> value="5">5首页新闻中心小图</option> -->
  143. </select>
  144. </div>
  145. </div>
  146. <div class="form-group">
  147. <label for="photo-2" class="col-sm-2 control-label">广告位图片</label>
  148. <div class="col-md-6 col-sm-10">
  149. <input id="photo-2" type="hidden" name="guanggaowei" value="{$info.guanggaowei}" >
  150. <input id="photo-2-url" type="text" title="广告位图片" size="40" value="{$info.guanggaowei}">
  151. <a href="javascript:uploadOneImage('图片上传','#photo-2','news/');">上传</a>
  152. <br>
  153. <img id="photo-2-preview" width="200" src="/upload/{$info.guanggaowei}">
  154. </div>
  155. </div>
  156. <div class="form-group">
  157. <label for="title" class="col-sm-2 control-label"><span class="form-required">*</span>排序</label>
  158. <div class="col-md-6 col-sm-10">
  159. <input type="text" class="form-control" id="list_order" name="list_order" value="100">
  160. </div>
  161. </div>
  162. <div class="form-group">
  163. <div class="col-sm-offset-2 col-sm-10">
  164. <if condition="$iseditor==1 && $info.status==1">
  165. <button type="submit" class="btn btn-primary js-ajax-submit" disabled id="tijiao">{:lang('EDIT')}</button>
  166. <else/>
  167. <button type="submit" class="btn btn-primary js-ajax-submit" id="tijiao">{:lang('EDIT')}</button>
  168. </if>
  169. </div>
  170. </div>
  171. </form>
  172. </div>
  173. <link rel="stylesheet" href="__STATIC__/css/select2.min.css">
  174. <script src="__STATIC__/js/admin.js"></script>
  175. <script src="__STATIC__/js/select2.min.js"></script>
  176. <script type="text/javascript">
  177. $(document).ready(function() {
  178. $('.singleSelect').select2();
  179. });
  180. </script>
  181. <script src="__STATIC__/js/admin.js"></script>
  182. <script type="text/javascript" src="__STATIC__/ueditor/ueditor.config.js"></script>
  183. <!-- 编辑器源码文件 -->
  184. <script type="text/javascript" src="__STATIC__/ueditor/ueditor.all.js"></script>
  185. <!-- 实例化编辑器 -->
  186. <script type="text/javascript">
  187. var ue = UE.getEditor('content');
  188. </script>
  189. </body>
  190. </html>