leftypol_vichan/templates/post_form.html
RealAngeleno bd8b76a41f fix email logic and add nonoko setting to selectbox
Changes it so that if the user is mod and they can bypass fields, "email" will show up just fine. If not, "email" will become an options field, like on 4chan. The options field will show up for anybody if hide_email is set to true.
Nonoko will be in the selectbox if always_noko is set to true.
2024-01-30 10:05:44 -01:00

225 lines
10 KiB
HTML

<form name="post" onsubmit="return dopost(this);" enctype="multipart/form-data" action="{{ config.post_url }}" method="post">
{{ antibot.html() }}
{% if id %}<input type="hidden" name="thread" value="{{ id }}">{% endif %}
{{ antibot.html() }}
<input type="hidden" name="board" value="{{ board.uri }}">
{{ antibot.html() }}
{% if current_page %}
<input type="hidden" name="page" value="{{ current_page }}">
{% endif %}
{% if mod %}<input type="hidden" name="mod" value="1">{% endif %}
<table>
{% if not config.field_disable_name or (mod and post.mod|hasPermission(config.mod.bypass_field_disable, board.uri)) %}<tr>
<th>
<label for="name">{% trans %}Name{% endtrans %}</label>
{{ antibot.html() }}
</th>
<td>
<input type="text" name="name" id="name" size="25" maxlength="35" autocomplete="off"> {% if config.allow_no_country and config.country_flags %}<input type="checkbox" name="no_country" id="no_country"> <label for="no_country">{% trans %}Don't show my flag{% endtrans %}</label>{% endif %}
{{ antibot.html() }}
</td>
</tr>{% endif %}
{% if not config.field_disable_email or (mod and post.mod|hasPermission(config.mod.bypass_field_disable, board.uri)) %}<tr>
<th>
{% if (mod and not post.mod|hasPermission(config.mod.bypass_field_disable, board.uri) and config.field_email_selectbox) or (not mod and config.field_email_selectbox) or (config.hide_email) %}
<label for="email_selectbox">{% trans %}Options{% endtrans %}
{% else %}
<label for="email">{% trans %}Email{% endtrans %}
{% endif %}
{{ antibot.html() }}
</th>
<td>
{% if (mod and not post.mod|hasPermission(config.mod.bypass_field_disable, board.uri) and config.field_email_selectbox) or (not mod and config.field_email_selectbox) %}
<select name="email" id="email_selectbox" autocomplete="off">
<option value=""></option>
<option value="sage">sage</option>
{% if not config.always_noko %}<option value="noko">noko</option>{% endif %}
{% if config.always_noko %}<option value="nonoko">nonoko</option>{% endif %}
</select>
{% else %}
<input type="text" name="email" id="email" size="25" maxlength="30" autocomplete="off">
{% endif %}
{{ antibot.html() }}
{% if not (not (config.field_disable_subject or (id and config.field_disable_reply_subject)) or (mod and post.mod|hasPermission(config.mod.bypass_field_disable, board.uri))) %}
<input accesskey="s" style="margin-left:2px;" type="submit" name="post" value="{% if id %}{{ config.button_reply }}{% else %}{{ config.button_newtopic }}{% endif %}" />{% if config.spoiler_images %} <input type="checkbox" name="spoiler" id="spoiler"> <label for="spoiler">{% trans %}Spoiler Image{% endtrans %}</label> {% endif %}
{% endif %}
{{ antibot.html() }}
</td>
</tr>{% endif %}
{% if not (config.field_disable_subject or (id and config.field_disable_reply_subject)) or (mod and post.mod|hasPermission(config.mod.bypass_field_disable, board.uri)) %}<tr>
<th>
<label for="subject">{% trans %}Subject{% endtrans %}</label>
{{ antibot.html() }}
</th>
<td>
<input style="float:left;" type="text" name="subject" id="subject" size="25" maxlength="100" autocomplete="off">
<input accesskey="s" style="margin-left:2px;" type="submit" name="post" value="{% if id %}{{ config.button_reply }}{% else %}{{ config.button_newtopic }}{% endif %}" />{% if config.spoiler_images %} <input type="checkbox" name="spoiler" id="spoiler"> <label for="spoiler">{% trans %}Spoiler Image{% endtrans %}</label>{% endif %}
</td>
</tr>
{% endif %}
<tr>
<th>
<label for="body">{% trans %}Comment{% endtrans %}</label>
{{ antibot.html() }}
</th>
<td>
<textarea name="body" id="body" rows="5" cols="35"></textarea>
<br/>
<span id="countchar" class="countdown"></span>
{{ antibot.html() }}
{% if not (not (config.field_disable_subject or (id and config.field_disable_reply_subject)) or (mod and post.mod|hasPermission(config.mod.bypass_field_disable, board.uri))) %}
{% if not (not config.field_disable_email or (mod and post.mod|hasPermission(config.mod.bypass_field_disable, board.uri))) %}
<input accesskey="s" style="margin-left:2px;" type="submit" name="post" value="{% if id %}{{ config.button_reply }}{% else %}{{ config.button_newtopic }}{% endif %}" />{% if config.spoiler_images %} <input type="checkbox" name="spoiler" id="spoiler"> <label for="spoiler">{% trans %}Spoiler Image{% endtrans %}</label>{% endif %}
{% endif %}
{% endif %}
</td>
</tr>
{% if config.recaptcha %}
<tr>
<th>
<label for="captcha">{% trans %}Verification{% endtrans %}</label>
{{ antibot.html() }}
</th>
<td>
<div id="captcha" class="g-recaptcha" data-sitekey="{{ config.recaptcha_public }}"></div>
{{ antibot.html() }}
</td>
</tr>
{% endif %}
{% if config.captcha.enabled %}
<tr class='captcha'>
<th>
<label for="captcha_text">{% trans %}Verification{% endtrans %}</label>
</th>
<td>
{% if not config.captcha.local %}<script>load_captcha("{{ config.captcha.provider_get }}", "{{ config.captcha.extra }}");</script><noscript>{% endif %}
<input type='text' name='captcha_text' id='captcha_text' class='captcha_text' size='32' maxlength='6' autocomplete='off'>
<div class="captcha_html">
<img id="captcha_img" src="{{ config.captcha.provider_get }}?mode=get&raw=1" onClick="this.src='{{ config.captcha.provider_get }}?mode=get&raw=1&'+Date.now();document.getElementById('captcha_text').value = '';">
</div>
{% if not config.captcha.local %}</noscript>{% endif %}
</td>
</tr>
{% elseif config.new_thread_capt %}
{% if not id %}
<tr class='captcha'>
<th>
<label for="captcha_text">{% trans %}Verification{% endtrans %}</label>
</th>
<td>
{% if not config.captcha.local %}<script>load_captcha("{{ config.captcha.provider_get }}", "{{ config.captcha.extra }}");</script><noscript>{% endif %}
<input type='text' name='captcha_text' id='captcha_text' class='captcha_text' size='32' maxlength='6' autocomplete='off'>
<div class="captcha_html">
<img id="captcha_img" src="{{ config.captcha.provider_get }}?mode=get&raw=1" onClick="this.src='{{ config.captcha.provider_get }}?mode=get&raw=1&'+Date.now();document.getElementById('captcha_text').value = '';">
</div>
{% if not config.captcha.local %}</noscript>{% endif %}
</td>
</tr>
{% endif %}
{% endif %}
{% if config.user_flag %}
<tr>
<th><label for="user_flag">{% trans %}Flag{% endtrans %}</label>
<td>
<select name="user_flag" id="user_flag" style="float:left">
<option value="">{% trans %}None{% endtrans %}</option>
{% for flag, text in config.user_flags %}
<option value="{{ flag }}">{{ text }}</option>
{% endfor %}
</select>
{% if config.flag_preview %}
<img name="flag_preview" id="flag_preview" style="vertical-align:middle;margin:0px 3px;{{ config.flag_style }}">
{% endif %}
</td>
</tr>
{% endif %}
{% if config.allowed_tags and not id %}
<tr>
<th><label for="tag">{% trans %}Tag{% endtrans %}</label></th>
<td>
<select name="tag" id="tag">
{% for id, tag in config.allowed_tags %}
<option value="{{ id|e }}">{{ tag|e }}</option>
{% endfor %}
</select>
</td>
</tr>
{% endif %}
<tr id="upload">
<th>
<label for="upload_file">{% trans %}File{% endtrans %}</label>
</th>
<td>
<input type="file" name="file_multiple[]" id="upload_file" multiple/>
<script type="text/javascript">
if (typeof init_file_selector !== 'undefined') {
var iOS_ifs = !!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform);
if(!iOS_ifs) { init_file_selector({{ config.max_images }}); }
}
</script>
{% if config.allow_upload_by_url %}
<div style="float:none;text-align:left" id="upload_url">
<label for="file_url">{% trans %}Or URL{% endtrans %}</label>:
{% for counter in 1..config.max_images %}
<input style="display:inline" type="text" name="file_url{{ counter }}" id="file_url{{ counter }}" size="35">
</br>
{% endfor %}
</div>
{% endif %}
{{ antibot.html() }}
</td>
</tr>
{% if config.enable_embedding %}
<tr id="upload_embed">
<th>
<label for="embed">{% trans %}Embed{% endtrans %}</label>
{{ antibot.html() }}
</th>
<td>
<input type="text" name="embed" id="embed" value="" size="30" maxlength="120" autocomplete="off">
</td>
</tr>
{% endif %}
{% if mod and ((not id and post.mod|hasPermission(config.mod.sticky, board.uri)) or (not id and post.mod|hasPermission(config.mod.lock, board.uri)) or post.mod|hasPermission(config.mod.rawhtml, board.uri)) %}
<tr>
<th>
{% trans %}Flags{% endtrans %}
</th>
<td>
{% if not id and post.mod|hasPermission(config.mod.sticky, board.uri) %}<div class="center">
<label for="sticky">{% trans %}Sticky{% endtrans %}</label>
<input title="{% trans %}Sticky{% endtrans %}" type="checkbox" name="sticky" id="sticky"><br>
</div>{% endif %}
{% if not id and post.mod|hasPermission(config.mod.lock, board.uri) %}<div class="center">
<label for="lock">{% trans %}Lock{% endtrans %}</label><br>
<input title="{% trans %}Lock{% endtrans %}" type="checkbox" name="lock" id="lock">
</div>{% endif %}
{% if post.mod|hasPermission(config.mod.rawhtml, board.uri) %}<div class="center">
<label for="raw">{% trans %}Raw HTML{% endtrans %}</label><br>
<input title="{% trans %}Raw HTML{% endtrans %}" type="checkbox" name="raw" id="raw">
</div>{% endif %}
</td>
</tr>
{% endif %}
{% if not config.field_disable_password or (mod and post.mod|hasPermission(config.mod.bypass_field_disable, board.uri)) %}<tr>
<th>
<label for="password">{% trans %}Password{% endtrans %}</label>
{{ antibot.html() }}
</th>
<td>
<input type="text" name="password" id="password" value="" size="12" maxlength="18" autocomplete="off">
<span class="unimportant">{% trans %}(For file deletion.){% endtrans %}</span>
{{ antibot.html() }}
</td>
</tr>{% endif %}
</table>
{{ antibot.html(true) }}
<input type="hidden" name="hash" value="{{ antibot.hash() }}">
</form>
<script type="text/javascript">{% verbatim %}
rememberStuff();
{% endverbatim %}</script>