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.

205 lines
8.0 KiB

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="part1 col-md-6">
  35. <div class="story-box qbox part-box">
  36. <h1>{{story.title}}</h1>
  37. <p class="story-text" title="{{paragraph_part[0].author}}, {{paragraph_part[0].create_at}}, {{paragraph_part[0].like_num}}">{{paragraph_part[0].text}}</p>
  38. <img src="{{story.avatar}}" style="width: 80%">
  39. <hr>
  40. {% for p in paragraph_part[1:] %}
  41. <p class="story-text" title="{{p.author}}, {{p.create_at}}, {{p.like_num}}">{{p.text}}</p>
  42. {% endfor %}
  43. </div>
  44. </div>
  45. <div class="part2" id="part2">
  46. <div class="paragraph-list twin front qbox part-box" style="border: 0">
  47. <h1 style="margin: -8px -5px 20px">备选后续</h1>
  48. <span style="margin:8px" class="sort-by">
  49. {% if sort_by == 'like' %}
  50. <a href="?sort_by=time#part2">按时间</a> | <b>按赞数</b>
  51. {% else %}
  52. <b>按时间</b> | <a href="?sort_by=like#part2">按赞数</a>
  53. {% endif %}
  54. </span>
  55. {% for p in pagination.items %}
  56. <div class="qbox">
  57. <small>No. {{p.id}}</small>
  58. <p class="story-text">{{p.text}}</p>
  59. <div class="text-end" title="{{p.create_at}}">
  60. {% for emoji, num, reacted, kind in p.reaction_status() %}
  61. <button class="btn {{'btn-secondary' if reacted else 'btn-outline-secondary can-react'}}
  62. btn-sm" data-kind="{{kind}}" data-pid="{{p.id}}">{{emoji}} <span>{{num or ''}}</span></button>
  63. {% endfor %}
  64. <br>
  65. <time class="timeago" datetime="{{p.time}}"></time>
  66. </div>
  67. </div>
  68. {% endfor %}
  69. <nav>
  70. <ul class="pagination">
  71. {%- for page in pagination.iter_pages(left_edge=2, left_current=1, right_current=3, right_edge=2) %}
  72. {% if page %}
  73. {% if page != pagination.page %}
  74. <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>
  75. {% else %}
  76. <li class="page-item active">
  77. <a class="page-link" href="#">{{ page }}<span class="visually-hidden">(current)</span></a>
  78. </li>
  79. {% endif %}
  80. {% else %}
  81. <li class="page-item"><span class=ellipsis>...</span></li>
  82. {% endif %}
  83. {%- endfor %}
  84. </ul>
  85. </nav>
  86. </div>
  87. <div class="create-paragraph twin behind qbox part-box">
  88. <h1 style="text-align:right;margin:-8px -8px 16px">续!</h1>
  89. <form action="create" method="post">
  90. <input type="hidden" name="story-id" value={{story_id}}>
  91. <div class="form-group">
  92. <textarea class="form-control" name="text" rows="11" placeholder="来续写吧,140字以内" required maxLength="140"></textarea>
  93. </div>
  94. <div class="form-group">
  95. <button type="submit" class="btn btn-link btn-lg">续!</button>
  96. </div>
  97. </form>
  98. </div>
  99. </div>
  100. </div>
  101. <div class="footer">
  102. <p>
  103. <a href="//closed.social" target="_blank">闭社</a>提供技术支持,本报名系统开源于<a href="//git.closed.social/closed-social/">碧茶</a>
  104. </p>
  105. <p> 🄯 2021 Copyleft: closed.social</p>
  106. </div>
  107. <div class="modal fade" id="loginModal" tabindex="-1">
  108. <div class="modal-dialog">
  109. <div class="modal-content">
  110. <div class="modal-header">
  111. <h3 class="modal-title">登录</h3>
  112. </div>
  113. <div class="modal-body">
  114. <div class="text-center mb-4">
  115. <a href="{{cs_login_url}}" target="_blank" class="btn btn-link">闭社帐号登录</a>
  116. </div>
  117. <div class="text-center mb-4">
  118. <a href="#answerLogin" data-bs-toggle="collapse" class="btn btn-link" role="button">答题验证登录</a>
  119. <div class="collapse" id="answerLogin">
  120. <form action="{{guest_login_url}}" method="post">
  121. {% for id, question, hint, answer in verify_questions %}
  122. <div class="form-group row">
  123. <label for="{{id}}" class="col-sm-8 col-form-label">{{question}}</label>
  124. <div class="col-sm-4">
  125. <input type="text" class="form-control" name="{{id}}" id="{{id}}" placeholder="{{hint}}" required="required">
  126. </div>
  127. </div>
  128. {% endfor %}
  129. <button type="submit" class="btn btn-link btn-lg mb-3">提交</button>
  130. </form>
  131. </div>
  132. <p>
  133. </div>
  134. </div>
  135. </div>
  136. </div>
  137. </div>
  138. </body>
  139. <script src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
  140. <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>
  141. <script src="https://cdn.bootcdn.net/ajax/libs/jquery-timeago/1.6.7/jquery.timeago.min.js"></script>
  142. <script src="https://cdn.bootcdn.net/ajax/libs/jquery-timeago/1.6.7/locales/jquery.timeago.zh-CN.js"></script>
  143. <script>
  144. $('.can-react').click(function (e) {
  145. if (check_login())
  146. return;
  147. $this = $(this);
  148. $.post(
  149. 'react',
  150. {
  151. 'pid': $this.data('pid'),
  152. 'kind': $this.data('kind')
  153. },
  154. (n) => {
  155. $this.addClass('btn-secondary').removeClass('btn-outline-secondary can-react');
  156. console.log(n);
  157. if (n) {
  158. $this.find('span').text(n);
  159. }
  160. }
  161. ).fail(function(xhr, status, error) {
  162. console.log(xhr, status, error);
  163. alert(error);
  164. });;
  165. });
  166. function check_login() {
  167. if (! "{{username}}") {
  168. new bootstrap.Modal(document.getElementById('loginModal')).show();
  169. return true;
  170. }
  171. }
  172. $('.timeago').timeago();
  173. $('.twin').click((e) => {
  174. if($(e.currentTarget).hasClass('front'))
  175. return;
  176. let behind_box = $('.behind');
  177. let front_box = $('.front');
  178. behind_box.toggleClass('behind front');
  179. front_box.toggleClass('front behind');
  180. });
  181. $('.user-info .btn').click(check_login);
  182. $('textarea').focus(check_login);
  183. </script>
  184. </html>