edit.html 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <form id="form" action="{:url('tpl/edit')}">
  2. <input type="hidden" name="id" value="{$info.id}"/>
  3. <table class="formtable" id="attr">
  4. <tr>
  5. <th>模板名称:</th>
  6. <td><input class="input" datatype="*" type="text" name="name" value="{$info.name}" /></td>
  7. </tr>
  8. {if empty($info.fields)}
  9. <tr>
  10. <th>模板类型</th>
  11. <td class="input-group">
  12. <input class="input w100" datatype="*" type="text" name="title[]" placeholder="模板标题"/>
  13. <select class="select" name="types[]">
  14. <option value="text" selected>文本输入</option>
  15. <option value="address">联系地址</option>
  16. <option value="number">整数数字</option>
  17. <option value="digit"">小数点数字</option>
  18. <option value="idcard">身份证输入</option>
  19. <option value="date">年月日时分</option>
  20. <option value="selector">选择器</option>
  21. </select>
  22. <input class="input w300" type="text" name="placeholder[]" placeholder="提示语"/>
  23. <span class="fn-cp ml5" id="add_attr"><i class="iconfont icon-add_icon"></i></span> <br />
  24. <input class="input w500 mt5" type="text" name="values[]" placeholder="默认值,多个以|线分开"/>
  25. </td>
  26. </tr>
  27. {else}
  28. {foreach $info.fields as $key => $vo}
  29. <tr>
  30. <th>{if !$key}模板类型{/if}</th>
  31. <td class="input-group">
  32. <input class="input w100" datatype="*" type="text" name="title[]" placeholder="模板标题" value="{$vo.title}"/>
  33. <select class="select" name="types[]">
  34. <option value="text" {$vo.types == 'text'?'selected':''}>文本输入</option>
  35. <option value="address" {$vo.types == 'address'?'selected':''}>联系地址</option>
  36. <option value="number" {$vo.types == 'number'?'selected':''}>整数数字</option>
  37. <option value="digit"" {$vo.types == 'digit'?'selected':''}>小数点数字</option>
  38. <option value="idcard" {$vo.types == 'idcard'?'selected':''}>身份证输入</option>
  39. <option value="date" {$vo.types == 'date'?'selected':''}>年月日时分</option>
  40. <option value="selector" {$vo.types == 'selector'?'selected':''}>选择器</option>
  41. </select>
  42. <input class="input w300" type="text" name="placeholder[]" placeholder="提示语" value="{$vo.placeholder}"/>
  43. {if !$key}
  44. <span class="fn-cp ml5" id="add_attr"><i class="iconfont icon-add_icon"></i></span>
  45. {else}
  46. <span class="fn-cp ml5" onclick="remove_attr(this)"><i class="iconfont icon-reduce_icon"></i></span>
  47. {/if} <br />
  48. <input class="input w500 mt5" type="text" name="values[]" placeholder="默认值,多个以|线分开" value="{$vo.values}"/>
  49. </td>
  50. </tr>
  51. {/foreach}
  52. {/if}
  53. </table>
  54. <table class="formtable">
  55. <tr>
  56. <th></th>
  57. <td>
  58. <input type="submit" value="确定" class="button button-blue submit" />
  59. <input type="reset" value="重置" class="button"/>
  60. </td>
  61. </tr>
  62. </table>
  63. </form>
  64. {include file="tpl:bottom" /}