nekrochan/templates/macros/post-form.html

101 řádky
4.2 KiB
HTML
Surový Normální zobrazení Historie

2023-12-25 13:53:44 +00:00
{% macro post_form(board, reply, reply_to) %}
2023-12-11 15:18:43 +00:00
<form method="post" enctype="multipart/form-data" action="/actions/create-post">
<input name="board" type="hidden" value="{{ board.id }}">
{% if reply %}
<input name="thread" type="hidden" value="{{ reply_to }}">
{% endif %}
<table class="form-table">
2023-12-25 13:53:44 +00:00
{% if reply %}
2023-12-11 15:18:43 +00:00
<tr>
<td colspan="2"><div class="reply-mode">Režim: Odpověď <a href="/boards/{{ board.id }}">[Zpět]</a></div></td>
</tr>
{% endif %}
<tr>
<td class="label">Jméno</td>
<td>
<input name="name" type="text" placeholder="{{ board.config.0.anon_name }}">
2023-12-11 15:18:43 +00:00
</td>
</tr>
<tr>
<td class="label">Email</td>
<td>
<input name="email" type="text" autocomplete="off">
</td>
</tr>
<tr>
<td class="label">Obsah</td>
<td>
2024-01-15 15:06:25 +00:00
<textarea name="content" {% if (!reply && board.config.0.require_thread_content) || (reply && board.config.0.require_reply_content) %}required=""{% endif %}></textarea>
2023-12-11 15:18:43 +00:00
</td>
</tr>
2024-02-21 15:15:07 +00:00
{% if !(tcx.perms.bypass_captcha() || tcx.perms.owner()) %}
{% let difficulty %}
{% if reply %}
{% let difficulty = board.config.0.reply_captcha.as_str() %}
{% else %}
{% let difficulty = board.config.0.thread_captcha.as_str() %}
{% endif %}
{% if (!reply && board.config.0.thread_captcha != "off") || (reply && board.config.0.reply_captcha != "off") %}
<tr>
<td class="label">
CAPTCHA<br>
<span class="small">(vyprší za 10 min.)</span>
<noscript><span class="small">(VYŽADUJE JAVASCRIPT)</span></noscript>
</td>
<td>
<div class="input-wrapper">
<table class="full-width">
<input id="captcha-id" name="captcha_id" type="hidden">
<tr>
<td>
<button id="get-captcha" type="button" class="button" data-board="{{ board.id }}" data-reply="{{ reply }}">Získat CAPTCHA</button>
</td>
<td>
<input name="captcha_solution" type="text" placeholder="Řešení" value="" required="">
</tr>
</tr>
<tr><td colspan="2"><div id="captcha"></div></tr>
</table>
</div>
</td>
</tr>
{% endif %}
{% endif %}
2023-12-11 15:18:43 +00:00
<tr>
<td class="label">
{% if board.config.0.file_limit > 1 %}
Soubory <span class="small">(max {{ board.config.0.file_limit }})</span>
{% else %}
Soubor
{% endif %}
</td>
2023-12-11 15:18:43 +00:00
<td>
<div class="input-wrapper">
2024-01-15 15:06:25 +00:00
<input name="files[]" type="file"{% if board.config.0.file_limit > 1 %} multiple="multiple"{% endif %}{% if (!reply && board.config.0.require_thread_file) || (reply && board.config.0.require_reply_file) %} required=""{% endif %}>
2023-12-11 15:18:43 +00:00
</div>
</td>
</tr>
<tr>
<td class="label">Spoiler?</td>
<td>
<div class="input-wrapper">
<input name="spoiler_files" type="checkbox">
</div>
</td>
</tr>
<tr>
<td class="label">Heslo <span class="small">(na odstranění)</span></td>
2024-02-20 21:09:52 +00:00
<td><input name="password" type="password" required=""></td>
2023-12-11 15:18:43 +00:00
</tr>
<tr>
{% if reply %}
2024-01-15 15:06:25 +00:00
<td colspan="2"><input class="button" type="submit" value="Nová odpověď"></td>
2023-12-11 15:18:43 +00:00
{% else %}
2024-01-15 15:06:25 +00:00
<td colspan="2"><input class="button" type="submit" value="Nové vlákno"></td>
2023-12-11 15:18:43 +00:00
{% endif %}
</tr>
</table>
</form>
{% endmacro %}