summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorMichael Foster <savetheinternet@tinyboard.org>2013-09-21 12:51:23 +1000
committerMichael Foster <savetheinternet@tinyboard.org>2013-09-21 12:51:23 +1000
commita9b7f9b1bc88b196a165ebb1bb74d01081d1e6fd (patch)
tree1a08bb6553233070a29f2422dc73d6a39f4ac381 /templates
parentdf143c6b50efa82548417c6c782069064c634e0c (diff)
begin implementation of in-built ban appealing
Diffstat (limited to 'templates')
-rw-r--r--templates/banned.html56
-rw-r--r--templates/mod/ban_appeals.html106
-rw-r--r--templates/mod/dashboard.html3
3 files changed, 159 insertions, 6 deletions
diff --git a/templates/banned.html b/templates/banned.html
index 79648156..666521a4 100644
--- a/templates/banned.html
+++ b/templates/banned.html
@@ -77,16 +77,60 @@
</p>
<p>{% trans %}Your IP address is{% endtrans %} <strong>{{ ban.ip }}</strong>.</p>
- {% if post %}
+ {% if config.ban_page_extra %}
+ <p>{{ config.ban_page_extra }}</p>
+ {% endif %}
+
+ {% if post and config.ban_show_post %}
<hr>
- <p>You were banned for the following post on {{ board.url }}:</p>
+ <p>{% trans %}You were banned for the following post on {% endtrans %}{{ board.url }}:</p>
{{ post }}
<br>
{% endif %}
- {% if config.ban_page_extra %}
- <p>{{ config.ban_page_extra }}</p>
+ {% if config.ban_appeals %}
+ <hr>
+ {% if pending_appeal %}
+ <p>
+ {% trans %}You submitted an appeal for this ban on{% endtrans %}
+ <strong>{{ pending_appeal|date(config.ban_date) }}</strong>. {% trans %}It is still pending{% endtrans %}.
+ </p>
+ {% elseif denied_appeals|length >= config.ban_appeals_max %}
+ {% if denied_appeals|length == 1 %}
+ <p>
+ {% trans %}You appealed this ban on{% endtrans %}
+ <strong>{{ denied_appeals[0]|date(config.ban_date) }}</strong>
+ {% trans %}and it was denied. You may not appeal this ban again.{% endtrans %}
+ </p>
+ {% else %}
+ <p>{% trans %}You have submitted the maximum number of ban appeals allowed. You may not appeal this ban again.{% endtrans %}</p>
+ {% endif %}
+ {% else %}
+ {% if denied_appeals|length %}
+ {% if denied_appeals|length == 1 %}
+ <p>
+ {% trans %}You appealed this ban on{% endtrans %}
+ <strong>{{ denied_appeals[0]|date(config.ban_date) }}</strong>
+ {% trans %}and it was denied.{% endtrans %}
+ </p>
+ <p>{% trans %}You may appeal this ban again. Please enter your reasoning below.{% endtrans %}</p>
+ {% else %}
+ <p>
+ {% trans %}You last appealed this ban on{% endtrans %}
+ <strong>{{ denied_appeals[denied_appeals|length - 1]|date(config.ban_date) }}</strong>
+ {% trans %}and it was denied.{% endtrans %}
+ </p>
+ <p>{% trans %}You may appeal this ban again. Please enter your reasoning below.{% endtrans %}</p>
+ {% endif %}
+ {% else %}
+ <p>{% trans %}You may appeal this ban. Please enter your reasoning below.{% endtrans %}</p>
+ {% endif %}
+ <form class="ban-appeal" action="" method="post">
+ <input type="hidden" name="ban_id" value="{{ ban.id }}">
+ <textarea name="appeal" rows="4" cols="40"></textarea>
+ <input type="submit" value="Submit">
+ </form>
+ {% endif %}
{% endif %}
</div>
-{% endfilter %}
-
+{% endfilter %} \ No newline at end of file
diff --git a/templates/mod/ban_appeals.html b/templates/mod/ban_appeals.html
new file mode 100644
index 00000000..f43b7db5
--- /dev/null
+++ b/templates/mod/ban_appeals.html
@@ -0,0 +1,106 @@
+{% for ban in ban_appeals %}
+
+<form action="" method="post" style="margin: 10px 0">
+ <table style="margin: 5px 0">
+ <tr>
+ <th>{% trans 'Status' %}</th>
+ <td>
+ {% if config.mod.view_banexpired and ban.expires != 0 and ban.expires < time() %}
+ {% trans 'Expired' %}
+ {% else %}
+ {% trans 'Active' %}
+ {% endif %}
+ </td>
+ </tr>
+ {% if mod|hasPermission(config.mod.show_ip, board.uri) %}
+ <tr>
+ <th>{% trans 'IP' %}</th>
+ <td>{{ ban.mask }}</td>
+ </tr>
+ {% endif %}
+ <tr>
+ <th>{% trans 'Reason' %}</th>
+ <td>
+ {% if ban.reason %}
+ {{ ban.reason }}
+ {% else %}
+ <em>{% trans 'no reason' %}</em>
+ {% endif %}
+ </td>
+ </tr>
+ <tr>
+ <th>{% trans 'Board' %}</th>
+ <td>
+ {% if ban.board %}
+ {{ config.board_abbreviation|sprintf(ban.board) }}
+ {% else %}
+ <em>{% trans 'all boards' %}</em>
+ {% endif %}
+ </td>
+ </tr>
+ <tr>
+ <th>{% trans 'Set' %}</th>
+ <td>{{ ban.created|date(config.post_date) }}</td>
+ </tr>
+ <tr>
+ <th>{% trans 'Expires' %}</th>
+ <td>
+ {% if ban.expires %}
+ {{ ban.expires|date(config.post_date) }}
+ {% else %}
+ <em>{% trans 'never' %}</em>
+ {% endif %}
+ </td>
+ </tr>
+ <tr>
+ <th>{% trans 'Seen' %}</th>
+ <td>
+ {% if ban.seen %}
+ {% trans 'Yes' %}
+ {% else %}
+ {% trans 'No' %}
+ {% endif %}
+ </td>
+ </tr>
+ <tr>
+ <th>{% trans 'Staff' %}</th>
+ <td>
+ {% if ban.username %}
+ {{ ban.username|e }}
+ {% else %}
+ <em>{% trans 'deleted?' %}</em>
+ {% endif %}
+ </td>
+ </tr>
+ </table>
+
+ <table style="margin: 10px 0">
+ <tr>
+ <th>{% trans 'Appeal time' %}</th>
+ <td>{{ ban.time|date(config.post_date) }}</td>
+ </tr>
+ <tr>
+ <th>{% trans 'Appeal reason' %}</th>
+ <td>{{ ban.message|e }}</td>
+ </tr>
+ {% if mod|hasPermission(config.mod.ban_appeals, board.uri) %}
+ <tr>
+ <th>{% trans 'Action' %}</th>
+ <td>
+ <input type="hidden" name="appeal_id" value="{{ ban.id }}">
+ <input type="submit" name="unban" value="Unban">
+ <input type="submit" name="deny" value="Deny appeal">
+ </td>
+ </tr>
+ {% endif %}
+ </table>
+
+ {% if ban.post %}
+ <div style="">
+ {{ ban.post.build(true) }}
+ </div>
+ {% endif %}
+</form>
+<hr>
+
+{% endfor %} \ No newline at end of file
diff --git a/templates/mod/dashboard.html b/templates/mod/dashboard.html
index e2f7507d..916f0c03 100644
--- a/templates/mod/dashboard.html
+++ b/templates/mod/dashboard.html
@@ -86,6 +86,9 @@
{% if mod|hasPermission(config.mod.view_banlist) %}
<li><a href="?/bans">{% trans 'Ban list' %}</a></li>
{% endif %}
+ {% if config.ban_appeals and mod|hasPermission(config.mod.view_ban_appeals) %}
+ <li><a href="?/ban-appeals">{% trans 'Ban appeals' %}</a></li>
+ {% endif %}
{% if mod|hasPermission(config.mod.manageusers) %}
<li><a href="?/users">{% trans 'Manage users' %}</a></li>
{% elseif mod|hasPermission(config.mod.change_password) %}