tpl-post.html 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. {template 'common/header'}
  2. <ol class="breadcrumb we7-breadcrumb">
  3. <a href="{php echo url('site/style')}"><i class="wi wi-back-circle"></i> </a>
  4. <li><a href="{php echo url('site/style')}">微官网模板</a></li>
  5. <li><a href="#">设计风格</a></li>
  6. </ol>
  7. <form action="" method="post" class="article-post">
  8. <input type="hidden" name="styleid" value="{$styleid}">
  9. <div class="we7-form" id="js-wesite-tpl-post" ng-controller="WesiteTplPost" ng-cloak>
  10. <div class="form-group">
  11. <label for="" class="control-label col-sm-2">风格名称</label>
  12. <div class="form-controls col-sm-8">
  13. <input type="text" class="form-control" name="name" ng-model="style.name">
  14. <span class="help-block"></span>
  15. </div>
  16. </div>
  17. <div class="form-group">
  18. <label for="" class="control-label col-sm-2">模板路径</label>
  19. <div class="form-controls col-sm-8">
  20. <input type="text" name="cname" class="form-control" disabled value="./app/themes/{{template.name}}">
  21. <span class="help-block"> </span>
  22. </div>
  23. </div>
  24. <div class="form-group">
  25. <label for="" class="control-label col-sm-2">基础图片目录[imgdir]</label>
  26. <div class="form-controls col-sm-8">
  27. <input type="text" class="form-control" name="style[imgdir]" ng-model="styles.imgdir.content">
  28. <span class="help-block">风格基础图片存放的目录,如果为空则默认为./app/themes/default/images目录 </span>
  29. </div>
  30. </div>
  31. <div class="form-group">
  32. <label for="" class="control-label col-sm-2">首页背景 [indexbgcolor]</label>
  33. <div class="form-controls col-sm-8 input-group">
  34. {php echo tpl_form_field_color('style[indexbgcolor]', $styles['indexbgcolor']['content'])}
  35. <span class="help-block">首页背景 [indexbgcolor]</span>
  36. </div>
  37. </div>
  38. <div class="form-group">
  39. <label for="" class="control-label col-sm-2"></label>
  40. <div class="form-controls col-sm-8">
  41. <input class="form-control" type="text" name="style[indexbgextra]" ng-model="styles.indexbgextra.content">
  42. <span class="help-block">附加属性 [indexbgextra]</span>
  43. </div>
  44. </div>
  45. <div class="form-group">
  46. <label for="" class="control-label col-sm-2"></label>
  47. <div class="form-controls col-sm-8">
  48. <div class="we7-input-img input-more" ng-class="{'active': styles.indexbgimg.content}">
  49. <img ng-src="{{styles.indexbgimg.content}}" ng-if="styles.indexbgimg.content">
  50. <a href="javascript:;" class="input-addon" ng-click="uploadImage()" ng-hide="styles.indexbgimg.content"><span>+</span></a>
  51. <input type="text" name="style[indexbgimg]" ng-model="styles.indexbgimg.content" ng-style="{'display' : 'none'}">
  52. <div class="cover-dark">
  53. <a href="javascript:;" class="cut" ng-click="uploadImage()">更换</a>
  54. <a href="javascript:;" class="del" ng-click="delImage()"><i class="fa fa-times text-danger"></i></a>
  55. </div>
  56. </div>
  57. <span class="help-block">背景图 [indexbgimg]</span>
  58. </div>
  59. </div>
  60. <div class="form-group">
  61. <label for="" class="control-label col-sm-2">正常字体[fontfamily]</label>
  62. <div class="form-controls col-sm-8">
  63. <input type="text" class="form-control" name="style[fontfamily]" ng-model="styles.fontfamily.content">
  64. <span class="help-block">正常字体[fontfamily]</span>
  65. </div>
  66. </div>
  67. <div class="form-group">
  68. <label for="" class="control-label col-sm-2">正常字体大小[fontsize]</label>
  69. <div class="form-controls col-sm-8">
  70. <input type="text" class="form-control" name="style[fontsize]" ng-model="styles.fontsize.content">
  71. <span class="form-control-addon">PX</span>
  72. <span class="help-block">正常字体大小[fontsize]</span>
  73. </div>
  74. </div>
  75. <div class="form-group">
  76. <label for="" class="control-label col-sm-2">普通文本颜色[fontcolor]</label>
  77. <div class="form-controls col-sm-8 input-group">
  78. {php echo tpl_form_field_color('style[fontcolor]', $styles['fontcolor']['content'])}
  79. <span class="help-block">普通文本颜色[fontcolor]</span>
  80. </div>
  81. </div>
  82. <div class="form-group">
  83. <label for="" class="control-label col-sm-2">菜单文本颜色[fontnavcolor]</label>
  84. <div class="form-controls col-sm-8 input-group">
  85. {php echo tpl_form_field_color('style[fontnavcolor]', $styles['fontnavcolor']['content'])}
  86. <span class="help-block">菜单文本颜色[fontnavcolor]</span>
  87. </div>
  88. </div>
  89. <div class="form-group">
  90. <label for="" class="control-label col-sm-2">链接文字颜色[linkcolor]</label>
  91. <div class="form-controls col-sm-8 input-group">
  92. {php echo tpl_form_field_color('style[linkcolor]', $styles['linkcolor']['content'])}
  93. <span class="help-block">链接文字颜色[linkcolor]</span>
  94. </div>
  95. </div>
  96. <div class="form-group">
  97. <label for="" class="control-label col-sm-2">扩展CSS</label>
  98. <div class="form-controls col-sm-8">
  99. <textarea name="style[css]" class="form-control" cols="110" rows="6" ng-bind="styles.css.content"></textarea>
  100. </div>
  101. </div>
  102. <div class="penel we7-panel">
  103. <div class="panel-heading">
  104. 自定义属性
  105. </div>
  106. <div class="panel-body we7-margin">
  107. <div class="we7-form" id="customForm">
  108. <div class="alert alert-danger">
  109. (说明:变量名用于设置不同的变量,只能是字母数字组成。变量描述可方便用户识别对应变量的作用,不能为空)<br>
  110. (注意:这里定义的变量,变量值不能为空,且最大长度为20,否则将视为无效)
  111. </div>
  112. <div class="form-inline we7-margin-bottom" ng-repeat="styleinfo in customStyles">
  113. <div class="input-group" >
  114. <span class="input-group-addon">变量名</span>
  115. <input class="form-control" name="custom[name][]" ng-model="styleinfo.variable" type="text" placeholder="请输入配置变量" pattern="[a-zA-Z0-9-_]{1,20}">
  116. </div>
  117. <div class="input-group" >
  118. <span class="input-group-addon">变量描述</span>
  119. <input class="form-control" name="custom[desc][]" ng-model="styleinfo.description" type="text" placeholder="请输入变量描述" pattern=".{1,20}">
  120. </div>
  121. <div class="input-group" >
  122. <span class="input-group-addon">值</span>
  123. <input class="form-control" name="custom[value][]" ng-model="styleinfo.content" type="text" placeholder="请输入配置值" pattern=".{1,20}">
  124. </div>
  125. <label class="checkbox-inline color-default">
  126. <a href="javascript:;" ng-click="delCustomArrtibute($event)" class="fa fa-times-circle" title="删除此操作"></a>
  127. </label>
  128. </div>
  129. </div>
  130. <a href="javascript:;" class="color-default" ng-click="addCustomAttribute()"><i class="fa fa-plus-square"></i>添加新变量</a>
  131. </div>
  132. </div>
  133. <input name="token" type="hidden" value="{$_W['token']}" />
  134. <div class="btn btn-primary btn-submit" ng-click="checkSubmit($event)">提交</div>
  135. <input name="submit" value="提交" type="submit" id="submit-post" ng-style="{'display' : 'none'}">
  136. </div>
  137. </form>
  138. <script type="text/html" id="item-form-html">
  139. <div class="form-inline we7-margin-bottom">
  140. <div class="input-group" >
  141. <span class="input-group-addon">变量名</span>
  142. <input class="form-control" name="custom[name][]" value="{$style['variable']}" type="text" placeholder="请输入配置变量" pattern="[0-9A-Za-z-_]{1,20}">
  143. </div>
  144. <div class="input-group" >
  145. <span class="input-group-addon">变量描述</span>
  146. <input class="form-control" name="custom[desc][]" value="{$style['description']}" type="text" placeholder="请输入变量描述" pattern=".{1,20}">
  147. </div>
  148. <div class="input-group" >
  149. <span class="input-group-addon">值</span>
  150. <input class="form-control" name="custom[value][]" value="{$style['content']}" type="text" placeholder="请输入配置值" pattern=".{1,20}">
  151. </div>
  152. <label class="checkbox-inline color-default">
  153. <a href="javascript:;" onclick="$(this).parent().parent().remove();" class="fa fa-times-circle" title="删除此操作"></a>
  154. </label>
  155. </div>
  156. </script>
  157. <script>
  158. require(['underscore'], function() {
  159. angular.module('wesiteApp').value('config', {
  160. style: {php echo !empty($style) ? json_encode($style) : 'null'},
  161. systemtags: {php echo !empty($systemtags) ? json_encode($systemtags) : 'null'},
  162. styles: {php echo !empty($styles) ? json_encode($styles) : 'null'},
  163. template: {php echo !empty($template) ? json_encode($template) : 'null'},
  164. });
  165. angular.bootstrap($('#js-wesite-tpl-post'), ['wesiteApp']);
  166. });
  167. </script>
  168. {template 'common/footer'}