home.html 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. {% extends "base.html" %}
  2. {% load static %}
  3. {% block title %}
  4. 首页
  5. {% endblock title %}
  6. {% block style %}
  7. <link rel="stylesheet" type="text/css" href="{% static 'article/list.css' %}">
  8. {% endblock style %}
  9. {% block content %}
  10. <header class="masthead" id="masthead">
  11. <div class="overlay"></div>
  12. <div class="container">
  13. <div class="row">
  14. <div class="col-lg-12 col-md-10 mx-auto">
  15. <div class="site-heading no-gutter" data-aos="fade-up" data-aos-delay="100">
  16. <h1>Design And Record</h1>
  17. <p>
  18. <span class="subheading text-slider-items">
  19. All things are difficult before they are easy.,
  20. No success in life merely happens.,
  21. 99 little bugs in the code.,
  22. One must first understand recursion in order to understand recursion.,
  23. Everything will be okay in the end. If it's not okay, it's not the end.,
  24. Everybody wants happiness. No one wants pain. But how can you make a rainbow without a little rain?,
  25. No matter when you start, it is important that you do not stop after starting. No matter when you end, it is more important that you do not regret after ended.,
  26. If you want something you've never had, then you've got to do something you've never Done.,
  27. Dear music, thank you for being there when nobody else was.
  28. </span><strong
  29. class="text-slider"></strong>
  30. </p>
  31. </div>
  32. </div>
  33. </div>
  34. </div>
  35. </header>
  36. <div class="container" id="content">
  37. <!--<hr>
  38. <nav aria-label="breadcrumb">
  39. <ol class="breadcrumb">
  40. <li class="breadcrumb-item">
  41. <a href="{% url 'article:article_list' %}?search={{ search }}&tag={{ tag }}&column={{ column }}">
  42. 最新
  43. </a>
  44. </li>
  45. <li class="breadcrumb-item">
  46. <a href="{% url 'article:article_list' %}?order=total_views&search={{ search }}&tag={{ tag }}&column={{ column }}">
  47. 最热
  48. </a>
  49. </li>
  50. </ol>
  51. </nav>
  52. <div class="row">
  53. <div class="col-auto mr-auto">
  54. <form class="form-inline">
  55. <label class="sr-only">
  56. content
  57. </label>
  58. <input type="text" class="form-control mb-2 mr-sm-2" name="search" placeholder="搜索文章..." required>
  59. </form>
  60. </div>
  61. </div>
  62. {% if search %}
  63. {% if articles %}
  64. <h4>
  65. <span style="color: red">"{{ search }}"</span>的搜索结果如下:
  66. </h4>
  67. <hr>
  68. {% else %}
  69. <h4>
  70. 暂无
  71. <span style="color: red">"{{ search }}"</span>有关的文章。
  72. </h4>
  73. {% endif %}
  74. {% endif %}-->
  75. <div class="row mt-2" id="articles_list">
  76. {% for article in articles %}
  77. <div class="row col-10 m-auto">
  78. <!--标题图-->
  79. {% if article.avatar %}
  80. <div class="col-4" data-aos="fade-up" data-aos-delay="100">
  81. <img src="{{ article.avatar.url }}"
  82. alt="avatar"
  83. style="max-width: 100%; border-radius: 20px;"
  84. >
  85. </div>
  86. {% endif %}
  87. <div class="col">
  88. {% if article.column %}
  89. <button type="button"
  90. onclick="window.open('{% url 'article:article_list' %}?search={{ search }}&tag={{ tag }}&column={{ article.column.id }}')"
  91. class="btn btn-sm mb-2 column_button"
  92. data-aos="fade-up" data-aos-delay="120">
  93. {{ article.column }}
  94. </button>
  95. {% endif %}
  96. <!--标签-->
  97. <span>
  98. {% for tag in article.tags.all %}
  99. <a href="{% url 'article:article_list' %}?tag={{ tag }}&search={{ search }}&column={{ column }}"
  100. class="badge badge-secondary" data-aos="fade-up" data-aos-delay="120">
  101. {{ tag }}
  102. </a>
  103. {% endfor %}
  104. </span>
  105. <!--标题-->
  106. <h4 data-aos="fade-up" data-aos-delay="140">
  107. <b>
  108. <a id="post-preview" href="{% url 'article:article_detail' article.id %}">
  109. {{ article.title }}
  110. </a>
  111. </b>
  112. </h4>
  113. <!--摘要-->
  114. <div data-aos="fade-up" data-aos-delay="160">
  115. <p style="color: gray;">
  116. {{ article.summary|slice:'50' }}...
  117. </p>
  118. </div>
  119. <!--注脚-->
  120. <p style="color: #868e96;font-style: italic;font-family: 'Lora', 'Times New Roman', serif;"
  121. data-aos="fade-up" data-aos-delay="180">
  122. <!--附加消息-->
  123. <span>
  124. <i class="fas fa-eye"></i>
  125. {{ article.total_views }} viewd&nbsp;&nbsp;&nbsp;
  126. </span>
  127. <span>
  128. <i class="fas fa-comments"></i>
  129. Posted at {{ article.created|date:'Y-m-d' }}&nbsp;&nbsp;&nbsp;
  130. </span>
  131. <span>
  132. <i class="fas fa-clock"></i>
  133. Update at {{ article.updated|date:'Y-m-d' }}
  134. </span>
  135. </p>
  136. <hr data-aos="fade-up" data-aos-delay="180">
  137. </div>
  138. <hr style="width:100%;" data-aos="fade-up" data-aos-delay="180"/>
  139. </div>
  140. {% endfor %}
  141. </div>
  142. <!--
  143. <div class="pagination row">
  144. <div class="m-auto">
  145. <span class="step-links">
  146. {% if articles.has_previous %}
  147. <a href="?page=1&order={{ order }}&search={{ search }}&tag={{ tag }}&column={{ column }}"
  148. class="btn btn-success">
  149. &laquo;1
  150. </a>
  151. <span>...</span>
  152. <a href="?page={{ articles.previous_page_number }}&order={{ order }}&search={{ search }}&tag=
  153. {{ tag }}&column={{ column }}"
  154. class="btn btn-secondary">
  155. {{ articles.previous_page_number }}
  156. </a>
  157. {% endif %}
  158. <span class="current btn btn-danger btn-lg">
  159. {{ articles.number }}
  160. </span>
  161. {% if articles.has_next %}
  162. <a href="?page={{ articles.next_page_number }}&order={{ order }}&search={{ search }}&tag={{ tag }}
  163. &column={{ column }}"
  164. class="btn btn-secondary">
  165. {{ articles.next_page_number }}
  166. </a>
  167. <span>...</span>
  168. <a href="?page={{ articles.paginator.num_pages }}&order={{ order }}&search={{ search }}&tag=
  169. {{ tag }}&column={{ column }}"
  170. class="btn btn-success">
  171. {{ articles.paginator.num_pages }} &raquo
  172. </a>
  173. {% endif %}
  174. </span>
  175. </div>
  176. </div>-->
  177. </div>
  178. {% endblock content %}
  179. {% block script %}
  180. <script src="{% static 'typed/typed.js' %}"></script>
  181. <script src="{% static 'article/list.js' %}"></script>
  182. <script src="{% static 'article/jquery.cookie.js' %}"></script>
  183. {% endblock script %}