123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- {% extends "cranefly/layout.html" %}
- {% import "cranefly/macros.html" as macros with context %}
- {% block title %}{{ macros.page_title(title=_('New Threads')) }}{% endblock %}
- {% block container %}
- <div class="page-header header-primary">
- <div class="container">
- {{ messages_list(messages) }}
- <h1>{% trans %}New Threads{% endtrans %}</h1>
- </div>
- </div>
- <div class="container container-primary">
- {% if threads %}
- <div class="forum-threads-list">
- <div class="header">
- <div class="row-fluid">
- <div class="span7">{% trans %}Thread{% endtrans %}</div>
- <div class="span5 thread-activity">
- <div class="thread-replies">{% trans %}Replies{% endtrans %}</div>
- <div class="thread-last">{% trans %}Last Reply{% endtrans %}</div>
- </div>
- </div>
- </div>
- {% for thread in threads %}
- <div class="thread-row{% if thread.pk == 2 or not thread.is_read %} thread-new{% endif %}{% if loop.last %} thread-last{% endif %}">
- <div class="row-fluid">
- <div class="span7">
- {% if thread.is_read and not thread.pk == 2 %}
- <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 %}"><i class="icon-asterisk"></i></a>
- {% else %}
- <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 %}"><i class="icon-fire"></i></a>
- {% endif %}
- <a href="{% url 'thread' thread=thread.pk, slug=thread.slug %}" class="thread-name">{{ thread.name }}</a>
- <span class="thread-details">
- {% trans user=thread_starter(thread), forum=thread_forum(thread) %}by {{ user }} in {{ forum }}{% endtrans %}
- </span>
- <ul class="unstyled thread-flags">
- {% if thread.replies_reported %}
- <li><i class="icon-warning-sign tooltip-top" title="{% trans %}This thread has reported replies{% endtrans %}"></i></li>
- {% endif %}
- {% if thread.replies_moderated %}
- <li><i class="icon-question-sign tooltip-top" title="{% trans %}This thread has unreviewed replies{% endtrans %}"></i></li>
- {% endif %}
- {% if thread.weight == 2 %}
- <li><i class="icon-star tooltip-top" title="{% trans %}This thread is an annoucement{% endtrans %}"></i></li>
- {% endif %}
- {% if thread.weight == 1 %}
- <li><i class="icon-star-empty tooltip-top" title="{% trans %}This thread is sticky{% endtrans %}"></i></li>
- {% endif %}
- {% if thread.moderated %}
- <li><i class="icon-eye-close tooltip-top" title="{% trans %}This thread awaits review{% endtrans %}"></i></li>
- {% endif %}
- {% if thread.deleted %}
- <li><i class="icon-trash tooltip-top" title="{% trans %}This thread is deleted{% endtrans %}"></i></li>
- {% endif %}
- {% if thread.closed %}
- <li><i class="icon-lock tooltip-top" title="{% trans %}This thread is closed{% endtrans %}"></i></li>
- {% endif %}
- </ul>
- </div>
- <div class="span5 thread-activity">
- <div class="thread-replies tooltip-top" title="{{ replies(thread.replies) }}">{{ thread.replies|intcomma }} <i class="icon-comment"></i></div>
- <div class="thread-last-reply">
- {% if settings.avatars_on_threads_list %}
- <span class="thread-last-avatar">
- {% if thread.last_poster_id %}
- <a href="{% url 'user' user=thread.last_poster.pk, username=thread.last_poster.username_slug %}"><img src="{{ thread.last_poster.get_avatar(30) }}" alt=""></a>
- {% else %}
- <img src="{{ macros.avatar_guest(40) }}" alt="" class="user-avatar">
- {% endif %}
- </span>
- {% endif %}
- {{ thread_reply(thread) }}, {{ thread.last|reldate|low }}
- </div>
- </div>
- </div>
- </div>
- {% endfor %}
- </div>
- {{ pager() }}
- {% else %}
- <p class="lead">{% trans %}No new threads were started in last 48 hours.{% endtrans %}</p>
- {% endif %}
- </div>
- {% endblock %}
- {% macro replies(thread_replies) -%}
- {% trans count=thread_replies, replies=thread_replies|intcomma -%}
- {{ replies }} reply
- {%- pluralize -%}
- {{ replies }} replies
- {%- endtrans %}
- {%- endmacro %}
- {% macro thread_starter(thread) -%}
- {% if thread.start_poster_id %}<a href="{% url 'user' user=thread.start_poster_id, username=thread.start_poster_slug %}" class="user-link">{{ thread.start_poster_name }}</a>{% else %}{{ thread.start_poster_name }}{% endif %}
- {%- endmacro %}
- {% macro thread_forum(thread) -%}
- <a href="{% url 'forum' forum=thread.forum_id, slug=thread.forum.slug %}" class="forum-link">{{ thread.forum.name }}</a>
- {%- endmacro %}
- {% macro thread_reply(thread) -%}
- {% if thread.last_poster_id %}<a href="{% url 'user' user=thread.last_poster_id, username=thread.last_poster_slug %}" class="user-link">{{ thread.last_poster_name }}</a>{% else %}{{ thread.last_poster_name }}{% endif %}
- {%- endmacro %}
- {% macro pager() -%}
- {% if items_total > 0 and pagination['total'] > 1 %}
- <div class="pagination">
- <ul>
- <li class="count">{{ macros.pager_label(pagination) }}</li>
- {%- 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 -%}
- {%- 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 -%}
- </ul>
- </div>
- {% endif %}
- {%- endmacro %}
|