diff options
author | Jonas Kohl | 2024-09-14 17:59:13 +0200 |
---|---|---|
committer | Jonas Kohl | 2024-09-14 17:59:13 +0200 |
commit | d8b74761c6cefdd83360d3f2add0e9ccdc6064c7 (patch) | |
tree | 5e2c947b4a90ae475a7e75897077246e5ea0a948 /src/application/views/form_newtopic.php | |
parent | 948cead0f11d33adbcf0d08773c716e1b6ebb101 (diff) |
Even more changes (devel commit messages are useless)
Diffstat (limited to 'src/application/views/form_newtopic.php')
-rw-r--r-- | src/application/views/form_newtopic.php | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/src/application/views/form_newtopic.php b/src/application/views/form_newtopic.php index d5cbfbd..2e58268 100644 --- a/src/application/views/form_newtopic.php +++ b/src/application/views/form_newtopic.php @@ -3,22 +3,32 @@ use mystic\forum\Messaging; use mystic\forum\utils\RequestUtils; -if (($_formError = RequestUtils::getAndClearFormError()) !== null) { - Messaging::error($_formError); -} - $lastFormUri = ""; $lastForm = RequestUtils::getLastForm($lastFormUri) ?? []; if ($lastFormUri !== $_SERVER["REQUEST_URI"]) $lastForm = []; RequestUtils::clearLastForm(); ?> -<form action="<?= htmlentities($_SERVER["REQUEST_URI"]) ?>" method="post"> -<strong>Topic title:</strong><br> -<input type="text" name="title" value="<?= htmlentities($lastForm["title"] ?? "") ?>" required><br> - -<strong>Message:</strong><br> -<textarea name="message" rows="12" cols="60" required></textarea><br> - -<button type="submit">Create topic</button> +<div class="page-header margin-top-0"> + <h1>New topic</h1> +</div> +<?php +if (($_formError = RequestUtils::getAndClearFormError()) !== null) { + _view("alert_error", ["message" => $_formError]); +} +?> +<form action="<?= htmlentities($_SERVER["REQUEST_URI"]) ?>#form" method="post" enctype="multipart/form-data"> +<div class="form-group"> + <label for="i_message">Topic title:</label> + <input type="text" class="form-control" id="i_title" name="title" value="<?= htmlentities($lastForm["title"] ?? "") ?>" required autofocus> +</div> +<div class="form-group"> + <label for="i_message">Message:</label> + <textarea class="form-control" id="i_message" name="message" required rows="12" cols="60" style="resize:vertical;max-height:499px"><?= htmlentities($lastForm["message"] ?? "") ?></textarea> +</div> +<div class="form-group"> + <label for="i_files">Attachments: <small>(max. <?= htmlentities(MAX_ATTACHMENT_COUNT) ?> files, max. <?= htmlentities(MAX_ATTACHMENT_SIZE >> 20) ?> MiB each)</small></label> + <input type="file" name="files[]" id="i_files" multiple accept="*/*"> +</div> +<button type="submit" class="btn btn-success">Create topic</button> </form> |