##// END OF EJS Templates
Added centrifuge (websocket) support for thread autoupdate. Only websocket version is supported for now
Added centrifuge (websocket) support for thread autoupdate. Only websocket version is supported for now

File last commit:

r853:ea46532a default
r853:ea46532a default
Show More
thread.html
107 lines | 3.8 KiB | text/html | HtmlLexer
{% extends "boards/base.html" %}
{% load i18n %}
{% load cache %}
{% load static from staticfiles %}
{% load board %}
{% load compress %}
{% block head %}
<title>{{ opening_post.get_title|striptags|truncatewords:10 }}
- {{ site_name }}</title>
{% endblock %}
{% block content %}
{% spaceless %}
{% get_current_language as LANGUAGE_CODE %}
{% cache 600 thread_view thread.id thread.last_edit_time moderator LANGUAGE_CODE %}
<div class="image-mode-tab">
<a class="current_mode" href="{% url 'thread' opening_post.id %}">{% trans 'Normal mode' %}</a>,
<a href="{% url 'thread_mode' opening_post.id 'gallery' %}">{% trans 'Gallery mode' %}</a>
</div>
{% if bumpable %}
<div class="bar-bg">
<div class="bar-value" style="width:{{ bumplimit_progress }}%" id="bumplimit_progress">
</div>
<div class="bar-text">
<span id="left_to_limit">{{ posts_left }}</span> {% trans 'posts to bumplimit' %}
</div>
</div>
{% endif %}
<div class="thread">
{% with can_bump=thread.can_bump %}
{% for post in thread.get_replies %}
{% if forloop.first %}
{% post_view post moderator=moderator is_opening=True thread=thread can_bump=can_bump opening_post_id=opening_post.id %}
{% else %}
{% post_view post moderator=moderator is_opening=False thread=thread can_bump=can_bump opening_post_id=opening_post.id %}
{% endif %}
{% endfor %}
{% endwith %}
</div>
{% if not thread.archived %}
<div class="post-form-w" id="form">
<script src="{% static 'js/panel.js' %}"></script>
<div class="form-title">{% trans "Reply to thread" %} #{{ opening_post.id }}</div>
<div class="post-form" id="compact-form">
<div class="swappable-form-full">
<form enctype="multipart/form-data" method="post"
>{% csrf_token %}
<div class="compact-form-text"></div>
{{ form.as_div }}
<div class="form-submit">
<input type="submit" value="{% trans "Post" %}"/>
</div>
</form>
</div>
<a onclick="swapForm(); return false;" href="#">
{% trans 'Switch mode' %}
</a>
<div><a href="{% url "staticpage" name="help" %}">
{% trans 'Text syntax' %}</a></div>
</div>
</div>
<script src="{% static 'js/jquery.form.min.js' %}"></script>
{% compress js %}
<script src="{% static 'js/thread_update.js' %}"></script>
<script src="{% static 'js/3party/centrifuge.js' %}"></script>
{% endcompress %}
{% endif %}
{% compress js %}
<script src="{% static 'js/form.js' %}"></script>
<script src="{% static 'js/thread.js' %}"></script>
{% endcompress %}
{% endcache %}
{% endspaceless %}
{% endblock %}
{% block metapanel %}
{% get_current_language as LANGUAGE_CODE %}
<span class="metapanel"
data-last-update="{{ last_update }}"
data-ws-token="{{ ws_token }}"
data-ws-project="{{ ws_project }}"
data-ws-host="{{ ws_host }}"
data-ws-port="{{ ws_port }}">
{% cache 600 thread_meta thread.last_edit_time moderator LANGUAGE_CODE %}
<span id="autoupdate">[-]</span>
<span id="reply-count">{{ thread.get_reply_count }}</span>/{{ max_replies }} {% trans 'messages' %},
<span id="image-count">{{ thread.get_images_count }}</span> {% trans 'images' %}.
{% trans 'Last update: ' %}<span id="last-update">{{ thread.last_edit_time }}</span>
[<a href="rss/">RSS</a>]
{% endcache %}
</span>
{% endblock %}