add.html 7.8 KB

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