123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- {% 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 %}Activity{% endtrans %}</div>
- </div>
- </div>
- </div>
- {% for thread in threads %}
- <div class="thread-row{% if not thread.is_read %} thread-new{% endif %}{% if loop.last %} thread-last{% endif %}">
- <div class="row-fluid">
- <div class="span7">
- {% 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 %}"><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>
- {{ macros.thread_flags(thread) }}
-
- <div class="thread-details">
- {% trans user=thread_starter(thread), forum=thread_forum(thread), start=thread.start|reltimesince|low %}by {{ user }} in {{ forum }} {{ start }}{% endtrans %}
- </div>
- </div>
- <div class="span5 thread-activity">
- {% if settings.avatars_on_threads_list %}
- <div 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(40) }}" alt=""></a>
- {% else %}
- <img src="{{ macros.avatar_guest(40) }}" alt="" class="user-avatar">
- {% endif %}
- </div>
- {% endif %}
- <div class="thread-replies">
- <strong class="lead">{{ thread_reply(thread) }}, {{ thread.last|reldate|low }}</strong><br>
- {{ replies(thread.replies) }}, <span{% if (thread.upvotes-thread.downvotes) > 0 %} class="text-success"{% elif (thread.upvotes-thread.downvotes) < 0 %} class="text-error"{% endif %}><strong>{% if (thread.upvotes-thread.downvotes) > 0 %}+{% elif (thread.upvotes-thread.downvotes) < 0 %}-{% endif %}</strong>{% trans rating=(thread.upvotes-thread.downvotes)|abs|intcomma %}{{ rating }} thread rating{% endtrans %}</span>
- </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 %}
|