add.html 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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. <input type="hidden" name="type" value="{$info['type']|default=$type}">
  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. <!-- <select name="type" class="form-control">-->
  14. <!-- <option value="1">文件</option>-->
  15. <!-- <option value="2">文章</option>-->
  16. <!-- <option value="3">视频</option>-->
  17. <!-- <option value="4">音频</option>-->
  18. <!-- </select>-->
  19. <!-- </div>-->
  20. <!-- </div>-->
  21. {if ($type == 1) || !empty($info['path'])}
  22. <div class="form-group">
  23. <label class="col-sm-2 control-label">文件<span class="text-danger">*</span></label>
  24. <div class="col-sm-6">
  25. {:widget_view('common/upfile',['name'=>'path','multi'=>0,'accept'=>'.pdf','val'=>isset($info)?$info['path']:''])}
  26. </div>
  27. </div>
  28. {/if}
  29. <div class="form-group">
  30. <label class="col-sm-2 control-label">名称<span class="text-danger">*</span></label>
  31. <div class="col-sm-6">
  32. <input type="text" class="form-control" name="title" value="{$info.title|default=''}">
  33. </div>
  34. </div>
  35. <div class="form-group">
  36. <label class="col-sm-2 control-label">分类<span class="text-danger">*</span></label>
  37. <div class="col-sm-6">
  38. <select name="cate_id" class="form-control">
  39. <option value="">选择分类</option>
  40. {foreach $cate as $k=>$v}
  41. <option {if isset($info) && $info['cate_id']==$v['id']} selected {/if} value="{$v['id']}">{$v['title']}</option>
  42. {/foreach}
  43. </select>
  44. </div>
  45. </div>
  46. <div class="form-group">
  47. <label class="col-sm-2 control-label">查看角色</label>
  48. <div class="col-sm-6">
  49. {:widget_view('common/multiselect',['name'=>'roles_ids','lists' =>$roles, 'val' =>isset($info)?$info['roles_ids']:[]])}
  50. <span class="help-block m-b-none text-danger">不选所有人可查看,选择相应角色可查看</span>
  51. </div>
  52. </div>
  53. <div class="form-group">
  54. <label class="col-sm-2 control-label">描述<span class="text-danger">*</span></label>
  55. <div class="col-sm-6">
  56. <input type="text" class="form-control" name="description" value="{$info.description|default=''}">
  57. </div>
  58. </div>
  59. <div class="form-group">
  60. <label class="col-sm-2 control-label">排序</label>
  61. <div class="col-sm-6">
  62. <input type="number" class="form-control" name="sort" value="{$info.sort|default='50'}">
  63. </div>
  64. </div>
  65. <div class="form-group">
  66. <label class="col-sm-2 control-label">备注</label>
  67. <div class="col-sm-6">
  68. <input type="text" class="form-control" name="remark" value="{$info.remark||default=''}">
  69. </div>
  70. </div>
  71. <div class="form-group">
  72. <label class="col-sm-2 control-label">最低学习时长</label>
  73. <div class="col-sm-6">
  74. <input type="number" class="form-control" name="limit" value="{$info.limit|default=''}">
  75. <span class="help-block m-b-none text-danger">最低学习时长,不填或者0为不限制,单位:分钟</span>
  76. </div>
  77. </div>
  78. <div class="form-group">
  79. <label class="col-sm-2 control-label">状态</label>
  80. <div class="col-sm-6">
  81. <label class="cr-inline">
  82. <input type="radio" value="1" name="enable">正常&nbsp;&nbsp;
  83. </label>
  84. <label class="cr-inline">
  85. <input type="radio" value="0" name="enable">禁用
  86. </label>
  87. </div>
  88. </div>
  89. {if ($type == 2) || !empty($info['content'])}
  90. <div class="form-group">
  91. <label class="col-sm-2 control-label">内容</label>
  92. <div class="col-sm-6">
  93. {:widget_view('common/ueditor',['name'=>'content','height'=>300,'val'=>isset($info)?$info['content']:''])}
  94. </div>
  95. </div>
  96. {/if}
  97. {if ($type == 3) || !empty($info['video'])}
  98. <div class="form-group">
  99. <label class="col-sm-2 control-label">视频</label>
  100. <div class="col-sm-6">
  101. {:widget_view('common/upfile',['name'=>'video','multi'=>0,'accept'=>'.mp4','val'=>isset($info)?$info['video']:''])}
  102. </div>
  103. </div>
  104. {/if}
  105. {if ($type == 4) || !empty($info['audio'])}
  106. <div class="form-group">
  107. <label class="col-sm-2 control-label">音频</label>
  108. <div class="col-sm-6">
  109. {:widget_view('common/upfile',['name'=>'audio','multi'=>0,'accept'=>'.mp3','val'=>isset($info)?$info['audio']:''])}
  110. </div>
  111. </div>
  112. {/if}
  113. <div class="hr-line-dashed"></div>
  114. <div class="form-group">
  115. <div class="col-sm-6 col-sm-offset-2">
  116. <button class="btn btn-primary ajax-post" data-layer="1" target-form="form-horizontal" type="submit">确 定</button>
  117. <button class="btn cancel-btn btn-default" type="button">取 消</button>
  118. </div>
  119. </div>
  120. </form>
  121. </div>
  122. </div>
  123. </div>
  124. </div>
  125. {/block}
  126. {block name="script"}
  127. <script>
  128. $(document).ready(function(){
  129. formSetValue("enable", {$info.enable|default=1});
  130. });
  131. </script>
  132. {/block}