You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

232 rivejä
16 KiB

  1. <style type="text/css">
  2. @media (max-width: 375px) {
  3. .edit-form tr td input{width:100%;}
  4. .edit-form tr th:first-child,.edit-form tr td:first-child{
  5. width:20%;
  6. }
  7. .edit-form tr th:nth-last-of-type(-n+2),.edit-form tr td:nth-last-of-type(-n+2){
  8. display: none;
  9. }
  10. }
  11. .edit-form table > tbody > tr td a.btn-delcfg{
  12. visibility: hidden;
  13. }
  14. .edit-form table > tbody > tr:hover td a.btn-delcfg{
  15. visibility: visible;
  16. }
  17. </style>
  18. <div class="panel panel-default panel-intro">
  19. <div class="panel-heading">
  20. {:build_heading(null, false)}
  21. <ul class="nav nav-tabs">
  22. {foreach $siteList as $index=>$vo}
  23. <li class="{$vo.active?'active':''}"><a href="#{$vo.name}" data-toggle="tab">{:__($vo.title)}</a></li>
  24. {/foreach}
  25. <li>
  26. <a href="#addcfg" data-toggle="tab"><i class="fa fa-plus"></i></a>
  27. </li>
  28. </ul>
  29. </div>
  30. <div class="panel-body">
  31. <div id="myTabContent" class="tab-content">
  32. {foreach $siteList as $index=>$vo}
  33. <div class="tab-pane fade {$vo.active ? 'active in' : ''}" id="{$vo.name}">
  34. <div class="widget-body no-padding">
  35. <form id="{$vo.name}-form" class="edit-form form-horizontal" role="form" data-toggle="validator" method="POST" action="{:url('unishop.config/edit')}">
  36. <table class="table table-striped">
  37. <thead>
  38. <tr>
  39. <th width="15%">{:__('Title')}</th>
  40. <th width="68%">{:__('Value')}</th>
  41. <th width="15%">{:__('Name')}</th>
  42. <th width="2%"></th>
  43. </tr>
  44. </thead>
  45. <tbody>
  46. {foreach $vo.list as $item}
  47. <tr>
  48. <td>{$item.title}</td>
  49. <td>
  50. <div class="row">
  51. <div class="col-sm-8 col-xs-12">
  52. {switch $item.type}
  53. {case string}
  54. <input {$item.extend} type="text" name="row[{$item.name}]" value="{$item.value}" class="form-control" data-rule="{$item.rule}" data-tip="{$item.tip}" />
  55. {/case}
  56. {case text}
  57. <textarea {$item.extend} name="row[{$item.name}]" class="form-control" data-rule="{$item.rule}" rows="5" data-tip="{$item.tip}">{$item.value}</textarea>
  58. {/case}
  59. {case editor}
  60. <textarea {$item.extend} name="row[{$item.name}]" id="editor-{$item.name}" class="form-control editor" data-rule="{$item.rule}" rows="5" data-tip="{$item.tip}">{$item.value}</textarea>
  61. {/case}
  62. {case array}
  63. <dl class="fieldlist" data-name="row[{$item.name}]">
  64. <dd>
  65. <ins>{:__('Array key')}</ins>
  66. <ins>{:__('Array value')}</ins>
  67. </dd>
  68. <dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
  69. <textarea name="row[{$item.name}]" class="form-control hide" cols="30" rows="5">{$item.value}</textarea>
  70. </dl>
  71. {/case}
  72. {case datetime}
  73. <input {$item.extend} type="text" name="row[{$item.name}]" value="{$item.value}" class="form-control datetimepicker" data-tip="{$item.tip}" data-rule="{$item.rule}" />
  74. {/case}
  75. {case number}
  76. <input {$item.extend} type="number" name="row[{$item.name}]" value="{$item.value}" class="form-control" data-tip="{$item.tip}" data-rule="{$item.rule}" />
  77. {/case}
  78. {case checkbox}
  79. {foreach name="item.content" item="vo"}
  80. <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>
  81. {/foreach}
  82. {/case}
  83. {case radio}
  84. {foreach name="item.content" item="vo"}
  85. <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>
  86. {/foreach}
  87. {/case}
  88. {case value="select" break="0"}{/case}
  89. {case value="selects"}
  90. <select {$item.extend} name="row[{$item.name}]{$item.type=='selects'?'[]':''}" class="form-control selectpicker" data-tip="{$item.tip}" {$item.type=='selects'?'multiple':''}>
  91. {foreach name="item.content" item="vo"}
  92. <option value="{$key}" {in name="key" value="$item.value"}selected{/in}>{$vo}</option>
  93. {/foreach}
  94. </select>
  95. {/case}
  96. {case value="image" break="0"}{/case}
  97. {case value="images"}
  98. <div class="form-inline">
  99. <input id="c-{$item.name}" class="form-control" size="50" name="row[{$item.name}]" type="text" value="{$item.value}" data-tip="{$item.tip}">
  100. <span><button type="button" id="plupload-{$item.name}" class="btn btn-danger plupload" 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>
  101. <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>
  102. <span class="msg-box n-right" for="c-{$item.name}"></span>
  103. <ul class="row list-inline plupload-preview" id="p-{$item.name}"></ul>
  104. </div>
  105. {/case}
  106. {case value="file" break="0"}{/case}
  107. {case value="files"}
  108. <div class="form-inline">
  109. <input id="c-{$item.name}" class="form-control" size="50" name="row[{$item.name}]" type="text" value="{$item.value}" data-tip="{$item.tip}">
  110. <span><button type="button" id="plupload-{$item.name}" class="btn btn-danger plupload" data-input-id="c-{$item.name}" data-multiple="{$item.type=='file'?'false':'true'}"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
  111. <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>
  112. <span class="msg-box n-right" for="c-{$item.name}"></span>
  113. </div>
  114. {/case}
  115. {case switch}
  116. <input id="c-{$item.name}" name="row[{$item.name}]" type="hidden" value="{:$item.value?1:0}">
  117. <a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-{$item.name}" data-yes="1" data-no="0" >
  118. <i class="fa fa-toggle-on text-success {if !$item.value}fa-flip-horizontal text-gray{/if} fa-2x"></i>
  119. </a>
  120. {/case}
  121. {case bool}
  122. <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>
  123. <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>
  124. {/case}
  125. {/switch}
  126. </div>
  127. <div class="col-sm-4"></div>
  128. </div>
  129. </td>
  130. <td>{php}echo "{\$". $item['name'] . "}";{/php}</td>
  131. <td><a href="javascript:;" class="btn-delcfg text-muted" data-name="{$item.name}"><i class="fa fa-times"></i></a></td>
  132. </tr>
  133. {/foreach}
  134. </tbody>
  135. <tfoot>
  136. <tr>
  137. <td></td>
  138. <td>
  139. <button type="submit" class="btn btn-success btn-embossed">{:__('OK')}</button>
  140. <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
  141. </td>
  142. <td></td>
  143. <td></td>
  144. </tr>
  145. </tfoot>
  146. </table>
  147. </form>
  148. </div>
  149. </div>
  150. {/foreach}
  151. <div class="tab-pane fade" id="addcfg">
  152. <form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="{:url('unishop.config/add')}">
  153. <div class="form-group">
  154. <label for="type" class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
  155. <div class="col-xs-12 col-sm-4">
  156. <select name="row[type]" class="form-control selectpicker">
  157. {foreach name="typeList" item="vo"}
  158. <option value="{$key}" {in name="key" value="string"}selected{/in}>{$vo}</option>
  159. {/foreach}
  160. </select>
  161. </div>
  162. </div>
  163. <div class="form-group">
  164. <label for="group" class="control-label col-xs-12 col-sm-2">{:__('Group')}:</label>
  165. <div class="col-xs-12 col-sm-4">
  166. <select name="row[group]" class="form-control selectpicker">
  167. {foreach name="groupList" item="vo"}
  168. <option value="{$key}" {in name="key" value="basic"}selected{/in}>{$vo}</option>
  169. {/foreach}
  170. </select>
  171. </div>
  172. </div>
  173. <div class="form-group">
  174. <label for="name" class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
  175. <div class="col-xs-12 col-sm-4">
  176. <input type="text" class="form-control" id="name" name="row[name]" value="" data-rule="required; length(3~30); remote(unishop/config/check)" />
  177. </div>
  178. </div>
  179. <div class="form-group">
  180. <label for="title" class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
  181. <div class="col-xs-12 col-sm-4">
  182. <input type="text" class="form-control" id="title" name="row[title]" value="" data-rule="required" />
  183. </div>
  184. </div>
  185. <div class="form-group">
  186. <label for="value" class="control-label col-xs-12 col-sm-2">{:__('Value')}:</label>
  187. <div class="col-xs-12 col-sm-4">
  188. <input type="text" class="form-control" id="value" name="row[value]" value="" data-rule="" />
  189. </div>
  190. </div>
  191. <div class="form-group hide" id="add-content-container">
  192. <label for="content" class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
  193. <div class="col-xs-12 col-sm-4">
  194. <textarea name="row[content]" id="content" cols="30" rows="5" class="form-control" data-rule="required">value1|title1
  195. value2|title2</textarea>
  196. </div>
  197. </div>
  198. <div class="form-group">
  199. <label for="tip" class="control-label col-xs-12 col-sm-2">{:__('Tip')}:</label>
  200. <div class="col-xs-12 col-sm-4">
  201. <input type="text" class="form-control" id="tip" name="row[tip]" value="" data-rule="" />
  202. </div>
  203. </div>
  204. <div class="form-group">
  205. <label for="rule" class="control-label col-xs-12 col-sm-2">{:__('Rule')}:</label>
  206. <div class="col-xs-12 col-sm-4">
  207. <input type="text" class="form-control" id="rule" name="row[rule]" value="" />
  208. </div>
  209. </div>
  210. <div class="form-group">
  211. <label for="extend" class="control-label col-xs-12 col-sm-2">{:__('Extend')}:</label>
  212. <div class="col-xs-12 col-sm-4">
  213. <textarea name="row[extend]" id="extend" cols="30" rows="5" class="form-control" data-rule=""></textarea>
  214. </div>
  215. </div>
  216. <div class="form-group">
  217. <label class="control-label col-xs-12 col-sm-2"></label>
  218. <div class="col-xs-12 col-sm-4">
  219. <button type="submit" class="btn btn-success btn-embossed">{:__('OK')}</button>
  220. <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
  221. </div>
  222. </div>
  223. </form>
  224. </div>
  225. </div>
  226. </div>
  227. </div>