a_researchtopic_edit.html 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. {% extends 'admin/a_admindefault.html' %}
  2. {% block mycss%}
  3. <script src="//cdn.ckeditor.com/4.4.6/full/ckeditor.js"></script>
  4. <script type="text/javascript" src="/static/js/jquery-1.7.2.min.js"></script>
  5. <script type="text/javascript">
  6. //选择图片
  7. $(function(){
  8. $("#file_proimg").change(function(){
  9. //alert($(this).val());
  10. $("#txt_RTImage").val($(this).val());
  11. var objUrl=getObjectURL(this.files[0]);
  12. //console.log("objUrl="+objUrl);
  13. if(objUrl){
  14. $("#img_proimg").attr("src",objUrl);
  15. $("#file_proimg").attr("src",objUrl);
  16. }
  17. })
  18. //建立一個可存取到該file的url
  19. function getObjectURL(file) {
  20. var url = null ;
  21. if (window.createObjectURL!=undefined) {
  22. url = window.createObjectURL(file) ;
  23. } else if (window.URL!=undefined) {
  24. url = window.URL.createObjectURL(file) ;
  25. } else if (window.webkitURL!=undefined) {
  26. url = window.webkitURL.createObjectURL(file) ;
  27. }
  28. return url ;
  29. }
  30. })
  31. </script>
  32. {% endblock %}
  33. {% block middle %}
  34. <div class="content">
  35. <div class="page-inner">
  36. <div class="page-header">
  37. <h4 class="page-title">
  38. {% if status=='edit' %}编辑 &nbsp;
  39. {% elif status=='add' %}添加
  40. {% else %}查看
  41. {% endif %}研究课题
  42. </h4>
  43. </div>
  44. <div class="row">
  45. <div class="col-md-12">
  46. {% with messages = get_flashed_messages() %}
  47. {% if messages %}
  48. {% for message in messages %}
  49. <p>{{ message }}</p>
  50. {% endfor %}
  51. {% endif %}
  52. {% endwith %}
  53. <form action="/editresearchtopic.do" method="post" enctype="multipart/form-data">
  54. <div class="modal-body">
  55. <input type="hidden" name="lbl_status" value="{{status}}" />
  56. <input type="hidden" name="lbl_RTID" {% if status =='add' %} {% else %} value="{{researchtopic[0]}} " {% endif %} />
  57. <div class="row">
  58. <div class="col-sm-12">
  59. <div class="form-group form-group-default">
  60. <label>研究领域</label>
  61. <select name="txt_RAID" class="form-control">
  62. {% for row in researcharea %}
  63. <option value="{{row[0]}}" {% if status =='edit' %} {%if row[0] == researchtopic[1] %} selected = selected {% else %} {% endif %}{% endif %}>{{row[1]}}</option>
  64. {% endfor %}
  65. </select>
  66. </div>
  67. </div>
  68. <div class="col-sm-12">
  69. <div class="form-group form-group-default">
  70. <label>课题中文名: </label>
  71. <input name="txt_RTNameCN" type="text" class="form-control" placeholder="填写课题中文名"
  72. {% if status =='add' %} value="" {% else %} value="{{researchtopic[2]}}" {% endif %} />
  73. </div>
  74. </div>
  75. <div class="col-sm-12">
  76. <div class="form-group form-group-default">
  77. <label>课题英文名: </label>
  78. <input name="txt_RTNameEN" type="text" class="form-control" placeholder="填写课题英文名"
  79. {% if status =='add' %} value="" {% else%} value="{{researchtopic[3]}}" {%endif %} />
  80. </div>
  81. </div>
  82. <div class="col-sm-12">
  83. <div class="form-group form-group-default">
  84. <label>中文摘要: </label>
  85. <textarea name="txt_RTAbstractCN" rows="5" cols="80" style="width:100%">{% if status =='add' %} {% else%}{{researchtopic[4]}}{%endif %}</textarea>
  86. </div>
  87. </div>
  88. <div class="col-sm-12">
  89. <div class="form-group form-group-default">
  90. <label>英文摘要: </label>
  91. <textarea name="txt_RTAbstractEN" rows="5" cols="80" style="width:100%">{% if status =='add' %} {% else%}{{researchtopic[5]}}{%endif %}</textarea>
  92. </div>
  93. </div>
  94. <div class="col-sm-12">
  95. <div class="form-group form-group-default">
  96. <label>图片链接: </label>
  97. <input id="file_proimg" name="file_proimg" type="file" size="30"/>
  98. <input id="txt_RTImage" name="txt_RTImage" type="text" class="form-control" placeholder="填写图片链接"
  99. {% if status =='add' %} value="" {% else %} value="{{researchtopic[6]}}" {% endif %}/>
  100. <img id="img_proimg" name="img_proimg" style="height:100px; width:200px" {% if status =='add' %} src="" {% else %} src="/{{researchtopic[6]}}"{% endif %}/>
  101. </div>
  102. </div>
  103. <div class="col-sm-12">
  104. <div class="form-group form-group-default">
  105. <label>课题内容: </label>
  106. <textarea name="txt_RTContent" id="txt_RTContent" class="ckeditor" rows="10" cols="80">
  107. {% if status =='add' %} {% else%}{{researchtopic[7]}}{%endif %}
  108. </textarea>
  109. </div>
  110. </div>
  111. <div class="col-sm-6">
  112. <div class="form-group form-group-default">
  113. <label>排序: </label>
  114. <select name="txt_RTOrder" class="form-control">
  115. <option value="1" {% if status =='edit' %} {% if researchtopic[8] ==1 %} selected {%endif %} {%endif %}>1</option>
  116. <option value="2" {% if status =='edit' %} {% if researchtopic[8] ==2 %} selected {%endif %} {%endif %}>2</option>
  117. <option value="3" {% if status =='edit' %} {% if researchtopic[8] ==3 %} selected {%endif %} {%endif %}>3</option>
  118. <option value="4" {% if status =='edit' %} {% if researchtopic[8] ==4 %} selected {%endif %} {%endif %}>4</option>
  119. <option value="5" {% if status =='edit' %} {% if researchtopic[8] ==5 %} selected {%endif %} {%endif %}>5</option>
  120. <option value="6" {% if status =='edit' %} {% if researchtopic[8] ==6 %} selected {%endif %} {%endif %}>6</option>
  121. <option value="7" {% if status =='edit' %} {% if researchtopic[8] ==7 %} selected {%endif %} {%endif %}>7</option>
  122. <option value="8" {% if status =='edit' %} {% if researchtopic[8] ==8 %} selected {%endif %} {%endif %}>8</option>
  123. <option value="9" {% if status =='edit' %} {% if researchtopic[8] ==9 %} selected {%endif %} {%endif %}>9</option>
  124. <option value="10" {% if status =='edit' %} {% if researchtopic[8] ==10 %} selected {%endif %} {%endif %}>10</option>
  125. </select>
  126. </div>
  127. </div>
  128. <div class="col-sm-6">
  129. <div class="form-group form-group-default">
  130. <label>状态: </label>
  131. <select name="txt_RTStatus" class="form-control">
  132. <option value="1" {% if status =='edit' %} {% if researchtopic[9] ==1 %} selected {%endif %} {%endif %}>显示</option>
  133. <option value="2" {% if status =='edit' %} {% if researchtopic[9] ==2 %} selected {%endif %} {%endif %}>不显示</option>
  134. </select>
  135. </div>
  136. </div>
  137. </div>
  138. </div>
  139. <div class="modal-footer no-bd">
  140. {% if status=='view' %} &nbsp;
  141. {% else%}
  142. <button type="submit" class="btn btn-primary">保存课题信息</button>
  143. {% endif %}
  144. <a href="/researchtopicmanage" >
  145. <button type="button" class="btn btn-danger" data-dismiss="modal" >关闭</button>
  146. </a>
  147. </div>
  148. </form>
  149. </div>
  150. </div>
  151. </div>
  152. </div>
  153. </div>
  154. {% endblock %}