home_call.html 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <div class="row mt-2">
  2. {% for article in articles %}
  3. <div class="row col-10 m-auto">
  4. <!--标题图-->
  5. {% if article.avatar %}
  6. <div class="col-4" data-aos="fade-up" data-aos-delay="100">
  7. <img src="{{ article.avatar.url }}"
  8. alt="avatar"
  9. style="max-width: 100%; border-radius: 20px;"
  10. >
  11. </div>
  12. {% endif %}
  13. <div class="col">
  14. {% if article.column %}
  15. <button type="button"
  16. onclick="window.open('{% url 'article:article_list' %}?column={{ article.column.id }}')"
  17. class="btn btn-sm mb-2
  18. {% if article.column.title == 'Django' %}
  19. btn-success
  20. {% elif article.column.title == 'Java' %}
  21. btn-danger
  22. {% elif article.column.title == 'HTML' %}
  23. btn-warning
  24. {% endif %}
  25. "
  26. data-aos="fade-up" data-aos-delay="120">
  27. {{ article.column }}
  28. </button>
  29. {% endif %}
  30. <!--标签-->
  31. <span>
  32. {% for tag in article.tags.all %}
  33. <a href="{% url 'article:article_list' %}?tag={{ tag }}"
  34. class="badge badge-secondary" data-aos="fade-up" data-aos-delay="120">
  35. {{ tag }}
  36. </a>
  37. {% endfor %}
  38. </span>
  39. <!--标题-->
  40. <h4 data-aos="fade-up" data-aos-delay="140">
  41. <b>
  42. <a id="post-preview" href="{% url 'article:article_detail' article.id %}" style="color: black;">
  43. {{ article.title }}
  44. </a>
  45. </b>
  46. </h4>
  47. <!--摘要-->
  48. <div data-aos="fade-up" data-aos-delay="160">
  49. <p style="color: gray;">
  50. {{ article.body|slice:'50' }}...
  51. </p>
  52. </div>
  53. <!--注脚-->
  54. <p style="color: #868e96;font-style: italic;font-family: 'Lora', 'Times New Roman', serif;" data-aos="fade-up" data-aos-delay="180">
  55. <!--附加消息-->
  56. <span>
  57. <i class="fas fa-eye"></i>
  58. {{ article.total_views }} viewd&nbsp;&nbsp;&nbsp;
  59. </span>
  60. <span>
  61. <i class="fas fa-comments"></i>
  62. Posted at {{ article.created|date:'Y-m-d' }}&nbsp;&nbsp;&nbsp;
  63. </span>
  64. <span>
  65. <i class="fas fa-clock"></i>
  66. Update at {{ article.updated|date:'Y-m-d' }}
  67. </span>
  68. </p>
  69. <hr data-aos="fade-up" data-aos-delay="180">
  70. </div>
  71. <hr style="width:100%;" data-aos="fade-up" data-aos-delay="180"/>
  72. </div>
  73. {% endfor %}
  74. </div>