summaryrefslogtreecommitdiff
path: root/src/application/templates/bootstrap-3/new_topic.twig
blob: a1fea14201262e8e6e44b0ebee0f44fc147ef910 (plain)
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
50
51
52
53
54
55
56
57
58
{% set title = __("New topic") %}
{% set formId = "newtopic" %}
{% set formError = getAndClearFormError(formId) %}

{% extends "base.twig" %}

{% block content %}

<div class="page-header margin-top-0">
    <h1>{{ __("New topic") }}</h1>
</div>

{% if formError %}
    {% include "components/alert_error.twig" with { message: formError } %}
{% endif %}
<form action="{{ g.server.REQUEST_URI }}" method="post" enctype="multipart/form-data">
    <input type="hidden" name="form_id" value="{{ formId }}">
    <div class="form-group">
        <label for="i_title">{{ __("Topic title:") }}</label>
        <input type="text" class="form-control" id="i_title" name="title" value="{{ lastFormField(formId, "title") }}" required autofocus>
    </div>
    <div class="form-group">
        <label for="i_message">{{ __("Message:") }}</label>
        <div class="panel panel-default">
            <div class="panel-heading" style="padding:4px">
                <div class="btn-toolbar" role="toolbar">
                    <div class="btn-group" role="group">
                        <button data-area="#i_message" title="{{ __("Bold") }}" data-editor-command="bold" type="button" class="btn btn-default btn-xs"><i class="fa fa-fw fa-bold"></i></button>
                        <button data-area="#i_message" title="{{ __("Italic") }}" data-editor-command="italic" type="button" class="btn btn-default btn-xs"><i class="fa fa-fw fa-italic"></i></button>
                        <button data-area="#i_message" title="{{ __("Underlined") }}" data-editor-command="underline" type="button" class="btn btn-default btn-xs"><i class="fa fa-fw fa-underline"></i></button>
                        <button data-area="#i_message" title="{{ __("Strikethrough") }}" data-editor-command="strikethrough" type="button" class="btn btn-default btn-xs"><i class="fa fa-fw fa-strikethrough"></i></button>
                    </div>
                    <div class="btn-group" role="group">
                        <button data-area="#i_message" title="{{ __("Superscript") }}" data-editor-command="sup" type="button" class="btn btn-default btn-xs"><i class="fa fa-fw fa-superscript"></i></button>
                        <button data-area="#i_message" title="{{ __("Subscript") }}" data-editor-command="sub" type="button" class="btn btn-default btn-xs"><i class="fa fa-fw fa-subscript"></i></button>
                    </div>
                    <div class="btn-group" role="group">
                        <button data-area="#i_message" title="{{ __("Quote") }}" data-editor-command="quote" type="button" class="btn btn-default btn-xs"><i class="fa fa-fw fa-quote-left"></i></button>
                        <button data-area="#i_message" title="{{ __("Spoiler") }}" data-editor-command="spoiler" type="button" class="btn btn-default btn-xs"><i class="fa fa-fw fa-eye"></i></button>
                    </div>
                </div>
            </div>
            <div class="panel-body" style="padding:0">
                <textarea class="form-control" id="i_message" name="message" required rows="12" cols="60" style="resize:vertical;max-height:499px;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;margin:-1px;width:calc(100% + 2px)">{{ lastFormField(formId, "message") }}</textarea>
            </div>
        </div>
    </div>
    <div class="form-group">
        <label for="i_files">{{ __("Attachments: <small>(max. %max_attachment_count% files, max. %max_attachment_size% MiB each)</small>", {
            "max_attachment_count": constant("MAX_ATTACHMENT_COUNT"),
            "max_attachment_size": constant("MAX_ATTACHMENT_SIZE") // (2**20),
        }) }}</label>
        <input type="file" name="files[]" id="i_files" multiple accept="*/*">
    </div>
    <button type="submit" class="btn btn-success">{{ __("Create topic") }} <span class="fa fa-send" aria-hidden="true"></span></button>
</form>

{% endblock %}