base.html 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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-7">
  14. {% if thread.is_pinned %}
  15. {% if thread.is_read %}
  16. <span class="thread-icon tooltip-top fa fa-star-o fa-lg fa-fw" title="{% trans "Pinned, has no unread posts" %}"></span>
  17. {% else %}
  18. <span class="thread-icon tooltip-top fa fa-star fa-lg fa-fw" title="{% trans "Pinned, has unread posts" %}"></span>
  19. {% endif %}
  20. {% else %}
  21. {% if thread.is_read %}
  22. <span class="thread-icon tooltip-top fa fa-circle-thin fa-lg fa-fw" title="{% trans "Thread has no unread posts" %}"></span>
  23. {% else %}
  24. <span class="thread-icon tooltip-top fa fa-circle fa-lg fa-fw" title="{% trans "Thread has unread posts" %}"></span>
  25. {% endif %}
  26. {% endif %}
  27. <a href="{{ thread.get_absolute_url }}" class="item-title">
  28. {{ thread.title }}
  29. </a>
  30. </div>
  31. {% block thread-extra %}
  32. <div class="col-md-5 thread-stats">
  33. <a href="#" class="thread-check">
  34. <span class="fa fa-check"></span>
  35. <input type="checkbox" form="threads-actions" name="thread" value="{{ thread.pk }}"{% if thread.pk in selected_threads %}checked="checked"{% endif %}>
  36. </a>
  37. {% block thread-stats %}
  38. <a href="#" class="last-post">
  39. <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>
  40. </a>
  41. {% if thread.last_poster_id %}
  42. <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 %}">
  43. <img src="{{ thread.last_poster_id|avatar:25 }}" alt="{% trans "Avatar" %}" class="avatar">
  44. </a>
  45. {% else %}
  46. <span class="thread-author tooltip-top" title="{% blocktrans with user=thread.last_poster_name %}Last post by {{ user }}{% endblocktrans %}">
  47. <img src="{% blankavatar 25 %}" alt="{% trans "Avatar" %}" class="avatar">
  48. </span>
  49. {% endif %}
  50. {% if thread.is_read %}
  51. <div class="thread-replies thread-read">
  52. <span class="tooltip-top" title="{% blocktrans trimmed with replies=thread.replies|intcomma count counter=thread.replies %}{{ replies }} reply{% plural %}{{ replies }} replies{% endblocktrans %}">
  53. {{ thread.replies|intcomma }}
  54. </span>
  55. </div>
  56. {% elif thread.is_new %}
  57. <div class="thread-replies new-replies">
  58. <span class="label label-success 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 %}">
  59. <span class="fa fa-plus-circle fa-fw"></span>
  60. {{ thread.replies|intcomma }}
  61. </span>
  62. </div>
  63. {% else %}
  64. <div class="thread-replies new-replies">
  65. <span class="label label-primary tooltip-top" title="{% blocktrans trimmed with replies=thread.unread_replies|intcomma count counter=thread.unread_replies %}{{ replies }} new reply{% plural %}{{ replies }} new replies{% endblocktrans %}">
  66. <span class="fa fa-signal fa-fw"></span>
  67. {{ thread.unread_replies|intcomma }}
  68. </span>
  69. </div>
  70. {% endif %}
  71. <ul class="list-unstyled thread-flags">
  72. {% if thread.has_reported_posts %}
  73. <li class="tooltip-top" title="{% trans "Reported posts" %}">
  74. <span class="fa fa-exclamation-triangle fa-fw fa-lg"></span>
  75. </li>
  76. {% endif %}
  77. {% if thread.has_moderated_posts and not thread.is_moderated %}
  78. <li class="tooltip-top" title="{% trans "Moderated posts" %}">
  79. <span class="fa fa-question-circle fa-fw fa-lg"></span>
  80. </li>
  81. {% endif %}
  82. {% if thread.is_poll %}
  83. <li class="tooltip-top" title="{% trans "Poll" %}">
  84. <span class="fa fa-bar-chart-o fa-fw fa-lg"></span>
  85. </li>
  86. {% endif %}
  87. {% if thread.is_moderated %}
  88. <li class="tooltip-top" title="{% trans "Moderated" %}">
  89. <span class="fa fa-question-circle fa-fw fa-lg"></span>
  90. </li>
  91. {% endif %}
  92. {% if thread.is_closed %}
  93. <li class="tooltip-top" title="{% trans "Closed" %}">
  94. <span class="fa fa-lock fa-fw fa-lg"></span>
  95. </li>
  96. {% endif %}
  97. {% if thread.is_hidden %}
  98. <li class="tooltip-top" title="{% trans "Hidden" %}">
  99. <span class="fa fa-eye-slash fa-fw fa-lg"></span>
  100. </li>
  101. {% endif %}
  102. {% if thread.label %}
  103. <li>
  104. <span class="label label-solo label-{{ thread.label.css_class|default:"default" }}">
  105. {{ thread.label.name }}
  106. </span>
  107. </li>
  108. {% endif %}
  109. </ul>
  110. {% endblock thread-stats %}
  111. </div>
  112. {% endblock thread-extra %}
  113. </div>
  114. </li>
  115. {% empty %}
  116. <li class="list-group-item message-row">
  117. {% block no-threads %}{% endblock no-threads %}
  118. </li>
  119. {% endfor %}
  120. </ul>
  121. </div>
  122. {% endblock threads-panel %}
  123. </div>
  124. {% endblock threads-list %}
  125. </div>
  126. {% endblock content %}