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.
This commit is contained in:
RealAngeleno 2023-07-10 03:39:34 -07:00 committed by -
parent eb1225a6b6
commit bd8b76a41f

View File

@ -21,19 +21,20 @@
</tr>{% endif %} </tr>{% endif %}
{% if not config.field_disable_email or (mod and post.mod|hasPermission(config.mod.bypass_field_disable, board.uri)) %}<tr> {% if not config.field_disable_email or (mod and post.mod|hasPermission(config.mod.bypass_field_disable, board.uri)) %}<tr>
<th> <th>
{% if config.field_email_selectbox %} {% 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 %}</label> <label for="email_selectbox">{% trans %}Options{% endtrans %}
{% else %} {% else %}
<label for="email">{% trans %}Email{% endtrans %}</label> <label for="email">{% trans %}Email{% endtrans %}
{% endif %} {% endif %}
{{ antibot.html() }} {{ antibot.html() }}
</th> </th>
<td> <td>
{% if config.field_email_selectbox %} {% 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"> <select name="email" id="email_selectbox" autocomplete="off">
<option value=""></option> <option value=""></option>
<option value="sage">sage</option> <option value="sage">sage</option>
{% if not config.always_noko %}<option value="noko">noko</option>{% endif %} {% if not config.always_noko %}<option value="noko">noko</option>{% endif %}
{% if config.always_noko %}<option value="nonoko">nonoko</option>{% endif %}
</select> </select>
{% else %} {% else %}
<input type="text" name="email" id="email" size="25" maxlength="30" autocomplete="off"> <input type="text" name="email" id="email" size="25" maxlength="30" autocomplete="off">