leftypol_vichan/templates/mod/warning_form.html
discomrade 4b5da78aca Change layout of view IP page
This includes reducing the field size for notes and telegrams. and moving logs and actions above the post list (as it can become very long), excluding warnings and bans in order to discourage banning IPs instead of the infringing post.
2024-01-30 10:05:42 -01:00

85 lines
2.5 KiB
HTML

{% if post and board %}
{% set action = '?/' ~ board ~ '/warning/' ~ post %}
{% else %}
{% set action = '?/warning' %}
{% endif %}
{% if reasons %}
<script type="text/javascript">
$(document).ready(function(){
{% for key, reason in reasons %}
var data_{{ key }} = '{"reason":"{{ reason|escape('js') }}","message":"{{ reason|escape('js') }}"}';
$('#reason-selector-id-{{ key }}').click(function() { populateFormJQuery('#warning-form-id', $.parseJSON(data_{{ key }})); });
{% endfor %}
});
</script>
{% endif %}
<form action="{{ action }}" method="post" id="warning-form-id">
<input type="hidden" name="token" value="{{ token }}">
{% if redirect %}
<input type="hidden" name="redirect" value="{{ redirect|e }}">
{% endif %}
{% if post and board %}
<input type="hidden" name="delete" value="{% if delete %}1{% else %}0{% endif %}">
{% endif %}
<table>
<tr>
<th>
<label for="ip">{% trans 'IP' %}</label>
</th>
<td>
{% if not hide_ip %}
<input type="text" name="ip" id="ip" size="30" maxlength="40" value="{{ ip|e }}">
{% else %}
<em>{% trans 'hidden' %}</em>
{% endif %}
</td>
</tr>
<tr>
<th>
<label for="reason">{% trans 'Reason' %}</label>
</th>
<td>
<textarea name="reason" id="reason" rows="3" cols="30">{{ reason|e }}</textarea>
</td>
</tr>
{% if post and board and not delete %}
<tr>
<th>
<label for="message">{% trans 'Message' %}</label>
</th>
<td>
<input type="checkbox" id="public_message" name="public_message"{% if config.mod.check_warning_message %} checked{% endif %}>
<input type="text" name="message" id="message" size="35" maxlength="200" value="{{ config.mod.default_warning_message|e }}">
<span class="unimportant">({% trans 'public; attached to post' %})</span>
<script type="text/javascript">
document.getElementById('message').disabled = !document.getElementById('public_message').checked;
document.getElementById('public_message').onchange = function() {
document.getElementById('message').disabled = !this.checked;
}
</script>
</td>
</tr>
{% endif %}
<tr>
<td></td>
<td><input name="new_warning" type="submit" value="{% trans 'New Warning' %}"></td>
</tr>
</table>
</form>
{% if reasons %}
<center>
<h3>Predefined Reasons:</h3>
<table class="warning-reason-table">
<tr id="reason-selector-heading">
<th><b>Reason</b></th>
</tr>
{% for key, reason in reasons %}
<tr id="reason-selector-id-{{ key }}">
<td>{{ reason|e }}</td>
</tr>
{% endfor %}
</table>
</center>
{% endif %}