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 }}"{% if let Some(name) = tcx.name %}value="{{ name }}"{% endif %}>
|
|
|
|
</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>
|
|
|
|
<textarea name="content" {% if (!reply && board.config.0.require_thread_content) || (reply && board.config.0.require_reply_content) %}required="required"{% endif %}></textarea>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="label">Soubory</td>
|
|
|
|
<td>
|
|
|
|
<div class="input-wrapper">
|
|
|
|
<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="required"{% endif %}>
|
|
|
|
</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>
|
|
|
|
<td>
|
|
|
|
<input name="password" type="text" autocomplete="new-password" value="{{ tcx.password }}" required="">
|
|
|
|
</td>
|
|
|
|
</tr>
|
2023-12-25 13:53:44 +00:00
|
|
|
{% if !(tcx.perms.bypass_captcha() || tcx.perms.owner()) %}
|
2023-12-11 15:18:43 +00:00
|
|
|
{% if reply %}
|
|
|
|
{% if let Some((id, base64)) = board.reply_captcha() %}
|
|
|
|
<tr>
|
|
|
|
<td class="label">CAPTCHA</td>
|
|
|
|
<td>
|
|
|
|
<img class="captcha" src="data:image/png;base64,{{ base64 }}">
|
|
|
|
<input name="captcha_id" type="hidden" value="{{ id }}">
|
|
|
|
<input name="captcha_solution" type="text" placeholder="Řešení" required="required">
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endif %}
|
|
|
|
{% else %}
|
|
|
|
{% if let Some((id, base64)) = board.thread_captcha() %}
|
|
|
|
<tr>
|
|
|
|
<td class="label">CAPTCHA</td>
|
|
|
|
<td>
|
|
|
|
<img class="captcha" src="data:image/png;base64,{{ base64 }}">
|
|
|
|
<input name="captcha_id" type="hidden" value="{{ id }}">
|
|
|
|
<input name="captcha_solution" type="text" placeholder="Řešení" required="required">
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
<tr>
|
|
|
|
{% if reply %}
|
|
|
|
<td class="submit" colspan="2"><input class="button" type="submit" value="Nová odpověď"></td>
|
|
|
|
{% else %}
|
|
|
|
<td class="submit" colspan="2"><input class="button" type="submit" value="Nové vlákno"></td>
|
|
|
|
{% endif %}
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</form>
|
|
|
|
{% endmacro %}
|