forked from mozilla/kitsune
-
Notifications
You must be signed in to change notification settings - Fork 1
/
new_thread.html
49 lines (44 loc) · 1.77 KB
/
new_thread.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{# vim: set ts=2 et sts=2 sw=2: #}
{% extends "forums/base.html" %}
{% from "layout/errorlist.html" import errorlist %}
{% from "includes/common_macros.html" import content_editor with context %}
{# L10n: {f} if the name of the forum. #}
{% set title = _('Create a new thread | {f} | Forums')|f(f=forum.name) %}
{% set crumbs = [(url('forums.forums'), _('Forums')),
(url('forums.threads', forum.slug), forum.name),
(None, _('Create a new thread'))] %}
{% block content %}
<div id="new-thread" class="grid_12">
<h1>{{ _('Create a new thread') }}</h1>
<form action="{{ url('forums.new_thread', forum.slug) }}" method="post" class="new-thread">
{{ csrf() }}
{{ errorlist(form) }}
{% for field in form %}
<div class="form-widget{% if field.errors %} invalid{% endif %}">
{{ field.label_tag()|safe }}
{% if field.name == 'content' %}
<div class="content-box">
{{ content_editor(field) }}
</div>
{% else %}
{{ field|safe }}
{% endif %}
</div>
{% endfor %}
<div class="form-widget submit">
<button type="submit" class="btn btn-submit big">{{ _('Post Thread') }}</button>
<button type="submit" class="btn" id="preview" name="preview"
data-preview-url="{{ url('forums.post_preview_async') }}"
data-preview-container-id="post-preview"
data-preview-content-id="id_content">{{ _('Preview') }}
</button>
<a class="btn" href="{{ url('forums.threads', forum.slug) }}">{{ _('Cancel') }}</a>
</div>
<div id="post-preview">
{% if post_preview %}
{% include "forums/includes/post_preview.html" %}
{% endif %}
</div>
</form>
</div>
{% endblock %}