newindex.html 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. <style type="text/css">
  2. @media (max-width: 375px) {
  3. .edit-form tr td input {
  4. width: 100%;
  5. }
  6. .edit-form tr th:first-child, .edit-form tr td:first-child {
  7. width: 20%;
  8. }
  9. .edit-form tr th:nth-last-of-type(-n+2), .edit-form tr td:nth-last-of-type(-n+2) {
  10. display: none;
  11. }
  12. }
  13. .edit-form table > tbody > tr td a.btn-delcfg {
  14. visibility: hidden;
  15. }
  16. .edit-form table > tbody > tr:hover td a.btn-delcfg {
  17. visibility: visible;
  18. }
  19. @media (max-width: 767px) {
  20. .edit-form table tr th:nth-last-child(-n + 2), .edit-form table tr td:nth-last-child(-n + 2) {
  21. display: none;
  22. }
  23. .edit-form table tr td .msg-box {
  24. display: none;
  25. }
  26. }
  27. </style>
  28. <div class="panel panel-default panel-intro">
  29. <div class="panel-heading">
  30. {:build_heading(null, false)}
  31. <ul class="nav nav-tabs">
  32. {foreach $siteList as $index=>$vo}
  33. <li class="{$vo.active?'active':''}"><a href="#{$vo.name}" data-toggle="tab">{:__($vo.title)}</a></li>
  34. {/foreach}
  35. <!--<li data-toggle="tooltip" title="{:__('Add new config')}">
  36. <a href="#addcfg" data-toggle="tab"><i class="fa fa-plus"></i></a>
  37. </li>-->
  38. </ul>
  39. </div>
  40. <div class="panel-body">
  41. <div id="myTabContent" class="tab-content">
  42. <!--@formatter:off-->
  43. {foreach $siteList as $index=>$vo}
  44. <div class="tab-pane fade {$vo.active ? 'active in' : ''}" id="{$vo.name}">
  45. <div class="widget-body no-padding">
  46. <form id="{$vo.name}-form" class="edit-form form-horizontal" role="form" data-toggle="validator" method="POST" action="{:url('general.config/edit')}">
  47. {:token()}
  48. <table class="table table-striped">
  49. <thead>
  50. <tr>
  51. <th width="25%">{:__('Title')}</th>
  52. <th width="75%">{:__('Value')}</th>
  53. <!--<th width="15%">{:__('Name')}</th>-->
  54. <!--<th width="2%"></th>-->
  55. </tr>
  56. </thead>
  57. <tbody>
  58. {foreach $vo.list as $item}
  59. <tr>
  60. <td>{$item.title}</td>
  61. <td>
  62. <div class="row">
  63. <div class="col-sm-8 col-xs-12">
  64. {switch $item.type}
  65. {case string}
  66. <input {$item.extend_html} type="text" name="row[{$item.name}]" value="{$item.value|htmlentities}" class="form-control" data-rule="{$item.rule}" data-tip="{$item.tip}"/>
  67. {/case}
  68. {case text}
  69. <textarea {$item.extend_html} name="row[{$item.name}]" class="form-control" data-rule="{$item.rule}" rows="5" data-tip="{$item.tip}">{$item.value|htmlentities}</textarea>
  70. {/case}
  71. {case editor}
  72. <textarea {$item.extend_html} name="row[{$item.name}]" id="editor-{$item.name}" class="form-control editor" data-rule="{$item.rule}" rows="5" data-tip="{$item.tip}">{$item.value|htmlentities}</textarea>
  73. {/case}
  74. {case array}
  75. <dl {$item.extend_html} class="fieldlist" data-name="row[{$item.name}]">
  76. <dd>
  77. <ins>{:isset($item["setting"]["key"])&&$item["setting"]["key"]?$item["setting"]["key"]:__('Array key')}</ins>
  78. <ins>{:isset($item["setting"]["value"])&&$item["setting"]["value"]?$item["setting"]["value"]:__('Array value')}</ins>
  79. </dd>
  80. <dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
  81. <textarea name="row[{$item.name}]" class="form-control hide" cols="30" rows="5">{$item.value|htmlentities}</textarea>
  82. </dl>
  83. {/case}
  84. {case date}
  85. <input {$item.extend_html} type="text" name="row[{$item.name}]" value="{$item.value|htmlentities}" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-tip="{$item.tip}" data-rule="{$item.rule}"/>
  86. {/case}
  87. {case time}
  88. <input {$item.extend_html} type="text" name="row[{$item.name}]" value="{$item.value|htmlentities}" class="form-control datetimepicker" data-date-format="HH:mm:ss" data-tip="{$item.tip}" data-rule="{$item.rule}"/>
  89. {/case}
  90. {case datetime}
  91. <input {$item.extend_html} type="text" name="row[{$item.name}]" value="{$item.value|htmlentities}" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-tip="{$item.tip}" data-rule="{$item.rule}"/>
  92. {/case}
  93. {case datetimerange}
  94. <input {$item.extend_html} type="text" name="row[{$item.name}]" value="{$item.value|htmlentities}" class="form-control datetimerange" data-tip="{$item.tip}" data-rule="{$item.rule}"/>
  95. {/case}
  96. {case number}
  97. <input {$item.extend_html} type="number" name="row[{$item.name}]" value="{$item.value|htmlentities}" class="form-control" data-tip="{$item.tip}" data-rule="{$item.rule}"/>
  98. {/case}
  99. {case checkbox}
  100. <div class="checkbox">
  101. {foreach name="item.content" item="vo"}
  102. <label for="row[{$item.name}][]-{$key}"><input id="row[{$item.name}][]-{$key}" name="row[{$item.name}][]" type="checkbox" value="{$key}" data-tip="{$item.tip}" {in name="key" value="$item.value" }checked{/in} /> {$vo}</label>
  103. {/foreach}
  104. </div>
  105. {/case}
  106. {case radio}
  107. <div class="radio">
  108. {foreach name="item.content" item="vo"}
  109. <label for="row[{$item.name}]-{$key}"><input id="row[{$item.name}]-{$key}" name="row[{$item.name}]" type="radio" value="{$key}" data-tip="{$item.tip}" {in name="key" value="$item.value" }checked{/in} /> {$vo}</label>
  110. {/foreach}
  111. </div>
  112. {/case}
  113. {case value="select" break="0"}{/case}
  114. {case value="selects"}
  115. <select {$item.extend_html} name="row[{$item.name}]{$item.type=='selects'?'[]':''}" class="form-control selectpicker" data-tip="{$item.tip}" {$item.type=='selects'?'multiple':''}>
  116. {foreach name="item.content" item="vo"}
  117. <option value="{$key}" {in name="key" value="$item.value" }selected{/in}>{$vo}</option>
  118. {/foreach}
  119. </select>
  120. {/case}
  121. {case value="image" break="0"}{/case}
  122. {case value="images"}
  123. <div class="form-inline">
  124. <input id="c-{$item.name}" class="form-control" size="50" name="row[{$item.name}]" type="text" value="{$item.value|htmlentities}" data-tip="{$item.tip}">
  125. <span><button type="button" id="faupload-{$item.name}" class="btn btn-danger faupload" data-input-id="c-{$item.name}" data-mimetype="image/*" data-multiple="{$item.type=='image'?'false':'true'}" data-preview-id="p-{$item.name}"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
  126. <span><button type="button" id="fachoose-{$item.name}" class="btn btn-primary fachoose" data-input-id="c-{$item.name}" data-mimetype="image/*" data-multiple="{$item.type=='image'?'false':'true'}"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
  127. <span class="msg-box n-right" for="c-{$item.name}"></span>
  128. <ul class="row list-inline faupload-preview" id="p-{$item.name}"></ul>
  129. </div>
  130. {/case}
  131. {case value="file" break="0"}{/case}
  132. {case value="files"}
  133. <div class="form-inline">
  134. <input id="c-{$item.name}" class="form-control" size="50" name="row[{$item.name}]" type="text" value="{$item.value|htmlentities}" data-tip="{$item.tip}">
  135. <span><button type="button" id="faupload-{$item.name}" class="btn btn-danger faupload" data-input-id="c-{$item.name}" data-multiple="{$item.type=='file'?'false':'true'}"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
  136. <span><button type="button" id="fachoose-{$item.name}" class="btn btn-primary fachoose" data-input-id="c-{$item.name}" data-multiple="{$item.type=='file'?'false':'true'}"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
  137. <span class="msg-box n-right" for="c-{$item.name}"></span>
  138. </div>
  139. {/case}
  140. {case switch}
  141. <input id="c-{$item.name}" name="row[{$item.name}]" type="hidden" value="{:$item.value?1:0}">
  142. <a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-{$item.name}" data-yes="1" data-no="0">
  143. <i class="fa fa-toggle-on text-success {if !$item.value}fa-flip-horizontal text-gray{/if} fa-2x"></i>
  144. </a>
  145. {/case}
  146. {case bool}
  147. <label for="row[{$item.name}]-yes"><input id="row[{$item.name}]-yes" name="row[{$item.name}]" type="radio" value="1" {$item.value?'checked':''} data-tip="{$item.tip}" /> {:__('Yes')}</label>
  148. <label for="row[{$item.name}]-no"><input id="row[{$item.name}]-no" name="row[{$item.name}]" type="radio" value="0" {$item.value?'':'checked'} data-tip="{$item.tip}" /> {:__('No')}</label>
  149. {/case}
  150. {case city}
  151. <div style="position:relative">
  152. <input {$item.extend_html} type="text" name="row[{$item.name}]" id="c-{$item.name}" value="{$item.value|htmlentities}" class="form-control" data-toggle="city-picker" data-tip="{$item.tip}" data-rule="{$item.rule}" />
  153. </div>
  154. {/case}
  155. {case value="selectpage" break="0"}{/case}
  156. {case value="selectpages"}
  157. <input {$item.extend_html} type="text" name="row[{$item.name}]" id="c-{$item.name}" value="{$item.value|htmlentities}" class="form-control selectpage" data-source="{:url('general.config/selectpage')}?id={$item.id}" data-primary-key="{$item.setting.primarykey}" data-field="{$item.setting.field}" data-multiple="{$item.type=='selectpage'?'false':'true'}" data-tip="{$item.tip}" data-rule="{$item.rule}" />
  158. {/case}
  159. {case custom}
  160. {$item.extend_html}
  161. {/case}
  162. {/switch}
  163. </div>
  164. <div class="col-sm-4"></div>
  165. </div>
  166. </td>
  167. <!--<td>{php}echo "{\$site.". $item['name'] . "}";{/php}</td>-->
  168. <!--<td>{if $item['id']>17}<a href="javascript:;" class="btn-delcfg text-muted" data-name="{$item.name}"><i class="fa fa-times"></i></a>{/if}</td>-->
  169. </tr>
  170. {/foreach}
  171. </tbody>
  172. <tfoot>
  173. <tr>
  174. <td></td>
  175. <td>
  176. <button type="submit" class="btn btn-success btn-embossed">{:__('OK')}</button>
  177. <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
  178. </td>
  179. <td></td>
  180. <td></td>
  181. </tr>
  182. </tfoot>
  183. </table>
  184. </form>
  185. </div>
  186. </div>
  187. {/foreach}
  188. <div class="tab-pane fade" id="addcfg">
  189. <form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="{:url('general.config/add')}">
  190. {:token()}
  191. <div class="form-group">
  192. <label class="control-label col-xs-12 col-sm-2">{:__('Group')}:</label>
  193. <div class="col-xs-12 col-sm-4">
  194. <select name="row[group]" class="form-control selectpicker">
  195. {foreach name="groupList" item="vo"}
  196. <option value="{$key}" {in name="key" value="basic" }selected{/in}>{$vo}</option>
  197. {/foreach}
  198. </select>
  199. </div>
  200. </div>
  201. <div class="form-group">
  202. <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
  203. <div class="col-xs-12 col-sm-4">
  204. <select name="row[type]" id="c-type" class="form-control selectpicker">
  205. {foreach name="typeList" item="vo"}
  206. <option value="{$key}" {in name="key" value="string" }selected{/in}>{$vo}</option>
  207. {/foreach}
  208. </select>
  209. </div>
  210. </div>
  211. <div class="form-group">
  212. <label for="name" class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
  213. <div class="col-xs-12 col-sm-4">
  214. <input type="text" class="form-control" id="name" name="row[name]" value="" data-rule="required; length(3~30); remote(general/config/check)"/>
  215. </div>
  216. </div>
  217. <div class="form-group">
  218. <label for="title" class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
  219. <div class="col-xs-12 col-sm-4">
  220. <input type="text" class="form-control" id="title" name="row[title]" value="" data-rule="required"/>
  221. </div>
  222. </div>
  223. <div class="form-group hidden tf tf-selectpage tf-selectpages">
  224. <label for="c-selectpage-table" class="control-label col-xs-12 col-sm-2">{:__('Selectpage table')}:</label>
  225. <div class="col-xs-12 col-sm-4">
  226. <select id="c-selectpage-table" name="row[setting][table]" class="form-control selectpicker" data-live-search="true">
  227. <option value="">{:__('Please select table')}</option>
  228. </select>
  229. </div>
  230. </div>
  231. <div class="form-group hidden tf tf-selectpage tf-selectpages">
  232. <label for="c-selectpage-primarykey" class="control-label col-xs-12 col-sm-2">{:__('Selectpage primarykey')}:</label>
  233. <div class="col-xs-12 col-sm-4">
  234. <select name="row[setting][primarykey]" class="form-control selectpicker" id="c-selectpage-primarykey"></select>
  235. </div>
  236. </div>
  237. <div class="form-group hidden tf tf-selectpage tf-selectpages">
  238. <label for="c-selectpage-field" class="control-label col-xs-12 col-sm-2">{:__('Selectpage field')}:</label>
  239. <div class="col-xs-12 col-sm-4">
  240. <select name="row[setting][field]" class="form-control selectpicker" id="c-selectpage-field"></select>
  241. </div>
  242. </div>
  243. <div class="form-group hidden tf tf-selectpage tf-selectpages">
  244. <label class="control-label col-xs-12 col-sm-2">{:__('Selectpage conditions')}:</label>
  245. <div class="col-xs-12 col-sm-8">
  246. <dl class="fieldlist" data-name="row[setting][conditions]">
  247. <dd>
  248. <ins>{:__('Field title')}</ins>
  249. <ins>{:__('Field value')}</ins>
  250. </dd>
  251. <dd><a href="javascript:;" class="append btn btn-sm btn-success"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
  252. <textarea name="row[setting][conditions]" class="form-control hide" cols="30" rows="5"></textarea>
  253. </dl>
  254. </div>
  255. </div>
  256. <div class="form-group hidden tf tf-array">
  257. <label for="c-array-key" class="control-label col-xs-12 col-sm-2">{:__('Array key')}:</label>
  258. <div class="col-xs-12 col-sm-4">
  259. <input type="text" name="row[setting][key]" class="form-control" id="c-array-key">
  260. </div>
  261. </div>
  262. <div class="form-group hidden tf tf-array">
  263. <label for="c-array-value" class="control-label col-xs-12 col-sm-2">{:__('Array value')}:</label>
  264. <div class="col-xs-12 col-sm-4">
  265. <input type="text" name="row[setting][value]" class="form-control" id="c-array-value">
  266. </div>
  267. </div>
  268. <div class="form-group">
  269. <label for="value" class="control-label col-xs-12 col-sm-2">{:__('Value')}:</label>
  270. <div class="col-xs-12 col-sm-4">
  271. <input type="text" class="form-control" id="value" name="row[value]" value="" data-rule=""/>
  272. </div>
  273. </div>
  274. <div class="form-group hide" id="add-content-container">
  275. <label for="content" class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
  276. <div class="col-xs-12 col-sm-4">
  277. <textarea name="row[content]" id="content" cols="30" rows="5" class="form-control" data-rule="required(content)">value1|title1
  278. value2|title2</textarea>
  279. </div>
  280. </div>
  281. <div class="form-group">
  282. <label for="tip" class="control-label col-xs-12 col-sm-2">{:__('Tip')}:</label>
  283. <div class="col-xs-12 col-sm-4">
  284. <input type="text" class="form-control" id="tip" name="row[tip]" value="" data-rule=""/>
  285. </div>
  286. </div>
  287. <div class="form-group">
  288. <label for="rule" class="control-label col-xs-12 col-sm-2">{:__('Rule')}:</label>
  289. <div class="col-xs-12 col-sm-4">
  290. <div class="input-group pull-left">
  291. <input type="text" class="form-control" id="rule" name="row[rule]" value="" data-tip="{:__('Rule tips')}"/>
  292. <span class="input-group-btn">
  293. <button class="btn btn-primary dropdown-toggle" data-toggle="dropdown" type="button">{:__('Choose')}</button>
  294. <ul class="dropdown-menu pull-right rulelist">
  295. {volist name="ruleList" id="item"}
  296. <li><a href="javascript:;" data-value="{$key}">{$item}<span class="text-muted">({$key})</span></a></li>
  297. {/volist}
  298. </ul>
  299. </span>
  300. </div>
  301. <span class="msg-box n-right" for="rule"></span>
  302. </div>
  303. </div>
  304. <div class="form-group">
  305. <label for="extend" class="control-label col-xs-12 col-sm-2">{:__('Extend')}:</label>
  306. <div class="col-xs-12 col-sm-4">
  307. <textarea name="row[extend]" id="extend" cols="30" rows="5" class="form-control" data-tip="{:__('Extend tips')}" data-rule="required(extend)" data-msg-extend="当类型为自定义时,扩展属性不能为空"></textarea>
  308. </div>
  309. </div>
  310. <div class="form-group">
  311. <label class="control-label col-xs-12 col-sm-2"></label>
  312. <div class="col-xs-12 col-sm-4">
  313. <button type="submit" class="btn btn-success btn-embossed">{:__('OK')}</button>
  314. <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
  315. </div>
  316. </div>
  317. </form>
  318. </div>
  319. <!--@formatter:on-->
  320. </div>
  321. </div>
  322. </div>