diff options
Diffstat (limited to 'src/application/templates/modern/new_topic.twig')
-rw-r--r-- | src/application/templates/modern/new_topic.twig | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/application/templates/modern/new_topic.twig b/src/application/templates/modern/new_topic.twig new file mode 100644 index 0000000..9cd18c9 --- /dev/null +++ b/src/application/templates/modern/new_topic.twig @@ -0,0 +1,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 %} |