2021的特普通奖
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.

245 lines
9.8 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 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="static/img/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="华清大学特普通奖学金 {{story.title}}" />
  10. <meta property="og:description" content="华清大学特普通奖学金" />
  11. <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
  12. <link href="static/css/ordinary.css" rel="stylesheet">
  13. <title>第二届 华清大学特普通奖 {{story.title}}</title>
  14. <script>
  15. if(navigator.userAgent.search('MicroMessenger') !== -1)
  16. location.href = `https://closed.social/tools/safe_jump/?go=${encodeURIComponent(location.href)}&t=${encodeURIComponent('华清大学特普通奖')}`;
  17. </script>
  18. </head>
  19. <body>
  20. <div class="container">
  21. <a href=".">
  22. <div style='padding:15px'>
  23. <img src="static/img/logo.png" width="200px" />
  24. </div>
  25. </a>
  26. <div class="user-info">
  27. <div class="btn-group">
  28. <button type="button" class="btn btn-dark rounded-0 p-1 pl-2">
  29. <img class="rounded-circle" src="{{avatar}}" width="24">
  30. <span class="username ml-2">{{username or '未登录'}}</span>
  31. </button>
  32. </div>
  33. </div>
  34. <!-- <div class="toast fixed-top" id="ending-toast" role="alert" aria-live="assertive" aria-atomic="true" autohide="false">
  35. <div class="toast-header">
  36. <strong class="me-auto">结尾提醒</strong>
  37. <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
  38. </div>
  39. <div class="toast-body">
  40. 到最后一个时段啦,请为故事续写结尾吧~
  41. </div>
  42. </div> -->
  43. <div class="part1 col-md-6">
  44. <div class="story-box qbox part-box">
  45. <h1>{{story.title}}</h1>
  46. <img src="{{story.avatar}}" style="width: 80%">
  47. <hr>
  48. {% for p in paragraph_part %}
  49. <p class="story-text" title="{{p.author}}, {{p.create_at}}, {{p.like_num}}">
  50. {{p.text}}
  51. {% if is_tree and p.id != tail %}
  52. <small><a href="?tail={{p.id}}"> ← 回到这里</a></small>
  53. {% endif %}
  54. </p>
  55. {% endfor %}
  56. </div>
  57. <div style="font-size:90%;">
  58. <ul>
  59. <li>点击“续!”进行创作。</li>
  60. {% if not is_tree %}
  61. <li>请注意是对现有候选人故事的续写,不是对其他续写的续写。</li>
  62. {% endif %}
  63. </li>
  64. {% if is_tree %}
  65. <li>从第二天开始,在每天的10:00/16:00/22:00,对应故事线赞数总和最高且自身赞数不小于{{min_like_num}}的续写将入选,成为这个角色默认展示故事的一部分。</li>
  66. {% else %}
  67. <li>在每天的10:00/16:00/22:00,赞数最高且不小于{{min_like_num}}的续写将入选,成为这个角色最终故事的一部分。如果没有,所有都会被保留进入下一时段。</li>
  68. {% endif %}
  69. <li>参与创作需要回答几个简单的问题以验证学生身份,或者通过<a href="https://thu.closed.social/">闭社清华站</a>账号登录。</li>
  70. <li>联系邮箱:<a href="mailto:{{email}}">{{email}}</a></li>
  71. </ul>
  72. </div>
  73. </div>
  74. <div class="part2" id="part2">
  75. <div class="paragraph-list twin front part-box">
  76. <h1 style="margin: -8px -5px 20px">备选后续</h1>
  77. <span style="margin:8px" class="sort-by">
  78. {% if sort_by == 'like' %}
  79. <a href="?sort_by=time#part2">按时间</a> | <b>按赞数</b>
  80. {% else %}
  81. <b>按时间</b> | <a href="?sort_by=like#part2">按赞数</a>
  82. {% endif %}
  83. </span>
  84. {% for p in pagination.items %}
  85. <div class="qbox">
  86. <small>No. {{p.id}}</small>
  87. {% if is_tree %}
  88. <small><a href="?tail={{p.id}}"> ← 查看后续</a></small>
  89. {% endif %}
  90. <p class="story-text">{{p.text}}</p>
  91. <div class="text-end" title="{{p.create_at}}">
  92. {% for emoji, num, reacted, kind in p.reaction_status() %}
  93. <button class="btn {{'btn-secondary' if reacted else 'btn-outline-secondary can-react'}}
  94. btn-sm" data-kind="{{kind}}" data-pid="{{p.id}}">{{emoji}} <span>{{num or ''}}</span></button>
  95. {% endfor %}
  96. <br>
  97. <time class="timeago" datetime="{{p.time}}"></time>
  98. </div>
  99. </div>
  100. {% endfor %}
  101. <nav>
  102. <ul class="pagination">
  103. {%- for page in pagination.iter_pages(left_edge=2, left_current=1, right_current=3, right_edge=2) %}
  104. {% if page %}
  105. {% if page != pagination.page %}
  106. <li class="page-item"><a class="page-link" href="{{ url_for('main_bp.story', story_id=story_id, page=page, per_page=pagination.per_page, key=key, sort_by=sort_by) }}">{{ page }}</a></li>
  107. {% else %}
  108. <li class="page-item active">
  109. <a class="page-link" href="#">{{ page }}<span class="visually-hidden">(current)</span></a>
  110. </li>
  111. {% endif %}
  112. {% else %}
  113. <li class="page-item"><span class=ellipsis>...</span></li>
  114. {% endif %}
  115. {%- endfor %}
  116. </ul>
  117. </nav>
  118. </div>
  119. <div class="create-paragraph twin behind qbox part-box">
  120. <h1 style="text-align:right;margin:-8px -8px 16px">续!</h1>
  121. <form action="create" method="post">
  122. <input type="hidden" name="story-id" value={{story_id}}>
  123. <input type="hidden" name="tail" value={{tail}}>
  124. <div class="form-group">
  125. <textarea class="form-control" name="text" rows="11"
  126. placeholder="来续写{{story.title}}的故事吧!(不超过 140 字)" required maxLength="140">{{draft}}</textarea>
  127. </div>
  128. <div class="form-group">
  129. <button type="submit" class="btn btn-link btn-lg">续!</button>
  130. </div>
  131. </form>
  132. </div>
  133. </div>
  134. </div>
  135. <div class="footer">
  136. <p>
  137. <a href="//closed.social" target="_blank">闭社</a>提供技术支持,本创作系统开源于<a href="//git.closed.social/">碧茶</a>
  138. </p>
  139. <p> 🄯 2021 Copyleft: closed.social</p>
  140. </div>
  141. <div class="modal fade" id="loginModal" tabindex="-1">
  142. <div class="modal-dialog">
  143. <div class="modal-content">
  144. <div class="modal-header">
  145. <h3 class="modal-title">登录</h3>
  146. </div>
  147. <div class="modal-body">
  148. <div class="text-center mb-4">
  149. <a href="{{cs_login_url}}" target="_blank" class="btn btn-link">闭社帐号登录</a>
  150. </div>
  151. <div class="text-center mb-4">
  152. <a href="#answerLogin" data-bs-toggle="collapse" class="btn btn-link" role="button">答题验证登录</a>
  153. <div class="collapse" id="answerLogin">
  154. <form action="{{guest_login_url}}" method="post">
  155. {% for id, question, hint, answer in verify_questions %}
  156. <div class="form-group row">
  157. <label for="{{id}}" class="col-sm-8 col-form-label">{{question}}</label>
  158. <div class="col-sm-4">
  159. <input type="text" class="form-control" name="{{id}}" id="{{id}}" placeholder="{{hint}}" required="required">
  160. </div>
  161. </div>
  162. {% endfor %}
  163. <button type="submit" class="btn btn-link btn-lg mb-3">提交</button>
  164. </form>
  165. </div>
  166. <p>
  167. </div>
  168. </div>
  169. </div>
  170. </div>
  171. </div>
  172. </body>
  173. <script src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
  174. <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
  175. <script src="https://cdn.bootcdn.net/ajax/libs/jquery-timeago/1.6.7/jquery.timeago.min.js"></script>
  176. <script src="https://cdn.bootcdn.net/ajax/libs/jquery-timeago/1.6.7/locales/jquery.timeago.zh-CN.js"></script>
  177. <script>
  178. window.onload = function(e) {
  179. var DOMToast = document.getElementById('ending-toast');
  180. var bootstrapToast = new bootstrap.Toast(DOMToast);
  181. bootstrapToast.show();
  182. };
  183. $('.can-react').click(function (e) {
  184. $this = $(this);
  185. $.post(
  186. 'react',
  187. {
  188. 'pid': $this.data('pid'),
  189. 'kind': $this.data('kind')
  190. },
  191. (n) => {
  192. $this.addClass('btn-secondary').removeClass('btn-outline-secondary can-react');
  193. console.log(n);
  194. if (n) {
  195. $this.find('span').text(n);
  196. }
  197. }
  198. ).fail(function(xhr, status, error) {
  199. console.log(xhr, status, error);
  200. alert(error);
  201. });;
  202. });
  203. function check_login() {
  204. if (! "{{username}}") {
  205. new bootstrap.Modal(document.getElementById('loginModal')).show();
  206. return true;
  207. }
  208. }
  209. $('.timeago').timeago();
  210. $('.twin').click((e) => {
  211. if($(e.currentTarget).hasClass('front'))
  212. return;
  213. let behind_box = $('.behind');
  214. let front_box = $('.front');
  215. behind_box.toggleClass('behind front');
  216. front_box.toggleClass('front behind');
  217. });
  218. $('.user-info .btn').click(check_login);
  219. $('textarea').focus(check_login);
  220. </script>
  221. </html>