add.html 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <div class="row">
  4. <div class="col-sm-12">
  5. <div class="ibox float-e-margins">
  6. <div class="ibox-content">
  7. <form method="post" action="{:url('add')}" class="form-horizontal">
  8. <input type="hidden" name="parent_id" value="{$pid}">
  9. <input type="hidden" name="type" value="{$t}">
  10. <div class="form-group">
  11. <label class="col-sm-2 control-label">名称 <span class="text-danger">*</span></label>
  12. <div class="col-sm-6">
  13. <input type="text" class="form-control" name="name" value="{$info.name|default=''}">
  14. </div>
  15. </div>
  16. <div class="form-group">
  17. <label class="col-sm-2 control-label">排序</label>
  18. <div class="col-sm-6">
  19. <input type="number" class="form-control" name="sort" value="{$info.sort|default='100'}">
  20. </div>
  21. </div>
  22. <div class="form-group">
  23. <label class="col-sm-2 control-label">备注</label>
  24. <div class="col-sm-6">
  25. <textarea name="content" class="form-control" rows="3">{$info.content|default=''}</textarea>
  26. </div>
  27. </div>
  28. <div class="form-group">
  29. <label class="col-sm-2 control-label">状态</label>
  30. <div class="col-sm-6">
  31. <label class="cr-inline">
  32. <input type="radio" value="1" name="enable">启用&nbsp;&nbsp;
  33. </label>
  34. <label class="cr-inline">
  35. <input type="radio" value="0" name="enable">禁用
  36. </label>
  37. </div>
  38. </div>
  39. {if condition="$t == 2"}
  40. <div class="form-group">
  41. <label class="col-sm-2 control-label">地图标注</label>
  42. <div class="col-sm-6">
  43. {:widget_view('common/gdmap',['name'=>'location', 'val' => isset($info['location'])?$info['location']:''])}
  44. </div>
  45. </div>
  46. {/if}
  47. {if isset($infotype) && $infotype == 1}
  48. <div class="form-group">
  49. <label class="col-sm-2 control-label">城市</label>
  50. <div class="col-sm-6">
  51. <select name="city_id" class="form-control">
  52. <option value="0">选择城市</option>
  53. {foreach $city as $k=>$v}
  54. <option value="{$v.id}">{$v.title}</option>
  55. {/foreach}
  56. </select>
  57. </div>
  58. </div>
  59. {/if}
  60. <div class="hr-line-dashed"></div>
  61. <div class="form-group">
  62. <div class="col-sm-6 col-sm-offset-2">
  63. <button class="btn btn-primary ajax-post" data-layer="1" target-form="form-horizontal" type="submit">确 定</button>
  64. </div>
  65. </div>
  66. </form>
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. {/block}
  72. {block name="script"}
  73. <script>
  74. $(document).ready(function(){
  75. formSetValue("enable", {$info.enable|default=1});
  76. });
  77. </script>
  78. {/block}