123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177 |
- {% extends "sora/layout.html" %}
- {% load i18n %}
- {% load url from future %}
- {% import "sora/editor.html" as editor with context %}
- {% import "sora/macros.html" as macros with context %}
- {% block title %}{{ macros.page_title(title=thread.name,parent=forum.name,page=pagination['page']) }}{% endblock %}
- {% block breadcrumb %}{{ super() }} <span class="divider">/</span></li>
- {% for parent in parents %}
- <li class="first"><a href="{{ parent.type|url(forum=forum.pk, slug=forum.slug) }}">{{ parent.name }}</a> <span class="divider">/</span></li>
- {% endfor %}
- <li class="active">{{ thread.name }}
- {%- endblock %}
- {% block content %}
- <div class="page-header">
- <ul class="breadcrumb">
- {{ self.breadcrumb() }}</li>
- </ul>
- <h1>{{ thread.name }}</h1>
- <ul class="unstyled thread-info">
- {% if thread.moderated %}<li><i class="icon-eye-close"></i> {% trans %}Not Reviewed{% endtrans %}</li>{% endif %}
- <li><i class="icon-time"></i> {{ thread.last|reltimesince }}</li>
- <li><i class="icon-user"></i> {% if thread.start_poster_id %}<a href="{% url 'user' user=thread.start_poster_id, username=thread.start_poster_slug %}">{{ thread.start_poster_name }}</a>{% else %}{{ thread.start_poster_name }}{% endif %}</li>
- <li><i class="icon-comment"></i> {% if thread.replies > 0 -%}
- {% trans count=thread.replies, replies=thread.replies|intcomma %}One reply{% pluralize %}{{ replies }} replies{% endtrans %}
- {%- else -%}
- {% trans %}No replies{% endtrans %}
- {%- endif %}</li>
- </ul>
- </div>
- {% if message %}{{ macros.draw_message(message) }}{% endif %}
- <div class="list-nav">
- {{ pager() }}
- {% if user.is_authenticated() %}
- <ul class="nav nav-pills pull-right">
- <li class="info"><a href="{% url 'thread_new' forum=forum.pk, slug=forum.slug %}"><i class="icon-ok"></i> {% trans %}Watch Thread{% endtrans %}</a></li>{% if acl.threads.can_reply(thread) %}
- <li class="primary"><a href="{% url 'thread_new' forum=forum.pk, slug=forum.slug %}"><i class="icon-plus"></i> {% trans %}Reply{% endtrans %}</a></li>{% endif %}
- </ul>
- {% endif %}
- </div>
- <div class="posts-list">
- {% for post in posts %}
- {% if post.message %}{{ macros.draw_message(post.message) }}{% endif %}
- <div id="post-{{ post.pk }}" class="well well-post{% if post.user and post.user.rank and post.user.rank.style %} {{ post.user.rank.style }}{% endif %}">
- <div class="post-author">
- <img src="{{ post.user.get_avatar() }}" alt="" class="avatar-normal">
- <div class="post-bit">
- <a href="{% url 'user' user=post.user.pk, username=post.user.username_slug %}" class="lead">{{ post.user.username }}</a>{% if post.user.get_title() %}
- <p class="user-title">{{ _(post.user.get_title()) }}</p>{% endif %}
- <p class="post-date">{{ post.date|reltimesince|low }}</p>
- </div>
- </div>
- <div class="post-content">
- <a href="{% if pagination['page'] > 1 -%}
- {% url 'thread' thread=thread.pk, slug=thread.slug, page=pagination['page'] %}
- {%- else -%}
- {% url 'thread' thread=thread.pk, slug=thread.slug %}
- {%- endif %}#post-{{ post.pk }}" class="post-perma pull-right tooltip-left" title="{% trans %}Direct link to this post{% endtrans %}">#{{ pagination['start'] + loop.index }}</a>
- {% if not post.is_read %}
- <span class="label label-warning pull-right">
- {% trans %}New{% endtrans %}
- </span>
- {% endif %}
- {% if post.moderated %}
- <span class="label label-purple pull-right">
- {% trans %}Unreviewed{% endtrans %}
- </span>
- {% endif %}
- {% if post.reported %}
- <span class="label label-important pull-right">
- {% trans %}Reported{% endtrans %}
- </span>
- {% endif %}
- {% if post.deleted %}
- <span class="label label-inverse pull-right">
- {% trans %}Deleted{% endtrans %}
- </span>
- {% endif %}
- <div class="markdown">
- {{ post.post_preparsed|safe }}
- </div>
- {% if post.user.signature %}
- <div class="post-foot">
- {# <p class='lead'><a href="{% url 'user' user=post.user.pk, username=post.user.username_slug %}" class="lead">{{ post.user.username }}</a>, {{ post.date|reltimesince|low }}</p> #}
- {% if post.user.signature %}
- <div class="signature">
- <div class="markdown">
- {{ post.user.signature_preparsed|safe }}
- </div>
- </div>
- {% endif %}
- </div>
- {% endif %}
- </div>
- <div class="post-nav">
- <ul class="nav nav-pills pull-right">
- <li><a href="#"><i class="icon-info-sign"></i> {% trans %}Info{% endtrans %}</a></li>
- <li><button class="btn danger"><i class="icon-remove"></i> {% trans %}Delete{% endtrans %}</button></li>
- <li><a href="#"><i class="icon-edit"></i> {% trans %}Edit{% endtrans %}</a></li>
- <li><a href="#"><i class="icon-comment"></i> {% trans %}Reply{% endtrans %}</a></li>
- </ul>
- </div>
- </div>
- {% if post.checkpoint_set.all() %}
- <div class="post-checkpoints">
- {% for checkpoint in post.checkpoint_set.all() %}
- <div class="checkpoint">
- <hr>
- <span>
- {%- if checkpoint.action == 'limit' -%}
- <i class="icon-lock"></i> {% trans %}This thread has reached its post limit and has been closed.{% endtrans %}
- {%- elif checkpoint.action == 'accepted' -%}
- <i class="icon-ok"></i> {% trans user=checkpoint_user(checkpoint), date=checkpoint.date|reltimesince|low %}{{ user }} accepted this thread {{ date }}{% endtrans %}
- {%- elif checkpoint.action == 'closed' -%}
- <i class="icon-lock"></i> {% trans user=checkpoint_user(checkpoint), date=checkpoint.date|reltimesince|low %}{{ user }} closed this thread {{ date }}{% endtrans %}
- {%- elif checkpoint.action == 'opened' -%}
- <i class="icon-lock"></i> {% trans user=checkpoint_user(checkpoint), date=checkpoint.date|reltimesince|low %}{{ user }} opened this thread {{ date }}{% endtrans %}
- {%- elif checkpoint.action == 'deleted' -%}
- <i class="icon-trash"></i> {% trans user=checkpoint_user(checkpoint), date=checkpoint.date|reltimesince|low %}{{ user }} deleted this thread {{ date }}{% endtrans %}
- {%- elif checkpoint.action == 'undeleted' -%}
- <i class="icon-trash"></i> {% trans user=checkpoint_user(checkpoint), date=checkpoint.date|reltimesince|low %}{{ user }} restored this thread {{ date }}{% endtrans %}
- {%- endif -%}
- </span>
- </div>
- {% endfor %}
- </div>
- {% endif %}
- {% endfor %}
- </div>
- <div class="list-nav last">
- {{ pager(false) }}
- {% if user.is_authenticated() and acl.threads.can_reply(thread) %}
- <ul class="nav nav-pills pull-right">
- <li class="primary"><a href="{% url 'thread_new' forum=forum.pk, slug=forum.slug %}"><i class="icon-plus"></i> {% trans %}Reply{% endtrans %}</a></li>
- </ul>
- {% endif %}
- </div>
- {% if user.is_authenticated() and acl.threads.can_reply(thread) %}
- <div class="quick-reply">
- <form action="{% url 'thread_reply' thread=thread.pk, slug=thread.slug %}" method="post">
- <input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}">
- <input type="hidden" name="quick_reply" value="1">
- <img src="{{ user.get_avatar(big) }}" alt="{% trans %}Your Avatar{% endtrans %}" class="avatar-big">
- <div class="arrow"></div>
- {{ editor.editor(quick_reply.post, _('Post Reply')) }}
- </form>
- </div>
- {% endif %}
- {% endblock %}
- {% macro pager(extra=true) %}
- <ul class="pager pull-left">
- {%- if pagination['prev'] > 1 %}<li><a href="{% url 'thread' slug=thread.slug, thread=thread.id %}" class="tooltip-top" title="{% trans %}Go to first page{% endtrans %}"><i class="icon-chevron-left"></i> {% trans %}First{% endtrans %}</a></li>{% endif -%}
- {%- if pagination['prev'] > 0 %}<li><a href="{%- if pagination['prev'] > 1 %}{% url 'thread' slug=thread.slug, thread=thread.id, page=pagination['prev'] %}{% else %}{% url 'thread' slug=thread.slug, thread=thread.id %}{% endif %}" class="tooltip-top" title="{% trans %}Older Posts{% endtrans %}"><i class="icon-chevron-left"></i></a></li>{% endif -%}
- {%- if pagination['next'] > 0 %}<li><a href="{% url 'thread' slug=thread.slug, thread=thread.id, page=pagination['next'] %}" class="tooltip-top" title="{% trans %}Newest Posts{% endtrans %}"><i class="icon-chevron-right"></i></a></li>{% endif -%}
- {%- if pagination['next'] > 0 and pagination['next'] < pagination['total'] %}<li><a href="{% url 'thread' slug=thread.slug, thread=thread.id, page=pagination['total'] %}" class="tooltip-top" title="{% trans %}Go to last page{% endtrans %}">{% trans %}Last{% endtrans %} <i class="icon-chevron-right"></i></a></li>{% endif -%}
- <li class="count">
- {%- trans current_page=pagination['page'], pages=pagination['total'] -%}
- Page {{ current_page }} of {{ pages }}
- {%- endtrans -%}
- </li>
- {% if extra and user.is_authenticated() %}
- {% if not is_read %}<li class="unread"><a href="{% url 'thread_new' slug=thread.slug, thread=thread.id %}" class="tooltip-top" title="{% trans %}Go to first unread{% endtrans %}"><i class="icon-star"></i> {% trans %}First Unread{% endtrans %}</a></li>{% endif %}
- {% if thread.replies_moderated > 0 and acl.threads.can_approve(forum) %}<li class="moderated"><a href="{% url 'thread_moderated' slug=thread.slug, thread=thread.id %}" class="tooltip-top" title="{% trans %}Go to first post awaiting review{% endtrans %}"><i class="icon-eye-close"></i> {% trans %}First Unreviewed{% endtrans %}</a></li>{% endif %}
- {% if thread.replies_reported > 0 and acl.threads.can_mod_posts(thread) %}<li class="reported"><a href="{% url 'thread_reported' slug=thread.slug, thread=thread.id %}" class="tooltip-top" title="{% trans %}Go to first reported post{% endtrans %}"><i class="icon-fire"></i> {% trans %}First Reported{% endtrans %}</a></li>{% endif %}
- {% endif %}
- </ul>
- {% endmacro %}
- {% macro checkpoint_user(checkpoint) -%}
- {{ ('<a href="' ~ 'user'|url(user=checkpoint.user_id, username=checkpoint.user_slug) ~ '">')|safe ~ (checkpoint.user_name) ~ ("</a>")|safe }}
- {%- endmacro %}
|