a_paper_edit.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  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=='add' %}
  39. 添加论文信息
  40. {% elif status=='edit' %}
  41. 编辑论文信息
  42. {% endif %}</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="/editpaperinfo.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_PaperID" {% if status=='edit' %} value="{{paperinfo[0]}}"
  57. {%endif%}/>
  58. <div class="row">
  59. <div class="col-sm-12">
  60. <div class="form-group form-group-default">
  61. <label>
  62. 所属课题</label>
  63. {% if status=='add' %}
  64. <select name="txt_RTID" class="form-control">
  65. {% for row in researchtopic %}
  66. <option value="{{row[0]}}">{{row[2]}}</option>
  67. {% endfor %}
  68. </select>
  69. {% elif status=='edit' %}
  70. <select name="txt_RTID" class="form-control">
  71. {% for row in researchtopic %}
  72. <option value="{{row[0]}}" {% if paperinfo[1]== row[0] %} selected {% else%}
  73. {%endif%}>{{row[2]}}
  74. </option>
  75. {% endfor %}
  76. </select>
  77. {% endif %}
  78. </div>
  79. </div>
  80. <div class="col-sm-12">
  81. <div class="form-group form-group-default">
  82. <label>
  83. 论文标题: </label>
  84. <input name="txt_PTitle" type="text" class="form-control" placeholder="填写论文标题" {% if
  85. status=='edit' %} value="{{paperinfo[2]}}" {%endif%}>
  86. </div>
  87. </div>
  88. <div class="col-sm-12">
  89. <div class="form-group form-group-default">
  90. <label>
  91. 论文摘要: </label>
  92. <textarea name="txt_PAbstract" rows="8" cols="20" style="width: 100%" >{% if status=='edit' %} {{paperinfo[3]}} {%endif%}</textarea>
  93. </div>
  94. </div>
  95. <div class="col-sm-12">
  96. <div class="form-group form-group-default">
  97. <label>
  98. 论文封面图片: </label>
  99. <input id="file_proimg" name="file_proimg" type="file" size="30"/>
  100. <input id="txt_PImage" name="txt_PImage" type="text" class="form-control" placeholder="请上传论文摘要图片"
  101. {% if status =='add' %} value="" {% else %} value="{{paperinfo[4]}}" {% endif %}/>
  102. <img id="img_proimg" name="img_proimg" style="height:100px; width:200px" {% if status =='add' %} src="" {% else %} src="/{{paperinfo[4]}}"{% endif %}/>
  103. </div>
  104. </div>
  105. <div class="col-sm-12">
  106. <div class="form-group form-group-default">
  107. <label>
  108. 论文内容: </label>
  109. <textarea name="txt_PContent" id="txt_PConent" class="ckeditor" rows="10" cols="80">
  110. {% if status=='edit' %} {{paperinfo[5]}} {%endif%}
  111. </textarea>
  112. </div>
  113. </div>
  114. <div class="col-sm-6">
  115. <div class="form-group form-group-default">
  116. <label>发表类型</label>
  117. <input name="txt_PubType" type="radio" value="1" checked {% if status=='edit' %} {%
  118. if paperinfo[6]==1 %} checked {%endif %} {%endif %}>期刊论文
  119. <input name="txt_PubType" type="radio" value="2" {% if status=='edit' %} {% if
  120. paperinfo[6]==2 %} checked {%endif %} {%endif %}>会议论文
  121. <input name="txt_PubType" type="radio" value="3" {% if status=='edit' %} {% if
  122. paperinfo[6]==3 %} checked {%endif %} {%endif %}>学术专著
  123. </div>
  124. </div>
  125. <div class="col-sm-6">
  126. <div class="form-group form-group-default">
  127. <label>
  128. 发表期刊/会议名称: </label>
  129. <input name="txt_Publisher" type="text" class="form-control" placeholder="填写发表期刊/会议"
  130. {% if status=='edit' %} value="{{paperinfo[7]}}" {%endif%}>
  131. </div>
  132. </div>
  133. <div class="col-sm-6">
  134. <div class="form-group form-group-default">
  135. <label>
  136. 期刊/会议简称: </label>
  137. <input name="txt_Publisher2" type="text" class="form-control" placeholder="例如:IEEE TPDS">
  138. </div>
  139. </div>
  140. <div class="col-sm-6">
  141. <div class="form-group form-group-default">
  142. <label>
  143. 卷号期号页码: </label>
  144. <input name="txt_Pages" type="text" class="form-control" placeholder="填写卷号、期号、页码信息"
  145. {% if status=='edit' %} value="{{paperinfo[8]}}" {%endif%}>
  146. </div>
  147. </div>
  148. <div class="col-sm-6">
  149. <div class="form-group form-group-default">
  150. <label>
  151. 发表年份: </label>
  152. <input name="txt_PubYear" type="text" class="form-control" placeholder="填写发表年份" {%
  153. if status=='edit' %} value="{{paperinfo[9]}}" {%endif%}>
  154. </div>
  155. </div>
  156. <div class="col-sm-6">
  157. <div class="form-group form-group-default">
  158. <label>
  159. 作者列表: </label>
  160. <input name="txt_Authors" type="text" class="form-control"
  161. placeholder="填写作者列表,用英文逗号隔开" {% if status=='edit' %}
  162. value="{{paperinfo[10]}}" {%endif%}>
  163. </div>
  164. </div>
  165. <div class="col-sm-6">
  166. <div class="form-group form-group-default">
  167. <label>
  168. 全文链接: </label>
  169. <input name="txt_PubLink" type="text" class="form-control" placeholder="请填写论文全文链接地址"
  170. {% if status=='edit' %} value="{{paperinfo[11]}}" {%endif%}>
  171. </div>
  172. </div>
  173. <div class="col-sm-6">
  174. <div class="form-group form-group-default">
  175. <label>
  176. arXiv链接: </label>
  177. <input name="txt_ArxivLink" type="text" class="form-control"
  178. placeholder="请填写arXiv地址" {% if status=='edit' %} value="{{paperinfo[12]}}"
  179. {%endif%}>
  180. </div>
  181. </div>
  182. <div class="col-sm-6">
  183. <div class="form-group form-group-default">
  184. <label>
  185. 代码链接: </label>
  186. <input name="txt_CodeLink" type="text" class="form-control" placeholder="请填写代码链接地址"
  187. {% if status=='edit' %} value="{{paperinfo[13]}}" {%endif%}>
  188. </div>
  189. </div>
  190. <div class="col-sm-6">
  191. <div class="form-group form-group-default">
  192. <label>论文发表状态:</label>
  193. <select id="txt_PubStatus" name="txt_PubStatus" class="form-control">
  194. <option value="1" {% if status=='edit' %} {% if paperinfo[14]==1 %} selected {%
  195. else %} {% endif%} {% endif%}>已发表
  196. </option>
  197. <option value="2" {% if status=='edit' %} {% if paperinfo[14]==2 %} selected {%
  198. else %} {% endif%} {% endif%}>已录用
  199. </option>
  200. <option value="3" {% if status=='edit' %} {% if paperinfo[14]==3 %} selected {%
  201. else %} {% endif%} {% endif%}>已投稿
  202. </option>
  203. </select>
  204. </div>
  205. </div>
  206. <div class="col-sm-6">
  207. <div class="form-group form-group-default">
  208. <label>显示状态:</label>
  209. <select id="txt_PStatus" name="txt_PStatus" class="form-control">
  210. <option value="1" {% if status=='edit' %} {% if paperinfo[15]==1 %} selected {%
  211. else %} {% endif%} {% endif%}>显示
  212. </option>
  213. <option value="0" {% if status=='edit' %} {% if paperinfo[15]==0 %} selected {%
  214. else %} {% endif%} {% endif%}>不显示
  215. </option>
  216. </select>
  217. </div>
  218. </div>
  219. </div>
  220. </div>
  221. <div class="modal-footer no-bd">
  222. <button type="submit" class="btn btn-primary">
  223. 保存
  224. </button>
  225. <a href="/paperinfomanage">
  226. <button type="button" class="btn btn-danger" data-dismiss="modal">
  227. 返回
  228. </button>
  229. </a>
  230. </div>
  231. </form>
  232. </div>
  233. </div>
  234. </div>
  235. </div>
  236. </div>
  237. {% endblock %}