123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- {% 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-new">
- <ul>
- {% for thread in threads %}
- <li{% if not thread.is_read %} class="thread-new"{% endif %}>
- <div class="thread-icon">
- {% if thread.weight == 2 %}
- {% if thread.is_read %}
- <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 %}">
- {% else %}
- <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 %}">
- {% endif %}
- <i class="icon-star{% if thread.is_read %}-empty{% endif %}"></i>
- </a>
- {% elif thread.weight == 1 %}
- {% if thread.is_read %}
- <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 %}">
- {% else %}
- <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 %}">
- {% endif %}
- <i class="icon-bookmark{% if thread.is_read %}-empty{% endif %}"></i>
- </a>
- {% else %}
- {% if thread.is_read %}
- <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 %}">
- {% 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 %}">
- {% endif %}
- <i class="icon-circle{% if thread.is_read %}-blank{% endif %}"></i>
- </a>
- {% endif %}
- </div>
- <div class="thread-body">
- <ul class="thread-activity">
- {% if user.is_authenticated() %}
- {% if thread.replies_reported and acl.threads.can_mod_posts(forum) %}
- <li class="thread-replies-reported tooltip-top" title="{% trans %}Reported replies{% endtrans %}">
- {{ thread.replies_reported|intcomma }}
- </li>
- {% endif %}
- {% if thread.replies_moderated and acl.threads.can_approve(forum) %}
- <li class="thread-replies-moderated tooltip-top" title="{% trans %}Unreviewed replies{% endtrans %}">
- {{ thread.replies_moderated|intcomma }}
- </li>
- {% endif %}
- {% endif %}
- {% if thread.replies %}
- <li class="thread-replies tooltip-top" title="{% trans %}Replies{% endtrans %}">
- {{ thread.replies|intcomma }}
- </li>
- {% endif %}
- <li class="thread-last-reply tooltip-top" title="{% trans last=thread.last|reldate %}Last post {{ last }}{% endtrans %}">
- <a href="{{ url('thread_last', thread=thread.pk, slug=thread.slug) }}">{{ thread.last|relcompact }}</a>
- </li>
- {% if thread.start_poster_name != thread.last_poster_name %}
- <li class="thread-author tooltip-top" title="{% trans username=thread.start_poster_name %}Thread by {{ username }}{% endtrans %}">
- {% if thread.start_poster_id %}
- <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>
- {% else %}
- {% 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 %}
- {% endif %}
- </li>
- {% endif %}
- <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 %}">
- {% if thread.last_poster_id %}
- <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>
- {% else %}
- {% 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 %}
- {% endif %}
- </li>
- {% if thread.moderated %}
- <li class="thread-flag thread-moderated tooltip-top" title="{% trans %}This thread awaits review{% endtrans %}">
- <i class="icon-remove-circle"></i>
- </li>
- {% endif %}
- {% if thread.closed %}
- <li class="thread-flag thread-closed tooltip-top" title="{% trans %}This thread is closed{% endtrans %}">
- <i class="icon-remove-circle"></i>
- </li>
- {% endif %}
- {% if thread.deleted %}
- <li class="thread-flag thread-deleted tooltip-top" title="{% trans %}This thread is deleted{% endtrans %}">
- <i class="icon-trash"></i>
- </li>
- {% endif %}
- <li class="thread-forum tooltip-top" title="{% trans %}Thread Forum{% endtrans %}">
- <a href="{{ url('forum', forum=thread.forum.pk, slug=thread.forum.slug) }}">{{ thread.forum.name }}</a>
- </li>
- </ul>
- <div class="thread-title">
- <a href="{{ url('thread', thread=thread.pk, slug=thread.slug) }}">{{ thread.name }}</a>
- </div>
- </div>
- </li>
- {% endfor %}
- </ul>
- </div>
- {{ pager() }}
- {% else %}
- <p class="lead">{% trans %}No new threads were started in last 48 hours.{% endtrans %}</p>
- {% endif %}
- </div>
- {% endblock %}
- {% 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 %}
|