new_threads.html 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. {% extends "cranefly/layout.html" %}
  2. {% import "cranefly/macros.html" as macros with context %}
  3. {% block title %}{{ macros.page_title(title=_('New Threads')) }}{% endblock %}
  4. {% block container %}
  5. <div class="page-header header-primary">
  6. <div class="container">
  7. {{ messages_list(messages) }}
  8. <h1>{% trans %}New Threads{% endtrans %}</h1>
  9. </div>
  10. </div>
  11. <div class="container container-primary">
  12. {% if threads %}
  13. <div class="forum-threads-list-new">
  14. <ul>
  15. {% for thread in threads %}
  16. <li{% if not thread.is_read %} class="thread-new"{% endif %}>
  17. <div class="thread-icon">
  18. {% if thread.weight == 2 %}
  19. {% if thread.is_read %}
  20. <a href="{{ url('thread_new', thread=thread.pk, slug=thread.slug) }}" class="thread-icon thread-icon-last tooltip-top" title="{% trans %}Announcement, click to see last post{% endtrans %}">
  21. {% else %}
  22. <a href="{{ url('thread_new', thread=thread.pk, slug=thread.slug) }}" class="thread-icon thread-icon-new tooltip-top" title="{% trans %}Announcement, click to see first unread post{% endtrans %}">
  23. {% endif %}
  24. <i class="icon-star{% if thread.is_read %}-empty{% endif %}"></i>
  25. </a>
  26. {% elif thread.weight == 1 %}
  27. {% if thread.is_read %}
  28. <a href="{{ url('thread_new', thread=thread.pk, slug=thread.slug) }}" class="thread-icon thread-icon-last tooltip-top" title="{% trans %}Pinned, click to see last post{% endtrans %}">
  29. {% else %}
  30. <a href="{{ url('thread_new', thread=thread.pk, slug=thread.slug) }}" class="thread-icon thread-icon-new tooltip-top" title="{% trans %}Pinned, click to see first unread post{% endtrans %}">
  31. {% endif %}
  32. <i class="icon-bookmark{% if thread.is_read %}-empty{% endif %}"></i>
  33. </a>
  34. {% else %}
  35. {% if thread.is_read %}
  36. <a href="{{ url('thread_new', thread=thread.pk, slug=thread.slug) }}" class="thread-icon thread-icon-last tooltip-top" title="{% trans %}Click to see last post{% endtrans %}">
  37. {% else %}
  38. <a href="{{ url('thread_new', thread=thread.pk, slug=thread.slug) }}" class="thread-icon thread-icon-new tooltip-top" title="{% trans %}Click to see first unread post{% endtrans %}">
  39. {% endif %}
  40. <i class="icon-circle{% if thread.is_read %}-blank{% endif %}"></i>
  41. </a>
  42. {% endif %}
  43. </div>
  44. <div class="thread-body">
  45. <ul class="thread-activity">
  46. {% if thread.replies_reported %}
  47. <li class="thread-replies-reported tooltip-top" title="{% trans %}Reported replies{% endtrans %}">
  48. {{ thread.replies_reported|intcomma }}
  49. </li>
  50. {% endif %}
  51. {% if thread.replies_moderated %}
  52. <li class="thread-replies-moderated tooltip-top" title="{% trans %}Unreviewed replies{% endtrans %}">
  53. {{ thread.replies_moderated|intcomma }}
  54. </li>
  55. {% endif %}
  56. {% if thread.replies %}
  57. <li class="thread-replies{% if not thread.is_read%} thread-replies-new{% endif %} tooltip-top" title="{% trans %}Replies{% endtrans %}">
  58. {{ thread.replies|intcomma }}
  59. </li>
  60. {% endif %}
  61. <li class="thread-last-reply tooltip-top" title="{% trans last=thread.last|reldate %}Last post {{ last }}{% endtrans %}">
  62. <a href="{{ url('thread_last', thread=thread.pk, slug=thread.slug) }}">{{ thread.last|relcompact }}</a>
  63. </li>
  64. {% if thread.start_poster_name != thread.last_poster_name %}
  65. <li class="thread-author tooltip-top" title="{% trans username=thread.start_poster_name %}Thread by {{ username }}{% endtrans %}">
  66. {% if thread.start_poster_id %}
  67. <a href="{{ url('user', user=thread.start_poster_id, username=thread.start_poster_name) }}">{% if settings.avatars_on_threads_list %}<img src="{{ thread.start_poster.get_avatar(18) }}" alt="{{ thread.start_poster_name }}" class="user-avatar">{% else %}{{ thread.start_poster_name }}{% endif %}</a>
  68. {% else %}
  69. {% if settings.avatars_on_threads_list %}<img src="{{ macros.avatar_guest(24) }}" alt="{{ thread.start_poster_name }}" class="user-avatar">{% else %}{{ thread.start_poster_name }}{% endif %}
  70. {% endif %}
  71. </li>
  72. {% endif %}
  73. <li class="thread-poster tooltip-top" title="{% if thread.start_poster_name != thread.last_poster_name %}{% trans username=thread.last_poster_name %}Last reply by {{ username }}{% endtrans %}{% else %}{% trans username=thread.last_poster_name %}Thread and last post by {{ username }}{% endtrans %}{% endif %}">
  74. {% if thread.last_poster_id %}
  75. <a href="{{ url('user', user=thread.last_poster_id, username=thread.last_poster_name) }}">{% if settings.avatars_on_threads_list %}<img src="{{ thread.last_poster.get_avatar(18) }}" alt="{{ thread.last_poster_name }}" class="user-avatar">{% else %}{{ thread.last_poster_name }}{% endif %}</a>
  76. {% else %}
  77. {% if settings.avatars_on_threads_list %}<img src="{{ macros.avatar_guest(24) }}" alt="{{ thread.last_poster_name }}" class="user-avatar">{% else %}{{ thread.last_poster_name }}{% endif %}
  78. {% endif %}
  79. </li>
  80. {% if thread.moderated %}
  81. <li class="thread-flag thread-moderated tooltip-top" title="{% trans %}This thread awaits review{% endtrans %}">
  82. <i class="icon-remove-circle"></i>
  83. </li>
  84. {% endif %}
  85. {% if thread.closed %}
  86. <li class="thread-flag thread-closed tooltip-top" title="{% trans %}This thread is closed{% endtrans %}">
  87. <i class="icon-remove-circle"></i>
  88. </li>
  89. {% endif %}
  90. {% if thread.deleted %}
  91. <li class="thread-flag thread-deleted tooltip-top" title="{% trans %}This thread is deleted{% endtrans %}">
  92. <i class="icon-trash"></i>
  93. </li>
  94. {% endif %}
  95. </ul>
  96. <div class="thread-title">
  97. <a href="{{ url('thread', thread=thread.pk, slug=thread.slug) }}">{{ thread.name }}</a>
  98. </div>
  99. </div>
  100. </li>
  101. {% endfor %}
  102. </ul>
  103. </div>
  104. {{ pager() }}
  105. {% else %}
  106. <p class="lead">{% trans %}No new threads were started in last 48 hours.{% endtrans %}</p>
  107. {% endif %}
  108. </div>
  109. {% endblock %}
  110. {% macro pager() -%}
  111. {% if items_total > 0 and pagination['total'] > 1 %}
  112. <div class="pagination">
  113. <ul>
  114. <li class="count">{{ macros.pager_label(pagination) }}</li>
  115. {%- if pagination['prev'] > 0 %}<li><a href="{%- if pagination['prev'] > 1 %}{{ url('new_threads', page=pagination['prev']) }}{% else %}{{ url('new_threads') }}{% endif %}" class="tooltip-top" title="{% trans %}Previous Page{% endtrans %}"><i class="icon-chevron-left"></i></a></li>{% endif -%}
  116. {%- if pagination['next'] > 0 %}<li><a href="{{ url('new_threads', page=pagination['next']) }}" class="tooltip-top" title="{% trans %}Next Page{% endtrans %}"><i class="icon-chevron-right"></i></a></li>{% endif -%}
  117. </ul>
  118. </div>
  119. {% endif %}
  120. {%- endmacro %}