add.html 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <include file="public@header" />
  2. </head>
  3. <body>
  4. <div class="wrap">
  5. <ul class="nav nav-tabs">
  6. <li ><a href="{:url('Guide/index')}">列表</a></li>
  7. <li class="active"><a >添加</a></li>
  8. </ul>
  9. <form method="post" class="form-horizontal js-ajax-form margin-top-20" action="{:url('Guide/add_post')}">
  10. <fieldset>
  11. <input type="hidden" name="type" value="{$type}">
  12. <div class="form-group" >
  13. <label for="input-orderno" class="col-sm-2 control-label"><span class="form-required">*</span>序号</label>
  14. <div class="col-md-6 col-sm-10">
  15. <input type="text" class="form-control" id="input-orderno" name="orderno" value="0">
  16. </div>
  17. </div>
  18. <if condition="$type eq 0">
  19. <div class="form-group">
  20. <label for="input-user_login" class="col-sm-2 control-label"><span class="form-required">*</span>图片</label>
  21. <div class="col-md-6 col-sm-10">
  22. <input type="hidden" name="thumb" id="thumbewm" value="">
  23. <a href="javascript:uploadOneImage('图片上传','#thumbewm');">
  24. <img src="__TMPL__/public/assets/images/default-thumbnail.png" id="thumbewm-preview" style="cursor: pointer;max-width:150px;max-height:150px;"/>
  25. </a>
  26. <input type="button" class="btn btn-sm btn-cancel-thumbewm" value="取消图片">
  27. </div>
  28. </div>
  29. </if>
  30. <if condition="$type eq 1">
  31. <div class="form-group">
  32. <label for="input-user_login" class="col-sm-2 control-label"><span class="form-required">*</span>视频</label>
  33. <div class="col-md-6 col-sm-10">
  34. <input type="text" id="thumb3" value="" style="width:500px;display: inline-block;" class="form-control" />
  35. <input type="file" name="file" style="display: inline-block;" />
  36. <input type="button" class="btn btn-small" onclick="$('#thumb3').val('');return false;" value="取消"> 仅限MP4格式 10M以内
  37. <span class="form-required"></span>
  38. </div>
  39. </div>
  40. </if>
  41. <div class="form-group" >
  42. <label for="input-href" class="col-sm-2 control-label">链接</label>
  43. <div class="col-md-6 col-sm-10">
  44. <input type="text"class="form-control" id="input-href" name="href" value="">点击打开的页面链接 http开头
  45. </div>
  46. </div>
  47. </fieldset>
  48. <div class="form-group">
  49. <div class="col-sm-offset-2 col-sm-10">
  50. <button type="submit" class="btn btn-primary js-ajax-submit">{:lang('ADD')}</button>
  51. <a class="btn btn-default" href="javascript:history.back(-1);">{:lang('BACK')}</a>
  52. </div>
  53. </div>
  54. </form>
  55. </div>
  56. <script src="__STATIC__/js/admin.js"></script>
  57. <script type="text/javascript">
  58. (function(){
  59. $("#swftype label.radio").on('click',function(){
  60. var v=$("input",this).val();
  61. var b=$("#swftype_bd_"+v);
  62. b.siblings().hide();
  63. b.show();
  64. });
  65. $('.btn-cancel-thumbewm').click(function () {
  66. $('#thumbewm-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
  67. $('#thumbewm').val('');
  68. });
  69. })()
  70. </script>
  71. </body>
  72. </html>