2017-05-02 02:03:14 +00:00
|
|
|
{% if post and board %}
|
|
|
|
{% set action = '?/' ~ board ~ '/warning/' ~ post %}
|
|
|
|
{% else %}
|
|
|
|
{% set action = '?/warning' %}
|
|
|
|
{% endif %}
|
|
|
|
|
2017-05-17 18:20:41 +00:00
|
|
|
{% 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">
|
2017-05-02 02:03:14 +00:00
|
|
|
<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>
|
2022-02-25 01:49:55 +00:00
|
|
|
<textarea name="reason" id="reason" rows="3" cols="30">{{ reason|e }}</textarea>
|
2017-05-02 02:03:14 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
2017-06-06 21:12:15 +00:00
|
|
|
{% if post and board and not delete %}
|
2017-05-02 02:03:14 +00:00
|
|
|
<tr>
|
|
|
|
<th>
|
2017-05-17 18:20:41 +00:00
|
|
|
<label for="message">{% trans 'Message' %}</label>
|
2017-05-02 02:03:14 +00:00
|
|
|
</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>
|
2017-05-17 18:20:41 +00:00
|
|
|
{% 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 %}
|