new_threads.html 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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">
  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-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-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-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-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-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-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 user.is_authenticated() %}
  47. {% if thread.replies_reported and acl.threads.can_mod_posts(thread.forum) %}
  48. <li class="thread-replies-reported tooltip-top" title="{% trans %}Reported replies{% endtrans %}">
  49. {{ thread.replies_reported|intcomma }}
  50. </li>
  51. {% endif %}
  52. {% if thread.replies_moderated and acl.threads.can_approve(thread.forum) %}
  53. <li class="thread-replies-moderated tooltip-top" title="{% trans %}Unreviewed replies{% endtrans %}">
  54. {{ thread.replies_moderated|intcomma }}
  55. </li>
  56. {% endif %}
  57. {% endif %}
  58. {% if thread.replies %}
  59. <li class="thread-replies tooltip-top" title="{% trans %}Replies{% endtrans %}">
  60. {{ thread.replies|intcomma }}
  61. </li>
  62. {% endif %}
  63. <li class="thread-last-reply tooltip-top" title="{% trans last=thread.last|reldate %}Last post {{ last }}{% endtrans %}">
  64. <a href="{{ url('thread_last', thread=thread.pk, slug=thread.slug) }}">{{ thread.last|relcompact }}</a>
  65. </li>
  66. {% if thread.start_poster_name != thread.last_poster_name %}
  67. <li class="thread-author tooltip-top" title="{% trans username=thread.start_poster_name %}Thread by {{ username }}{% endtrans %}">
  68. {% if thread.start_poster_id %}
  69. <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>
  70. {% else %}
  71. {% 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 %}
  72. {% endif %}
  73. </li>
  74. {% endif %}
  75. <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 %}">
  76. {% if thread.last_poster_id %}
  77. <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>
  78. {% else %}
  79. {% 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 %}
  80. {% endif %}
  81. </li>
  82. {% if thread.moderated %}
  83. <li class="thread-flag thread-moderated tooltip-top" title="{% trans %}This thread awaits review{% endtrans %}">
  84. <i class="icon-remove-circle"></i>
  85. </li>
  86. {% endif %}
  87. {% if thread.closed %}
  88. <li class="thread-flag thread-closed tooltip-top" title="{% trans %}This thread is closed{% endtrans %}">
  89. <i class="icon-remove-circle"></i>
  90. </li>
  91. {% endif %}
  92. {% if thread.deleted %}
  93. <li class="thread-flag thread-deleted tooltip-top" title="{% trans %}This thread is deleted{% endtrans %}">
  94. <i class="icon-trash"></i>
  95. </li>
  96. {% endif %}
  97. <li class="thread-forum tooltip-top" title="{% trans %}Thread Forum{% endtrans %}">
  98. <a href="{{ url('forum', forum=thread.forum.pk, slug=thread.forum.slug) }}">{{ thread.forum.name }}</a>
  99. </li>
  100. </ul>
  101. <div class="thread-title">
  102. {% if thread.prefix_id %}{{ draw_prefix(thread.forum, prefixes[thread.prefix_id]) }}{% endif %}
  103. <a href="{{ url('thread', thread=thread.pk, slug=thread.slug) }}" class="thread-link">{{ thread.name }}</a>
  104. </div>
  105. </div>
  106. </li>
  107. {% endfor %}
  108. </ul>
  109. </div>
  110. {{ pager() }}
  111. {% else %}
  112. <p class="lead">{% trans %}Looks like there are no threads... yet!{% endtrans %}</p>
  113. {% endif %}
  114. </div>
  115. {% endblock %}
  116. {% macro pager() -%}
  117. {% if items_total > 0 and pagination['total'] > 1 %}
  118. <div class="pagination">
  119. <ul>
  120. <li class="count">{{ macros.pager_label(pagination) }}</li>
  121. {%- 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 -%}
  122. {%- 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 -%}
  123. </ul>
  124. </div>
  125. {% endif %}
  126. {%- endmacro %}
  127. {% macro draw_prefix(forum, prefix) -%}
  128. <a href="{{ url('forum_prefixed', slug=forum.slug, forum=forum.id, prefix=prefix.slug) }}" class="label{% if prefix.style %} label-{{ prefix.style }}{% endif %} thread-prefix thread-prefix-active">{{ _(prefix.name) }}</a>
  129. {%- endmacro %}