scientific.html 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. {% extends "base.html" %}
  2. {% block title %}{{ title }}{% endblock %}
  3. {% block content %}
  4. <div class="container">
  5. <div class="row">
  6. <div class="col-md-3">
  7. <div class="model-title">{{ title }}</div>
  8. <div class="model-list">
  9. <ul class="list-group">
  10. <li class="list-group-item active" id="survey">
  11. <a href="{% url 'scientific_index' %}">教学科研</a>
  12. </li>
  13. </ul>
  14. </div>
  15. </div>
  16. <div class="col-md-9">
  17. <div class="model-details-title">{{ title }}</div>
  18. <div class="row">
  19. {% for article in list %}
  20. <div class="col-md-4">
  21. <div class="thumbnail">
  22. {% if article.cover %}
  23. <img src="{{ article.cover }}" alt="{{ article.title }}" class="img-responsive" style="height:200px;object-fit:cover;">
  24. {% endif %}
  25. <div class="caption">
  26. <h4 style="text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">{{ article.title }}</h4>
  27. <p style="text-align:center;color:#999;">{{ article.created_at|date:"Y-m-d" }}</p>
  28. </div>
  29. </div>
  30. </div>
  31. {% endfor %}
  32. </div>
  33. {% if list.has_other_pages %}
  34. <nav>
  35. <ul class="pagination">
  36. {% if list.has_previous %}
  37. <li><a href="?page={{ list.previous_page_number }}">&laquo;上一页</a></li>
  38. {% endif %}
  39. <li><span>第 {{ list.number }} / {{ list.paginator.num_pages }} 页</span></li>
  40. {% if list.has_next %}
  41. <li><a href="?page={{ list.next_page_number }}">下一页&raquo;</a></li>
  42. {% endif %}
  43. </ul>
  44. </nav>
  45. {% endif %}
  46. </div>
  47. </div>
  48. </div>
  49. {% endblock %}