add.html 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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 isset($pid) && $pid == 1}-->
  40. <!-- <div class="form-group">-->
  41. <!-- <label class="col-sm-2 control-label">城市</label>-->
  42. <!-- <div class="col-sm-6">-->
  43. <!-- <select name="city_id" class="form-control">-->
  44. <!-- <option value="0">选择城市</option>-->
  45. <!-- {foreach $city as $k=>$v}-->
  46. <!-- <option value="{$v.id}">{$v.title}</option>-->
  47. <!-- {/foreach}-->
  48. <!-- </select>-->
  49. <!-- </div>-->
  50. <!-- </div>-->
  51. <!-- {/if}-->
  52. {if condition="$t == 2"}
  53. <div class="form-group">
  54. <label class="col-sm-2 control-label">地图标注</label>
  55. <div class="col-sm-6">
  56. {:widget_view('common/gdmap',['name'=>'location', 'val' => isset($info['location'])?$info['location']:''])}
  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}