华清大学特普通奖学金初选报名系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

359 lines
12 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  6. <link rel="icon" type="image/png" href="/img/ord/icon-128.png" />
  7. <link href="https://fonts.yecdn.com/css2?family=Noto+Serif+SC:wght@300;700&display=swap" rel="stylesheet">
  8. <link href="https://fonts.yecdn.com/css2?family=Noto+Sans+SC&display=swap" rel="stylesheet">
  9. <meta property="og:title" content="华清特奖报名" />
  10. <meta property="og:description" content="华清大学特普通奖学金" />
  11. <link href="https://cdn.bootcss.com/twitter-bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet">
  12. <title>华清特奖报名</title>
  13. <style>
  14. body,
  15. pre {
  16. font-family: 'Noto Sans SC', sans-serif;
  17. }
  18. h1,
  19. h2,
  20. h3,
  21. h4,
  22. h5,
  23. h6,
  24. .sort-by{
  25. font-family: 'Noto Serif SC', serif;
  26. font-weight: 300;
  27. }
  28. .sort-by b {
  29. font-weight: 700;
  30. }
  31. a,
  32. a:hover,
  33. .btn-link,
  34. .btn-link:hover {
  35. color: inherit;
  36. text-decoration: underline;
  37. }
  38. nav .page-link {
  39. color: #000;
  40. }
  41. nav .page-item.active .page-link {
  42. background-color: #000;
  43. border-color: #000;
  44. }
  45. .btn-lg {
  46. font-size: 2em;
  47. font-family: 'Noto Serif SC', serif;
  48. }
  49. .part1 {
  50. max-width: 500px;
  51. float: left;
  52. padding-right: 25px;
  53. }
  54. .part2 {
  55. min-width: 200px;
  56. overflow: hidden;
  57. padding-left: 25px;
  58. }
  59. .qbox {
  60. border: 2px black solid;
  61. background: white;
  62. padding: 5px;
  63. color: black;
  64. margin: 5px 5px 40px;
  65. }
  66. .qbox-new {
  67. background: black;
  68. color: white;
  69. }
  70. .qbox-new input,
  71. .qbox-new textarea {
  72. background: black;
  73. color: white;
  74. border: none;
  75. border-bottom: 2px white solid;
  76. border-radius: 0;
  77. }
  78. .qbox .inner {
  79. margin: 15px 0 20px 15px;
  80. white-space: pre-wrap;
  81. }
  82. .like {
  83. fill: #fff;
  84. }
  85. .liked {
  86. fill: #000;
  87. }
  88. .timeago {
  89. font-size: 0.5em;
  90. margin-right: 10px;
  91. }
  92. .display_name {
  93. margin: 0;
  94. }
  95. .card-body {
  96. padding: 0.75em;
  97. }
  98. .new {
  99. overflow: hidden;
  100. position: relative;
  101. margin-bottom: 30px;
  102. }
  103. .new-collapse {
  104. max-height: 360px;
  105. }
  106. .show-mask {
  107. display: block;
  108. position: absolute;
  109. top: 0;
  110. text-align: center;
  111. padding-top: 320px;
  112. width: 100%;
  113. }
  114. .footer {
  115. background: black;
  116. color: white;
  117. text-align: center;
  118. font-size: 80%;
  119. border-top: solid 1px white;
  120. }
  121. .footer p {
  122. margin: 10px 0 0;
  123. float: bottom;
  124. }
  125. </style>
  126. </head>
  127. <body style="background: #fff url('/img/ord/bg.jpg') repeat-x fixed center top / 650px">
  128. <div class="container" style="overflow: hidden;min-height: 100vh">
  129. <div style='padding:15px'>
  130. <img src="/img/ord/logo.png" width="200px" />
  131. </div>
  132. <div class="part1">
  133. <div id="new" class="new new-collapse">
  134. <form action="new" method="post">
  135. <div class="form-group qbox qbox-new">
  136. <h1 style="margin: -14px -13px 20px">自荐提名</h1>
  137. <textarea class="form-control" name="text" rows="5" maxlength="4000" placeholder="
  138. 一段自我陈述,
  139. 向大家展示普通的自己。" required="required"></textarea>
  140. <hr />
  141. <textarea class="form-control" name="privateText" rows="4" maxlength="1000" placeholder="不想公开,但想被评委们看到的内容。
  142. 如想留下联系方式也可放在这里。"></textarea>
  143. <hr />
  144. <div class="form-group row">
  145. <label for="url" class="col-sm-3 col-form-label">补充材料</label>
  146. <div class="col-sm-9">
  147. <input type="url" class="form-control" id="url" name="url" placeholder="清华云盘或safeShare链接,https://开头" pattern="https://(cloud\.tsinghua\.edu\.cn/f/[0-9a-z]+/(\?dl=1)?|closed\.social/safeShare/\d([a-zA-Z]+)?)">
  148. </div>
  149. </div>
  150. <hr />
  151. <hr />
  152. {% for v in vs %}
  153. <div class="form-group row">
  154. <label for="{{v.name}}" class="col-sm-8 col-form-label">{{v.ques}}</label>
  155. <div class="col-sm-4">
  156. <input type="text" class="form-control" id="{{v.name}}" name="{{v.name}}" placeholder="{{v.hint}}" required="required">
  157. </div>
  158. </div>
  159. {% endfor %}
  160. <button type="submit" class="btn btn-link btn-lg">报名</button>
  161. </div>
  162. </form>
  163. <div style="font-size:80%;">
  164. <ul>
  165. <li>初选报名不需要登陆任何帐号,你可以留下联系方式或可验证身份的信息(如公钥/数字签名),也可以不留。</li>
  166. <li>如需附上补充材料,请使用清华云盘。为了避免泄露姓名推荐使用<a href="/safeShare" target="_blank">safeShare</a>。我们不接受其他云盘。</li>
  167. <li>下方的评论来自闭社用户。如需删除自己发布的介绍请让任意一位工作人员评论“删除”。</li>
  168. <li>需要回答几个简单的问题以初步验证身份。入围后的环节将在闭社平台上进行(需清华邮箱注册)以正式验证身份。</li>
  169. <li>建议在电脑上操作以免丢失未保存的内容。如果出错(例如验证问题答错了),请回退,多数浏览器都会恢复之前填写的内容。</li>
  170. </ul>
  171. </div>
  172. <a href="##" onclick="showNew()" class="show-mask">
  173. <span><svg fill="#fff" viewBox="0 12 24 48" width="24">
  174. <path d="m0 24 l12 18 l12 -18 z"></path>
  175. </svg></span>
  176. </a>
  177. </div>
  178. <script>
  179. function showNew() {
  180. $('#new').removeClass('new-collapse');
  181. $('.show-mask').hide();
  182. }
  183. </script>
  184. </div>
  185. <div class="part2" id="part2">
  186. <div style="display:flex;justify-content:space-between;align-items: flex-end">
  187. <h1>已有报名</h1>
  188. <span style="margin:8px" class="sort-by">
  189. {% if sort_by == 'likeNum' %}
  190. <a href="?sort_by=time#part2">按时间</a> | <b>按赞数</b>
  191. {% else %}
  192. <b>按时间</b> | <a href="?sort_by=likeNum#part2">按赞数</a>
  193. {% endif %}
  194. </span>
  195. </div>
  196. {% for c in pagination.items %}
  197. <div class="qbox">
  198. <small>#{{c.id}}</small>
  199. <pre class="inner">{{c.content}}</pre>
  200. {% if showPrivate %}
  201. <hr />
  202. <pre class="inner">{{c.private}}</pre>
  203. <hr />
  204. {% endif %}
  205. {% if c.url %}
  206. <p class="inner"><a href="{{c.url}}" target="_black">补充材料</a></p>
  207. {% endif %}
  208. <div style="text-align:right;margin: 27px 0 -5px">
  209. <time class="timeago" datetime="{{c.time}}"></time>
  210. <a href="##" class="btn btn-link" id="like-{{c.toot}}" onClick="like('{{c.toot}}')" style="text-decoration: none;">
  211. <svg viewBox="-20 0 552 512" height="16" class="{{c.liked}}">
  212. <path stroke="#000" stroke-width="30" d="M474.644,74.27C449.391,45.616,414.358,29.836,376,29.836c-53.948,0-88.103,32.22-107.255,59.25
  213. c-4.969,7.014-9.196,14.047-12.745,20.665c-3.549-6.618-7.775-13.651-12.745-20.665c-19.152-27.03-53.307-59.25-107.255-59.25
  214. c-38.358,0-73.391,15.781-98.645,44.435C13.267,101.605,0,138.213,0,177.351c0,42.603,16.633,82.228,52.345,124.7
  215. c31.917,37.96,77.834,77.088,131.005,122.397c19.813,16.884,40.302,34.344,62.115,53.429l0.655,0.574
  216. c2.828,2.476,6.354,3.713,9.88,3.713s7.052-1.238,9.88-3.713l0.655-0.574c21.813-19.085,42.302-36.544,62.118-53.431
  217. c53.168-45.306,99.085-84.434,131.002-122.395C495.367,259.578,512,219.954,512,177.351
  218. C512,138.213,498.733,101.605,474.644,74.27z" />
  219. </svg>
  220. <span>
  221. {{c.likeNum}}
  222. </span>
  223. </a>
  224. <a class="btn btn-link request-answer" data-toggle="collapse" href="#collapse-{{c.toot}}" role="button" aria-expanded="false" aria-controls="collapse-{{c.toot}}">
  225. <svg fill="#000" viewBox="0 24 24 20" height="16">
  226. <path d="m0 24 l12 18 l12 -18 z"></path>
  227. </svg>
  228. </a>
  229. </div>
  230. <div class="collapse" id="collapse-{{c.toot}}">
  231. <div class="card card-body">
  232. 加载中...
  233. </div>
  234. </div>
  235. </div>
  236. {% endfor %}
  237. <nav>
  238. <ul class="pagination">
  239. {%- for page in pagination.iter_pages() %}
  240. {% if page %}
  241. {% if page != pagination.page %}
  242. <li class="page-item"><a class="page-link" href="{{ url_for('can_list', page=page, per_page=pagination.per_page, key=key, sort_by=sort_by) }}">{{ page }}</a></li>
  243. {% else %}
  244. <li class="page-item active">
  245. <a class="page-link" href="#">{{ page }}<span class="sr-only">(current)</span></a>
  246. </li>
  247. {% endif %}
  248. {% else %}
  249. <li class="page-item"><span class=ellipsis></span></li>
  250. {% endif %}
  251. {%- endfor %}
  252. </ul>
  253. </nav>
  254. </div>
  255. </div>
  256. <div class="footer">
  257. <p>
  258. <a href="//closed.social" target="_blank">闭社</a>提供技术支持
  259. </p>
  260. <p> 🄯 2020 Copyleft: closed.social</p>
  261. </div>
  262. </body>
  263. <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
  264. <script src="https://cdn.bootcss.com/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
  265. <script src="https://cdn.bootcdn.net/ajax/libs/jquery-timeago/1.6.7/jquery.timeago.min.js"></script>
  266. <script src="https://cdn.bootcdn.net/ajax/libs/jquery-timeago/1.6.7/locales/jquery.timeago.zh-CN.js"></script>
  267. <script>
  268. function like(toot) {
  269. if ($(`#like-${toot} svg`).hasClass("liked")) {
  270. alert('赞都赞了,别撤回嘛');
  271. return;
  272. }
  273. $.ajax({
  274. type: 'POST',
  275. url: toot + '/like',
  276. success: (result, status, xhr) => {
  277. console.log(result + ' : ' + status);
  278. $(`#like-${toot} span`).text(result);
  279. $(`#like-${toot} svg`).toggleClass("like liked");
  280. },
  281. error: (xhr, status, error) => {
  282. alert(error + ': ' + xhr.responseText);
  283. }
  284. });
  285. }
  286. $(document).ready(function(){
  287. $('.timeago').timeago();
  288. $('.collapse').on('show.bs.collapse', (e) => {
  289. let self = e.target;
  290. let toot = self.id.split('-')[1];
  291. $.ajax({
  292. type: 'GET',
  293. url: toot + '/comments',
  294. success: (result, status, xhr) => {
  295. if (result.replies.length) {
  296. $(self).empty();
  297. result.replies.forEach((rp) => {
  298. $(self).append(`<div class="card card-body"><p class="display_name"><a href="${rp.url}">${rp.disp}</a>:</p><pre class="inner">${rp.content}</pre><time class="timeago" datetime="${rp.time}"></time></div>`)
  299. });
  300. $(self).find('.timeago').timeago();
  301. } else {
  302. $(self).empty();
  303. $(self).append(`<div class="card card-body">(暂无评论)</div>`)
  304. }
  305. },
  306. error: (xhr, status, error) => {
  307. console.log(error, status, xhr.status, xhr.responseText);
  308. $(self).empty();
  309. $(self).append(`<div class="card card-body"><p style="color:red">${xhr.status} ${xhr.responseText}</p></div>`);
  310. if (xhr.status == 404)
  311. setTimeout(() => {
  312. $(self).parent().remove()
  313. }, 3000);
  314. }
  315. });
  316. });
  317. });
  318. </script>
  319. </html>