base.html 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. {% extends "misago/base.html" %}
  2. {% load humanize i18n misago_avatars misago_dates %}
  3. {% block content %}
  4. <div class="container">
  5. {% block threads-list %}
  6. <div class="threads-list">
  7. {% block threads-panel %}
  8. <div class="table-panel">
  9. <ul class="list-group">
  10. {% for thread in threads %}
  11. <li class="list-group-item{% if not thread.is_read %} new{% endif %}">
  12. <div class="row">
  13. <div class="col-md-8">
  14. {% if thread.is_announcement %}
  15. {% if thread.is_read %}
  16. <span class="thread-icon tooltip-top fa fa-star-o fa-lg fa-fw" title="{% trans "Announcement, has no unread posts" %}"></span>
  17. {% else %}
  18. <span class="thread-icon tooltip-top fa fa-star fa-lg fa-fw" title="{% trans "Announcement, has unread posts" %}"></span>
  19. {% endif %}
  20. {% elif thread.is_pinned %}
  21. {% if thread.is_read %}
  22. <span class="thread-icon tooltip-top fa fa-bookmark-o fa-lg fa-fw" title="{% trans "Pinned, has no unread posts" %}"></span>
  23. {% else %}
  24. <span class="thread-icon tooltip-top fa fa-bookmark fa-lg fa-fw" title="{% trans "Pinned, has unread posts" %}"></span>
  25. {% endif %}
  26. {% else %}
  27. {% if thread.is_read %}
  28. <span class="thread-icon tooltip-top fa fa-circle-thin fa-lg fa-fw" title="{% trans "Thread has no unread posts" %}"></span>
  29. {% else %}
  30. <span class="thread-icon tooltip-top fa fa-circle fa-lg fa-fw" title="{% trans "Thread has unread posts" %}"></span>
  31. {% endif %}
  32. {% endif %}
  33. <a href="{{ thread.get_absolute_url }}" class="item-title">
  34. {{ thread.title }}
  35. </a>
  36. </div>
  37. {% block thread-extra %}
  38. <div class="col-md-4 thread-stats">
  39. {% block thread-stats %}
  40. <a href="#" class="last-post">
  41. <span class="dynamic time-ago-compact tooltip-top" data-timestamp="{{ thread.last_post_on|date:"c" }}" title="{% blocktrans with last_post=thread.last_post_on|date:"DATETIME_FORMAT" %}Last post from {{ last_post }}{% endblocktrans %}">{{ thread.last_post_on|compact_date|lower }}</span>
  42. </a>
  43. {% if thread.last_poster_id %}
  44. <a href="{% url USER_PROFILE_URL user_slug=thread.last_poster_slug user_id=thread.last_poster_id %}" class="thread-author tooltip-top" title="{% blocktrans with user=thread.last_poster_name %}Last post by {{ user }}{% endblocktrans %}">
  45. <img src="{{ thread.last_poster_id|avatar:25 }}" alt="{% trans "Avatar" %}" class="avatar">
  46. </a>
  47. {% else %}
  48. <span class="thread-author tooltip-top" title="{% blocktrans with user=thread.last_poster_name %}Last post by {{ user }}{% endblocktrans %}">
  49. <img src="{% blankavatar 25 %}" alt="{% trans "Avatar" %}" class="avatar">
  50. </span>
  51. {% endif %}
  52. {% if thread.is_read %}
  53. <div class="thread-replies">
  54. <div class="tooltip-top" title="{% blocktrans trimmed with replies=thread.replies|intcomma count counter=thread.replies %}{{ replies }} reply{% plural %}{{ replies }} replies{% endblocktrans %}">
  55. <span class="glyphicon glyphicon-comment"></span>
  56. {{ thread.replies|intcomma }}
  57. </div>
  58. </div>
  59. {% elif thread.replies and thread.unread_replies %}
  60. <div class="thread-replies new-replies">
  61. <div class="tooltip-top" title="{% blocktrans trimmed with replies=thread.unread_replies|intcomma count counter=thread.unread_replies %}{{ replies }} new reply{% plural %}{{ replies }} new replies{% endblocktrans %}">
  62. <span class="glyphicon glyphicon-plus"></span>
  63. {{ thread.unread_replies|intcomma }}
  64. </div>
  65. </div>
  66. {% else %}
  67. <div class="thread-replies new-thread">
  68. <div class="tooltip-top" title="{% blocktrans trimmed with replies=thread.replies|intcomma count counter=thread.replies %}New thread with {{ replies }} reply{% plural %}New thread with {{ replies }} replies{% endblocktrans %}">
  69. <span class="glyphicon glyphicon-leaf"></span>
  70. {{ thread.replies|intcomma }}
  71. </div>
  72. </div>
  73. {% endif %}
  74. <ul class="list-unstyled thread-flags">
  75. {% if thread.label %}
  76. <li>
  77. <span class="label label-solo label-{{ thread.label.css_class|default:"default" }}">
  78. {{ thread.label.name }}
  79. </span>
  80. </li>
  81. {% endif %}
  82. {% if thread.has_reported_posts %}
  83. <li class="tooltip-top" title="{% trans "Reported posts" %}">
  84. <span class="fa fa-exclamation-triangle fa-fw fa-lg"></span>
  85. </li>
  86. {% endif %}
  87. {% if thread.has_moderated_posts and not thread.is_moderated %}
  88. <li class="tooltip-top" title="{% trans "Moderated posts" %}">
  89. <span class="fa fa-eye-slash fa-fw fa-lg"></span>
  90. </li>
  91. {% endif %}
  92. {% if thread.is_poll %}
  93. <li class="tooltip-top" title="{% trans "Poll" %}">
  94. <span class="fa fa-bar-chart-o fa-fw fa-lg"></span>
  95. </li>
  96. {% endif %}
  97. {% if thread.is_moderated %}
  98. <li class="tooltip-top" title="{% trans "Moderated" %}">
  99. <span class="fa fa-eye-slash fa-fw fa-lg"></span>
  100. </li>
  101. {% endif %}
  102. {% if thread.is_closed %}
  103. <li class="tooltip-top" title="{% trans "Closed" %}">
  104. <span class="fa fa-lock fa-fw fa-lg"></span>
  105. </li>
  106. {% endif %}
  107. </ul>
  108. {% endblock thread-stats %}
  109. </div>
  110. {% endblock thread-extra %}
  111. </div>
  112. </li>
  113. {% empty %}
  114. <li class="list-group-item message-row">
  115. {% block no-threads %}{% endblock no-threads %}
  116. </li>
  117. {% endfor %}
  118. </ul>
  119. </div>
  120. {% endblock threads-panel %}
  121. </div>
  122. {% endblock threads-list %}
  123. </div>
  124. {% endblock content %}