简化版的mastodon web client
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.

493 lines
16 KiB

  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. <script>
  14. if(navigator.userAgent.search('MicroMessenger') !== -1)
  15. location.href = `https://closed.social/tools/safe_jump/?go=${encodeURIComponent(location.href)}&t=${encodeURIComponent('华清大学特普通奖学金')}`;
  16. </script>
  17. <style>
  18. body {
  19. background: linear-gradient(-45deg, #fff calc(50% - 1px), #eee calc(50%), #fff calc(50% + 1px) );
  20. background-size: 6px 5px;
  21. font-family: 'Noto Sans SC', sans-serif;
  22. }
  23. body,
  24. pre {
  25. font-family: 'Noto Sans SC', sans-serif;
  26. }
  27. h1,
  28. h2,
  29. h3,
  30. h4,
  31. h5,
  32. h6,
  33. .sort-by{
  34. font-family: 'Noto Serif SC', serif;
  35. font-weight: 300;
  36. }
  37. .sort-by b {
  38. font-weight: 700;
  39. }
  40. a,
  41. a:hover,
  42. .btn-link,
  43. .btn-link:hover {
  44. color: inherit;
  45. text-decoration: underline;
  46. }
  47. nav .page-link {
  48. color: #000;
  49. }
  50. nav .page-item.active .page-link {
  51. background-color: #000;
  52. border-color: #000;
  53. }
  54. .btn-lg {
  55. font-size: 2em;
  56. font-family: 'Noto Serif SC', serif;
  57. }
  58. .verify-box {
  59. padding: 20px;
  60. background-color: #8884;
  61. margin: 20px;
  62. }
  63. .step2-info{
  64. background-color: #eee9;
  65. padding: 10px;
  66. overflow: hidden;
  67. }
  68. {% if step2 %}
  69. @media screen and (max-width: 600px) {
  70. .part1 {
  71. display: none;
  72. }
  73. }
  74. {% endif %}
  75. .part1 {
  76. max-width: 500px;
  77. float: left;
  78. padding-right: 10px;
  79. position: relative;
  80. }
  81. .part2 {
  82. min-width: 200px;
  83. overflow: hidden;
  84. padding-left: 25px;
  85. }
  86. .qbox {
  87. border: 2px black solid;
  88. background: white;
  89. padding: 5px;
  90. color: black;
  91. margin: 5px 5px 40px;
  92. }
  93. .qbox.qbox-grey {
  94. background: #eee;
  95. }
  96. .new .qbox {
  97. background: black;
  98. color: white;
  99. }
  100. .judge .qbox {
  101. background: white;
  102. color: black;
  103. padding: 5px 15px;
  104. }
  105. .twin.new .qbox input,
  106. .twin.new .qbox textarea {
  107. border-bottom: 2px solid;
  108. background: black;
  109. color: white;
  110. }
  111. .verify-box input {
  112. background: #0000;
  113. padding: 0;
  114. }
  115. .verify-box input,
  116. .twin .qbox input,
  117. .twin .qbox textarea {
  118. border: none;
  119. border-bottom: 1px solid;
  120. border-radius: 0;
  121. }
  122. .qbox .inner {
  123. margin: 15px 0 20px 15px;
  124. white-space: pre-wrap;
  125. }
  126. .like {
  127. fill: #fff;
  128. }
  129. .liked {
  130. fill: #000;
  131. }
  132. .timeago {
  133. font-size: 0.5em;
  134. margin-right: 10px;
  135. }
  136. .display_name {
  137. margin: 0;
  138. }
  139. .card-body {
  140. padding: 0.75em;
  141. }
  142. .behind {
  143. z-index: 98;
  144. cursor: pointer;
  145. transform: translateY(5px) scale(0.98);
  146. transform-origin: top;
  147. transition-property: transform;
  148. transition-duration: 0.5s;
  149. }
  150. .front {
  151. z-index: 99;
  152. transition-property: transform;
  153. transition-duration: 0.5s;
  154. }
  155. .judge {
  156. position: absolute;
  157. top: 0;
  158. right: 0;
  159. margin: 0 0 30px 20px;
  160. width: 90%;
  161. }
  162. .twin {
  163. overflow: hidden;
  164. }
  165. .new {
  166. position: relative;
  167. margin: 30px 20px 30px 0;
  168. }
  169. .twin-collapse {
  170. max-height: 360px;
  171. }
  172. .show-mask {
  173. display: block;
  174. position: absolute;
  175. top: 20px;
  176. right: 35px;
  177. text-align: center;
  178. padding-top: 330px;
  179. width: 100%;
  180. z-index: 999;
  181. }
  182. .footer {
  183. background: black;
  184. color: white;
  185. text-align: center;
  186. font-size: 80%;
  187. border-top: solid 1px white;
  188. }
  189. .footer p {
  190. margin: 10px 0 0;
  191. float: bottom;
  192. }
  193. @keyframes loop {
  194. 0% {
  195. transform: translateX(100%);
  196. }
  197. 100% {
  198. transform: translateX(-50%);
  199. }
  200. }
  201. </style>
  202. </head>
  203. <body>
  204. <div class="container" style="overflow: hidden;min-height: 100vh">
  205. <div style='padding:15px'>
  206. <img src="/img/ord/logo.png" width="200px" />
  207. </div>
  208. <div class="part1">
  209. {% if not verified %}
  210. <form action="verify" method="post" class="verify-box">
  211. <p>提名阶段已经结束,不过完成简易验证后,你依然可以于此畅所欲言或加入评委群。</p>
  212. <hr>
  213. {% for v in vs %}
  214. <div class="form-group row">
  215. <label for="{{v.name}}" class="col-sm-8 col-form-label">{{v.ques}}</label>
  216. <div class="col-sm-4">
  217. <input type="text" class="form-control" name="{{v.name}}" placeholder="{{v.hint}}" required="required">
  218. </div>
  219. </div>
  220. {% endfor %}
  221. <button type="submit" class="btn btn-link btn-lg">提交</button>
  222. </form>
  223. {% else %}
  224. <div id="new" class="new twin front">
  225. <form action="new" method="post">
  226. <div class="form-group qbox">
  227. <h1 style="margin: -14px -13px 20px">自荐提名</h1>
  228. <textarea class="form-control" name="text" rows="5" maxlength="4000" placeholder="{{text1}}" required="required"></textarea>
  229. <hr />
  230. <textarea class="form-control" name="privateText" rows="4" maxlength="1000" placeholder="{{text2}}"></textarea>
  231. <hr />
  232. <div class="form-group row">
  233. <label for="url" class="col-sm-3 col-form-label">补充材料</label>
  234. <div class="col-sm-9">
  235. <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]+)?)">
  236. </div>
  237. </div>
  238. <button type="submit" class="btn btn-link btn-lg">报名</button>
  239. </div>
  240. </form>
  241. <div style="font-size:80%;">
  242. <ul>
  243. <li>如需附上补充材料,请使用清华云盘。为了避免泄露姓名推荐使用<a href="/safeShare" target="_blank">safeShare</a>。其他云盘是不被接受的。</li>
  244. <li>需要回答几个简单的问题以初步验证学生身份,入围后的线上答辩环节将于<a href="https://thu.closed.social/">闭社</a>平台进行(需清华邮箱注册)以正式验证身份。</li>
  245. <li>获得五个赞并留下联系方式(如微信号、手机号或邮箱)者被视为正式提名,会有工作人员与之联系并发放奖品。</li>
  246. <li>点击倒三角按钮展开评论,发布评论请前往<a href="https://thu.closed.social/">闭社</a></li>
  247. <li>如需删除报名,请联系工作人员(微信:ordinary_thuer)。</li>
  248. </ul>
  249. </div>
  250. </div>
  251. <div class="judge twin behind">
  252. <form action="judge" method="post">
  253. <div class="form-group qbox">
  254. <h1 style="text-align:right;margin:-12px -20px 16px">成为评委</h1>
  255. <div style="font-size:80%">
  256. <p>为了更好地选出十位普通人的代表,为了更好地展现大众的声音,我们希望招募更多的评委。</p>
  257. <p>成为评委的条件:</p>
  258. <ul>
  259. <li>是华清大学在读学生</li>
  260. <li>没有报名参选</li>
  261. <li>愿意对报名者进行评分</li>
  262. </ul>
  263. <p>我们原则上不拒绝任何的评委报名。</p>
  264. <p>目前在三个平台上建了三个评委群,分别是闭聊(Matrix),Telegram,微信。前两个消息自动同步,加入哪个都是等价的,微信群与另外两个群不连通。(注意Telegram墙内不可直接访问。闭聊由闭社提供,使用闭社帐号登陆,如使用其他服务器上的Matrix帐号加群需要验证华清身份。)</p>
  265. <p>选择想加入的群,完成验证,进入评委群。如果不愿意加群,也可以私信主办方保持沟通和上传打分结果。</p>
  266. </div>
  267. <div style="text-align:center">
  268. <div class="form-check form-check-inline">
  269. <input class="form-check-input" type="radio" name="groupType" value="mx" required>
  270. <label class="form-check-label" for="mx">闭聊</label>
  271. </div>
  272. <div class="form-check form-check-inline">
  273. <input class="form-check-input" type="radio" name="groupType" value="tg" required>
  274. <label class="form-check-label" for="tg">Telegram</label>
  275. </div>
  276. <div class="form-check form-check-inline">
  277. <input class="form-check-input" type="radio" name="groupType" value="wx" required>
  278. <label class="form-check-label" for="wx">微信</label>
  279. </div>
  280. </div>
  281. <button type="submit" class="btn btn-link btn-lg">进群</button>
  282. </div>
  283. </form>
  284. </div>
  285. {% endif %}
  286. </div>
  287. <div class="part2" id="part2">
  288. <div style="display:flex;justify-content:space-between;align-items: flex-end">
  289. <h1>已有报名</h1>
  290. <span style="margin:8px" class="sort-by">
  291. {% if final_list %}
  292. <a href="?sort_by={{sort_by}}&final_list=#part2">全部</a> | <b>仅入围</b>
  293. {% else %}
  294. <b>全部</b> | <a href="?sort_by={{sort_by}}&final_list=1#part2">仅入围</a>
  295. {% endif %}
  296. <br>
  297. {% if sort_by == 'likeNum' %}
  298. <a href="?sort_by=time&final_list={{final_list}}#part2">按时间</a> | <b>按赞数</b>
  299. {% else %}
  300. <b>按时间</b> | <a href="?sort_by=likeNum&final_list={{final_list}}#part2">按赞数</a>
  301. {% endif %}
  302. </span>
  303. </div>
  304. {% for c in pagination.items %}
  305. <div class="qbox {{'qbox-grey' if step2.get('end') and c.id > step2['end'] else ''}}">
  306. <small>No. {{c.id}}</small>
  307. <pre class="inner">{{c.content}}</pre>
  308. {% if showPrivate %}
  309. <hr />
  310. <pre class="inner">{{c.private}}</pre>
  311. <hr />
  312. {% endif %}
  313. {% if c.url %}
  314. <p class="inner"><a href="{{c.url}}" target="_black">补充材料</a></p>
  315. {% endif %}
  316. <div style="text-align:right;margin: 27px 0 -5px">
  317. <time class="timeago" datetime="{{c.time}}"></time>
  318. <a href="##" class="btn btn-link" id="like-{{c.toot}}" onClick="like('{{c.toot}}')" style="text-decoration: none;">
  319. <svg viewBox="-20 0 552 512" height="16" class="{{c.liked}}">
  320. <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
  321. 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
  322. 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
  323. 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
  324. 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
  325. c53.168-45.306,99.085-84.434,131.002-122.395C495.367,259.578,512,219.954,512,177.351
  326. C512,138.213,498.733,101.605,474.644,74.27z" />
  327. </svg>
  328. <span>
  329. {{c.likeNum}}
  330. </span>
  331. </a>
  332. <a class="btn btn-link request-answer" data-toggle="collapse" href="#collapse-{{c.toot}}" role="button" aria-expanded="false" aria-controls="collapse-{{c.toot}}">
  333. <svg fill="#000" viewBox="0 24 24 20" height="16">
  334. <path d="m0 24 l12 18 l12 -18 z"></path>
  335. </svg>
  336. </a>
  337. </div>
  338. <div class="collapse" id="collapse-{{c.toot}}">
  339. <div class="card card-body">
  340. 加载中...
  341. </div>
  342. </div>
  343. </div>
  344. {% endfor %}
  345. <nav>
  346. <ul class="pagination">
  347. {%- for page in pagination.iter_pages(left_edge=2, left_current=1, right_current=3, right_edge=2) %}
  348. {% if page %}
  349. {% if page != pagination.page %}
  350. <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>
  351. {% else %}
  352. <li class="page-item active">
  353. <a class="page-link" href="#">{{ page }}<span class="sr-only">(current)</span></a>
  354. </li>
  355. {% endif %}
  356. {% else %}
  357. <li class="page-item"><span class=ellipsis>...</span></li>
  358. {% endif %}
  359. {%- endfor %}
  360. </ul>
  361. </nav>
  362. </div>
  363. </div>
  364. <div class="footer">
  365. <p>
  366. <a href="//closed.social" target="_blank">闭社</a>提供技术支持,本报名系统开源于<a href="//git.closed.social/closed-social/ordinary">碧茶</a>
  367. </p>
  368. <p> 🄯 2020 Copyleft: closed.social</p>
  369. </div>
  370. </body>
  371. <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
  372. <script src="https://cdn.bootcss.com/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
  373. <script src="https://cdn.bootcdn.net/ajax/libs/jquery-timeago/1.6.7/jquery.timeago.min.js"></script>
  374. <script src="https://cdn.bootcdn.net/ajax/libs/jquery-timeago/1.6.7/locales/jquery.timeago.zh-CN.js"></script>
  375. <script>
  376. function like(toot) {
  377. if ($(`#like-${toot} svg`).hasClass("liked")) {
  378. alert('赞都赞了,别撤回嘛');
  379. return;
  380. }
  381. $.ajax({
  382. type: 'POST',
  383. url: toot + '/like',
  384. success: (result, status, xhr) => {
  385. console.log(result + ' : ' + status);
  386. $(`#like-${toot} span`).text(result);
  387. $(`#like-${toot} svg`).toggleClass("like liked");
  388. },
  389. error: (xhr, status, error) => {
  390. alert(error + ': ' + xhr.responseText);
  391. }
  392. });
  393. }
  394. $(document).ready(function(){
  395. $('.timeago').timeago();
  396. $('.close').click((e) => {
  397. $(e.currentTarget).parent().remove();
  398. $('.part1').show();
  399. });
  400. $('.twin').click((e) => {
  401. if($(e.currentTarget).hasClass('front'))
  402. return;
  403. let behind_box = $('.behind');
  404. let front_box = $('.front');
  405. behind_box.toggleClass('behind front');
  406. front_box.toggleClass('front behind');
  407. });
  408. $('.collapse').on('show.bs.collapse', (e) => {
  409. let self = e.target;
  410. let toot = self.id.split('-')[1];
  411. $.ajax({
  412. type: 'GET',
  413. url: toot + '/comments',
  414. success: (result, status, xhr) => {
  415. if (result.replies.length) {
  416. $(self).empty();
  417. result.replies.forEach((rp) => {
  418. $(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>`)
  419. });
  420. $(self).find('.timeago').timeago();
  421. } else {
  422. $(self).empty();
  423. $(self).append(`<div class="card card-body"><p>(暂无评论) <sub><a target="_blank" href="{{base_toot_url}}${toot}">发表第一条评论</sub></p></div>`)
  424. }
  425. },
  426. error: (xhr, status, error) => {
  427. console.log(error, status, xhr.status, xhr.responseText);
  428. $(self).empty();
  429. $(self).append(`<div class="card card-body"><p style="color:red">${xhr.status} ${xhr.responseText}</p></div>`);
  430. if (xhr.status == 404)
  431. setTimeout(() => {
  432. $(self).parent().remove()
  433. }, 3000);
  434. }
  435. });
  436. });
  437. });
  438. </script>
  439. </html>