add.html 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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="id" value="{$info['id']|default='0'}">
  9. <div class="form-group">
  10. <label class="col-sm-2 control-label">名称<span class="text-danger">*</span></label>
  11. <div class="col-sm-6">
  12. <input type="text" class="form-control" name="title" value="{$info.title|default=''}">
  13. </div>
  14. </div>
  15. <div class="form-group">
  16. <label class="col-sm-2 control-label">关联文章<span class="text-danger">*</span></label>
  17. <div class="col-sm-6">
  18. <select name="article_id" class="form-control">
  19. <option value="">选择文章</option>
  20. {foreach $cate as $k=>$v}
  21. <option {if isset($info) && $info['article_id']==$v['id']} selected {/if} value="{$v['id']}">{$v['title']}</option>
  22. {/foreach}
  23. </select>
  24. </div>
  25. </div>
  26. <div class="form-group">
  27. <label class="col-sm-2 control-label">考试次数<span class="text-danger">*</span></label>
  28. <div class="col-sm-6">
  29. <input type="number" class="form-control" name="limits" value="{$info.limits|default=''}">
  30. </div>
  31. </div>
  32. <div class="hr-line-dashed"></div>
  33. <div class="form-group">
  34. <div class="col-sm-6 col-sm-offset-2">
  35. <button class="btn btn-primary ajax-post" data-layer="1" target-form="form-horizontal" type="submit">确 定</button>
  36. <button class="btn cancel-btn btn-default" type="button">取 消</button>
  37. </div>
  38. </div>
  39. </form>
  40. </div>
  41. </div>
  42. </div>
  43. </div>
  44. {/block}
  45. {block name="script"}
  46. <script>
  47. $(document).ready(function(){
  48. formSetValue("enable", {$info.enable|default=1});
  49. });
  50. </script>
  51. {/block}