##// END OF EJS Templates
Moved adding linked posts from view to post manager. Cleaned up tests, added some more tests
Moved adding linked posts from view to post manager. Cleaned up tests, added some more tests

File last commit:

r362:a47dcfce default
r381:f21d714a default
Show More
posting_general.html
275 lines | 10.7 KiB | text/html | HtmlLexer
{% extends "boards/base.html" %}
{% load i18n %}
{% load markup %}
{% load cache %}
{% load board %}
{% block head %}
{% if tag %}
<title>Neboard - {{ tag.name }}</title>
{% else %}
<title>Neboard</title>
{% endif %}
{% if prev_page %}
<link rel="next" href="
{% if tag %}
{% url "tag" tag_name=tag page=prev_page %}
{% else %}
{% url "index" page=prev_page %}
{% endif %}
" />
{% endif %}
{% if next_page %}
<link rel="next" href="
{% if tag %}
{% url "tag" tag_name=tag page=next_page %}
{% else %}
{% url "index" page=next_page %}
{% endif %}
" />
{% endif %}
{% endblock %}
{% block content %}
{% get_current_language as LANGUAGE_CODE %}
{% if tag %}
<div class="tag_info">
<h2>
{% if tag in user.fav_tags.all %}
<a href="{% url 'tag_unsubscribe' tag.name %}?next={{ request.path }}"
class="fav">★</a>
{% else %}
<a href="{% url 'tag_subscribe' tag.name %}?next={{ request.path }}"
class="not_fav">★</a>
{% endif %}
#{{ tag.name }}
</h2>
</div>
{% endif %}
{% if threads %}
{% if prev_page %}
<div class="page_link">
<a href="
{% if tag %}
{% url "tag" tag_name=tag page=prev_page %}
{% else %}
{% url "index" page=prev_page %}
{% endif %}
">{% trans "Previous page" %}</a>
</div>
{% endif %}
{% for thread in threads %}
{% cache 600 thread_short thread.thread.last_edit_time moderator LANGUAGE_CODE %}
<div class="thread">
{% if thread.bumpable %}
<div class="post" id="{{ thread.thread.id }}">
{% else %}
<div class="post dead_post" id="{{ thread.thread.id }}">
{% endif %}
{% if thread.thread.image %}
<div class="image">
<a class="thumb"
href="{{ thread.thread.image.url }}"><img
src="{{ thread.thread.image.url_200x150 }}"
alt="{{ thread.thread.id }}"
data-width="{{ thread.thread.image_width }}"
data-height="{{ thread.thread.image_height }}" />
</a>
</div>
{% endif %}
<div class="message">
<div class="post-info">
<span class="title">{{ thread.thread.title }}</span>
<a class="post_id" href="{% url 'thread' thread.thread.id %}"
>({{ thread.thread.id }})</a>
[{{ thread.thread.pub_time }}]
[<a class="link" href="{% url 'thread' thread.thread.id %}#form"
>{% trans "Reply" %}</a>]
{% if moderator %}
<span class="moderator_info">
[<a href="{% url 'delete' post_id=thread.thread.id %}?next={{ request.path }}"
>{% trans 'Delete' %}</a>]
({{ thread.thread.poster_ip }})
[<a href="{% url 'ban' post_id=thread.thread.id %}?next={{ request.path }}"
>{% trans 'Ban IP' %}</a>]
</span>
{% endif %}
</div>
{% autoescape off %}
{{ thread.thread.text.rendered|truncatewords_html:50 }}
{% endautoescape %}
{% if thread.thread.is_referenced %}
<div class="refmap">
{% trans "Replies" %}:
{% for ref_post in thread.thread.get_sorted_referenced_posts %}
<a href="{% post_url ref_post.id %}">&gt;&gt;{{ ref_post.id }}</a
>{% if not forloop.last %},{% endif %}
{% endfor %}
</div>
{% endif %}
</div>
<div class="metadata">
{{ thread.thread.get_reply_count }} {% trans 'replies' %},
{{ thread.thread.get_images_count }} {% trans 'images' %}.
{% if thread.thread.tags %}
<span class="tags">
{% for tag in thread.thread.get_tags %}
<a class="tag" href="
{% url 'tag' tag_name=tag.name %}">
#{{ tag.name }}</a
>{% if not forloop.last %},{% endif %}
{% endfor %}
</span>
{% endif %}
</div>
</div>
{% if thread.last_replies.exists %}
<div class="last-replies">
{% for post in thread.last_replies %}
{% if thread.bumpable %}
<div class="post" id="{{ post.id }}">
{% else %}
<div class="post dead_post" id="{{ post.id }}">
{% endif %}
{% if post.image %}
<div class="image">
<a class="thumb"
href="{{ post.image.url }}"><img
src=" {{ post.image.url_200x150 }}"
alt="{{ post.id }}"
data-width="{{ post.image_width }}"
data-height="{{ post.image_height }}"/>
</a>
</div>
{% endif %}
<div class="message">
<div class="post-info">
<span class="title">{{ post.title }}</span>
<a class="post_id" href="
{% url 'thread' thread.thread.id %}#{{ post.id }}">
({{ post.id }})</a>
[{{ post.pub_time }}]
</div>
{% autoescape off %}
{{ post.text.rendered|truncatewords_html:50 }}
{% endautoescape %}
</div>
{% if post.is_referenced %}
<div class="refmap">
{% trans "Replies" %}:
{% for ref_post in post.get_sorted_referenced_posts %}
<a href="{% post_url ref_post.id %}">&gt;&gt;{{ ref_post.id }}</a
>{% if not forloop.last %},{% endif %}
{% endfor %}
</div>
{% endif %}
</div>
{% endfor %}
</div>
{% endif %}
</div>
{% endcache %}
{% endfor %}
{% if next_page %}
<div class="page_link">
<a href="
{% if tag %}
{% url "tag" tag_name=tag page=next_page %}
{% else %}
{% url "index" page=next_page %}
{% endif %}
">{% trans "Next page" %}</a>
</div>
{% endif %}
{% else %}
<div class="post">
{% trans 'No threads exist. Create the first one!' %}</div>
{% endif %}
<form enctype="multipart/form-data" method="post">{% csrf_token %}
<div class="post-form-w">
<div class="form-title">{% trans "Create new thread" %}</div>
<div class="post-form">
<div class="form-row">
<div class="form-label">{% trans 'Title' %}</div>
<div class="form-input">{{ form.title }}</div>
<div class="form-errors">{{ form.title.errors }}</div>
</div>
<div class="form-row">
<div class="form-label">{% trans 'Formatting' %}</div>
<div class="form-input" id="mark_panel">
<span class="mark_btn" id="quote"><span class="quote">&gt;{% trans 'quote' %}</span></span>
<span class="mark_btn" id="italic"><i>{% trans 'italic' %}</i></span>
<span class="mark_btn" id="bold"><b>{% trans 'bold' %}</b></span>
<span class="mark_btn" id="spoiler"><span class="spoiler">{% trans 'spoiler' %}</span></span>
<span class="mark_btn" id="comment"><span class="comment">// {% trans 'comment' %}</span></span>
</div>
</div>
<div class="form-row">
<div class="form-label">{% trans 'Text' %}</div>
<div class="form-input">{{ form.text }}</div>
<div class="form-errors">{{ form.text.errors }}</div>
</div>
<div class="form-row">
<div class="form-label">{% trans 'Image' %}</div>
<div class="form-input">{{ form.image }}</div>
<div class="form-errors">{{ form.image.errors }}</div>
</div>
<div class="form-row">
<div class="form-label">{% trans 'Tags' %}</div>
<div class="form-input">{{ form.tags }}</div>
<div class="form-errors">{{ form.tags.errors }}</div>
</div>
<div class="form-row form-email">
<div class="form-label">{% trans 'e-mail' %}</div>
<div class="form-input">{{ form.email }}</div>
<div class="form-errors">{{ form.email.errors }}</div>
</div>
<div class="form-row">
{{ form.captcha }}
<div class="form-errors">{{ form.captcha.errors }}</div>
</div>
<div class="form-row">
<div class="form-errors">{{ form.other.errors }}</div>
</div>
</div>
<div class="form-submit">
<input type="submit" value="{% trans "Post" %}"/></div>
<div>
{% trans 'Tags must be delimited by spaces. Text or image is required.' %}
</div>
<div><a href="{% url "staticpage" name="help" %}">
{% trans 'Text syntax' %}</a></div>
</div>
</form>
{% endblock %}
{% block metapanel %}
<span class="metapanel">
<b><a href="{% url "authors" %}">Neboard</a> 1.3</b>
{% trans "Pages:" %}
{% for page in pages %}
[<a href="
{% if tag %}
{% url "tag" tag_name=tag page=page %}
{% else %}
{% url "index" page=page %}
{% endif %}
">{{ page }}</a>]
{% endfor %}
[<a href="rss/">RSS</a>]
</span>
{% endblock %}