add.html 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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-title">-->
  7. <!--<h5>{$title}</h5>-->
  8. <!--<div class="ibox-tools">-->
  9. <!--<a class="toback" href="{:url('index',['pid'=>$pid])}">-->
  10. <!--返回上一页-->
  11. <!--</a>-->
  12. <!--</div>-->
  13. <!--</div>-->
  14. <div class="ibox-content">
  15. <form method="post" action="{:url('add')}" class="form-horizontal">
  16. <input type="hidden" name="id" value="{$info['id']|default='0'}">
  17. <input type="hidden" name="pid" value="{$pid|default='0'}">
  18. <div class="form-group">
  19. <label class="col-sm-2 control-label">名称<span class="text-danger">*</span></label>
  20. <div class="col-sm-6">
  21. <input type="text" class="form-control" name="name" value="{$info.name|default=''}">
  22. </div>
  23. </div>
  24. <div class="form-group">
  25. <label class="col-sm-2 control-label">mode</label>
  26. <div class="col-sm-6">
  27. <input type="number" class="form-control" name="mode" value="{$info.mode|default=''}">
  28. </div>
  29. </div>
  30. <div class="form-group">
  31. <label class="col-sm-2 control-label">图标<span class="text-danger">*</span></label>
  32. <div class="col-sm-6">
  33. {:widget_view('common/upimg',['name'=>'path','multi'=>0,'val'=>isset($info)?$info['path']:''])}
  34. </div>
  35. </div>
  36. {if ($pid <= 0)}
  37. <div class="form-group">
  38. <label class="col-sm-2 control-label">链接</label>
  39. <div class="col-sm-6">
  40. <input type="text" class="form-control" name="url" value="{$info.url|default=''}">
  41. </div>
  42. </div>
  43. <div class="form-group">
  44. <label class="col-sm-2 control-label">备注</label>
  45. <div class="col-sm-6">
  46. <input type="text" class="form-control" name="des" value="{$info.des|default=''}">
  47. </div>
  48. </div>
  49. <div class="form-group">
  50. <label class="col-sm-2 control-label">位置</label>
  51. <div class="col-sm-6">
  52. <select name="type" class="form-control">
  53. <option value="0">首页</option>
  54. <option value="1">统计页</option>
  55. </select>
  56. </div>
  57. </div>
  58. <div class="form-group">
  59. <label class="col-sm-2 control-label">排序</label>
  60. <div class="col-sm-6">
  61. <input type="number" class="form-control" name="sort" value="{$info.sort|default=''}">
  62. </div>
  63. </div>
  64. <div class="form-group">
  65. <label class="col-sm-2 control-label">状态</label>
  66. <div class="col-sm-6">
  67. <label class="cr-inline">
  68. <input type="radio" value="1" name="enable">正常&nbsp;&nbsp;
  69. </label>
  70. <label class="cr-inline">
  71. <input type="radio" value="0" name="enable">禁用
  72. </label>
  73. </div>
  74. </div>
  75. {/if}
  76. <div class="hr-line-dashed"></div>
  77. <div class="form-group">
  78. <div class="col-sm-6 col-sm-offset-2">
  79. <button class="btn btn-primary ajax-post" data-layer_c="1" target-form="form-horizontal" type="submit">确 定</button>
  80. <button class="btn cancel-btn btn-default" type="button">取 消</button>
  81. <!--<a href="{:url('index',['pid'=>$pid])}" class="btn btn-default">取 消</a>-->
  82. </div>
  83. </div>
  84. </form>
  85. </div>
  86. </div>
  87. </div>
  88. </div>
  89. {/block}
  90. {block name="script"}
  91. <script>
  92. $(document).ready(function(){
  93. formSetValue("enable", {$info.enable|default=1});
  94. });
  95. $(document).ready(function(){
  96. formSetValue("type", {$info.type|default=0});
  97. });
  98. </script>
  99. {/block}