summaryrefslogtreecommitdiff
path: root/src/application/templates/modern/new_topic.twig
blob: 9cd18c998c5a98b180eac76865a2950cae27c1a1 (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
{% set title = __("New topic") %}
{% set formId = "newtopic" %}
{% set formError = getAndClearFormError(formId) %}

{% extends "base.twig" %}

{% block content %}

<div class="page-header">
    <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" id="i_title" name="title" value="{{ lastFormField(formId, "title") }}" required autofocus>
    </div>
    <div class="form-group">
        <label for="i_message">{{ __("Message:") }}</label>
        {% include "components/richtext_editor.twig" with { id: "i_message", name: "message" } %}
    </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">
        <span>{{ __("Create topic") }}</span>
        <svg viewBox="0 0 24 24" class="icon"><path d="M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z"/><path d="M6 12h16"/></svg>
    </button>
</form>

{% endblock %}