category-post.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. {template 'common/header'}
  2. <ol class="breadcrumb we7-breadcrumb">
  3. <a href="{php echo url('site/category')}"><i class="wi wi-back-circle"></i> </a>
  4. <li><a href="{php echo url('site/category')}">文章分类管理</a></li>
  5. <li>
  6. {if empty($id)}<a href="{php echo url('site/category/post')}">分类添加</a>{/if}
  7. {if !empty($id)}<a href="{php echo url('site/category/post', array('id' => $id))}">分类编辑</a>{/if}
  8. </li>
  9. </ol>
  10. <form action="./index.php?c=site&a=category&do=post" method="post" class="article-post">
  11. <input type="hidden" name="parentid" value="{$parent['id']}" />
  12. <input type="hidden" name="id" value="{$id}" />
  13. <div class="we7-form" id="js-wesite-category-post" ng-controller="WesiteCategoryPost" ng-cloak>
  14. <div class="form-group" ng-if="category.name">
  15. <label class="control-label col-sm-2">访问地址</label>
  16. <div class="form-controls col-sm-8">
  17. <div class="form-control-static"><a href="{$_W['siteroot']}/app/index.php?c=site&a=site&cid={$category['id']}&i={$_W['uniacid']}" target="_blank">/app/index.php?c=site&a=site&cid={{category.id}}&i={$_W['uniacid']}</a></div>
  18. <span class="help-block">您可以根据此地址,添加回复规则,设置访问。</span>
  19. </div>
  20. </div>
  21. <div class="form-group" ng-if="parentid">
  22. <label class="control-label col-sm-2">上级分类</label>
  23. <div class="form-controls col-sm-8">
  24. <div class="form-control-static" ng-bind="parent.name"></div>
  25. </div>
  26. </div>
  27. <div class="form-group">
  28. <label for="" class="control-label col-sm-2">排序</label>
  29. <div class="form-controls col-sm-8">
  30. <input type="text" name="displayorder" class="form-control" ng-model="category.displayorder" ng-style="{'width' : '680px'}">
  31. <span class="help-block">分类的显示顺序,越大则越靠前 </span>
  32. </div>
  33. </div>
  34. <div class="form-group">
  35. <label for="" class="control-label col-sm-2">分类名称</label>
  36. <div class="form-controls col-sm-8">
  37. <input type="text" name="cname" class="form-control" ng-model="category.name" ng-style="{'width' : '680px'}">
  38. </div>
  39. </div>
  40. <div class="form-group">
  41. <label for="" class="control-label col-sm-2">分类描述</label>
  42. <div class="form-controls col-sm-8">
  43. <textarea name="description" class="form-control" rows="5" ng-bind="category.description" ng-style="{'width' : '680px'}"></textarea>
  44. </div>
  45. </div>
  46. <div class="form-group">
  47. <label for="" class="control-label col-sm-2">是否启用</label>
  48. <div class="form-controls col-sm-8">
  49. <input id='enabled1' type="radio" name='enabled' value="1" ng-model="category.enabled" ng-checked="enabled"/>
  50. <label for="enabled1">是</label>
  51. <input id='enabled2' type="radio" name='enabled' value="0" ng-model="category.enabled" ng-checked="!enabled"/>
  52. <label for="enabled2">否</label>
  53. <span class="help-block"></span>
  54. </div>
  55. </div>
  56. <div class="form-group">
  57. <label for="" class="control-label col-sm-2">是否添加微站首页导航</label>
  58. <div class="form-controls col-sm-8">
  59. <input id='isnav_1' type="radio" name='isnav' value="1" ng-model="category.nid" ng-checked="category.nid != 0" ng-click="showWesite()"/>
  60. <label for="isnav_1">是</label>
  61. <input id='isnav_2' type="radio" name='isnav' value="0" ng-model="category.nid" ng-checked="category.nid == 0" ng-click="hideWesite()"/>
  62. <label for="isnav_2">否</label>
  63. <span class="help-block">开启此选项后,系统在微站首页导航自动生成以分类名称为导航名称的记录.关闭此选项后,系统将删除对应的导航记录</span>
  64. </div>
  65. </div>
  66. <div class="form-group form-inline js-site-selector" ng-style="{'display' : category.nid == 0 ? 'none' : ''}">
  67. <label class="control-label col-sm-2">分配到微站</label>
  68. <div class="form-controls col-sm-8">
  69. <select class="we7-select" name="multiid">
  70. {loop $multis $multi}
  71. <option value="{$multi['id']}" {if $category['nav']['multiid'] == $multi['id'] || $_GPC['mtid'] == $multi['id']}selected{/if}>{$multi['title']}{if $multi['id'] == $default_site}[默认微站]{/if}</option>
  72. {/loop}
  73. </select>
  74. </div>
  75. </div>
  76. <div class="form-group">
  77. <label for="" class="control-label col-sm-2">是否作为首页使用</label>
  78. <div class="form-controls col-sm-8">
  79. <input id='ishomepage-1' type="radio" name='ishomepage' value="1" ng-model="category.ishomepage" ng-checked="category.ishomepage != 0" />
  80. <label for="ishomepage-1">是</label>
  81. <input id='ishomepage-2' type="radio" name='ishomepage' value="0" ng-model="category.ishomepage" ng-checked="category.ishomepage == 0"/>
  82. <label for="ishomepage-2">否</label>
  83. <span class="help-block">注意:该选项仅对父级分类有效。开启此选项后,分类模板将直接引用首页模板(home.html[注:该文件在home文件夹下面]]),分类的二级分类将作为导航显示</span>
  84. <span class="help-block " style="color:red" ng-if="site_template.sections > 0">当前默认微站对应的模板有导航位置限制。如果您希望将该导航链接作为"首页使用"使用,请选择其他分类风格</span>
  85. </div>
  86. </div>
  87. <div class="form-group">
  88. <label for="" class="control-label col-sm-2">分类风格</label>
  89. <div class="form-controls col-sm-8">
  90. <p class="form-control-static" id="current-title" ng-bind="category.style.name"></p>
  91. <div class="we7-input-img input-more active">
  92. <img src="{$_W['siteroot']}app/themes/{{category.style.tname}}/preview.jpg" id="current-preview" class="img-rounded">
  93. <div class="cover-dark">
  94. <a href="javascript:;" class="cut" data-toggle="modal" data-target="#ListStyle">更换</a>
  95. </div>
  96. </div>
  97. <input type="text" name="styleid" id="styleid" ng-model="category.styleid" ng-style="{'display' : 'none'}"/>
  98. <div class="help-block">
  99. 新建分类风格时,请在您选择的风格对应的模板目录下新建“site”文件夹,默认的列表页面为list.html,默认的内容页面为detail.html。
  100. </div>
  101. </div>
  102. </div>
  103. <!-- 风格列表 -->
  104. <div class="modal fade" id="ListStyle" aria-hidden="false" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  105. <div class="modal-dialog modal-lg">
  106. <div class="modal-content">
  107. <div class="modal-header">
  108. <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
  109. <h4 class="modal-title">微站模板风格列表</h4>
  110. </div>
  111. <div class="modal-body template clearfix overflow-auto">
  112. <div class="item item-style" ng-class="{'active': style.id == category.styleid}" ng-repeat="style in styles" ng-style="{'width': '20%', 'height': '290px', 'padding': '10px 10px', 'float': 'left'}">
  113. <div class="title">
  114. <div class="title-{{style.id}}" style="overflow:hidden; height:40px;">{{style.name}} ({{style.tname}})</div>
  115. <a href="javascript:;" ng-click="changeStyle(style.id)">
  116. <img src="../app/themes/{{style.tname}}/preview.jpg" class="img-rounded img-responsive preview-{{style.id}}" ng-style="{'height': '225px'}">
  117. </a>
  118. </div>
  119. <div class="btn-group btn-group-justified">
  120. <a href="javascript:;" class="btn btn-default btn-xs" ng-click="changeStyle(style.id)">选择风格</a>
  121. </div>
  122. </div>
  123. </div>
  124. <div class="modal-footer">
  125. <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
  126. </div>
  127. </div>
  128. </div>
  129. </div>
  130. <div class="form-group">
  131. <label for="" class="control-label col-sm-2">直接链接</label>
  132. <div class="form-controls col-sm-8">
  133. <input type="text" class="form-control" name="linkurl" ng-model="category.linkurl" ng-style="{'width' : '680px'}">
  134. <span class="help-block">链接必须是以http://或是https://开头。没有直接链接,请留空 </span>
  135. </div>
  136. </div>
  137. <div class="penel we7-panel">
  138. <div class="panel-heading">
  139. 导航样式
  140. </div>
  141. <div class="panel-body we7-margin">
  142. <div class="we7-form">
  143. <div class="form-group">
  144. <label for="" class="control-label col-sm-2">图标类型</label>
  145. <div class="form-controls col-sm-8">
  146. <input id='icontype-1' type="radio" name='icontype' value="1" ng-model="category.icontype" ng-checked='icontype' />
  147. <label for="icontype-1">系统内置</label>
  148. <input id='icontype-2' type="radio" name='icontype' value="2" ng-model="category.icontype" ng-checked="category.icontype == 2"/>
  149. <label for="icontype-2">自定义上传</label>
  150. </div>
  151. </div>
  152. <div class="form-group" ng-if="category.icontype != 2">
  153. <label for="" class="control-label col-sm-2">系统图标</label>
  154. <div class="form-controls col-sm-8" >
  155. <div class="input-group">
  156. <input type="text" name='icon[icon]' class="form-control" ng-model="category.css.icon.icon"/>
  157. <span class="input-group-addon" style="width:35px; border-left:none" ng-style="{'background-color' : colorValue}"><i class="{{category.css.icon.icon}}" ng-init="category.css.icon.icon = category.css.icon.icon ? category.css.icon.icon : 'fa fa-external-link'"></i></span>
  158. <span class="input-group-btn" ng-click="selectIcon()"> <a href="" class="btn btn-default">&nbsp;选择图标</a></span>
  159. </div>
  160. </div>
  161. </div>
  162. <div class="form-group" ng-if="category.icontype != 2">
  163. <label for="" class="control-label col-sm-2">图标颜色</label>
  164. <div class="form-controls col-sm-8 input-group">
  165. <input type="text" class="form-control" name="icon[color]" ng-model="category.css.icon.color" ng-style="{'display' : 'none'}">
  166. <div we7-colorpicker we7-my-color="category.css.icon.color" we7-my-default-color="'#2B2D30'"></div>
  167. </div>
  168. </div>
  169. <div class="form-group" ng-if="category.icontype != 2">
  170. <label for="" class="control-label col-sm-2">图标大小</label>
  171. <div class="form-controls col-sm-8" >
  172. <div class="input-group col-sm-2">
  173. <input class="form-control" type="text" name="icon[size]" ng-model="category.css.icon.width" ng-init="category.css.icon.width = category.css.icon.width ? category.css.icon.width : 35">
  174. <span class="input-group-addon">PX</span>
  175. </div>
  176. <span class="help-block">图标的尺寸大小,单位为像素,上传图标时此设置项无效</span>
  177. </div>
  178. </div>
  179. <div class="form-group" ng-if="category.icontype == 2">
  180. <label for="" class="control-label col-sm-2">上传图标</label>
  181. <div class="form-controls col-sm-8">
  182. <div class="we7-input-img input-more input-img" ng-class="{'active': category.icon}">
  183. <img src="{{category.icon}}" ng-if="category.icon">
  184. <a href="javascript:;" class="input-addon" ng-click="uploadImage()" ng-hide="category.icon"><span>+</span></a>
  185. <input type="text" name="iconfile" ng-model="category.icon" ng-style="{'display' : 'none'}">
  186. <div class="cover-dark">
  187. <a href="" class="cut" ng-click="uploadImage()">更换</a>
  188. <a href="" class="del" ng-click="delImage()"><i class="fa fa-times text-danger"></i></a>
  189. </div>
  190. </div>
  191. <span class="help-block">自定义上传图标图片,“系统图标”优先于此项</span>
  192. </div>
  193. </div>
  194. </div>
  195. </div>
  196. </div>
  197. <input type="hidden" name="token" value="{$_W['token']}" />
  198. <input name="submit" value="发布" class="btn btn-primary btn-submit" type="submit">
  199. </div>
  200. </form>
  201. <script>
  202. angular.module('wesiteApp').value('config', {
  203. id: {php echo !empty($id) ? json_encode($id) : 'null'},
  204. category: {php echo !empty($category) ? json_encode($category) : 'null'},
  205. parentid: {php echo !empty($parentid) ? json_encode($parentid) : 'null'},
  206. parent: {php echo !empty($parent) ? json_encode($parent) : 'null'},
  207. multis: {php echo !empty($multis) ? json_encode($multis) : 'null'},
  208. site_template: {php echo !empty($site_template) ? json_encode($site_template) : 'null'},
  209. styles: {php echo !empty($styles) ? json_encode($styles) : 'null'}
  210. });
  211. angular.bootstrap($('#js-wesite-category-post'), ['wesiteApp']);
  212. </script>
  213. {template 'common/footer'}