add telegrams

This commit is contained in:
h00j
2021-03-12 21:51:42 +01:00
parent 8decd4f73f
commit 4ef7feabf2
9 changed files with 210 additions and 18 deletions

View File

@@ -81,6 +81,84 @@
</fieldset>
{% endif %}
{% if mod|hasPermission(config.mod.view_telegrams) %}
<fieldset id="telegrams">
<legend>
{% set telegrams_on_record = 'telegram' ~ (telegrams|count != 1 ? 's' : '') ~ ' on record' %}
<legend>{{ telegrams|count }} {% trans telegrams_on_record %}</legend>
</legend>
{% if telegrams|count > 0 %}
<table class="modlog">
<tr>
<th>{% trans 'Staff' %}</th>
<th>{% trans 'Message' %}</th>
<th>{% trans 'Date' %}</th>
<th class="minimal">{% trans 'Seen' %}</th>
{% if mod|hasPermission(config.mod.remove_telegrams) %}
<th>{% trans 'Actions' %}</th>
{% endif %}
</tr>
{% for telegram in telegrams %}
<tr>
<td class="minimal">
{% if telegram.username %}
<a href="?/new_PM/{{ telegram.username|e }}">{{ telegram.username|e }}</a>
{% else %}
<em>{% trans 'deleted?' %}</em>
{% endif %}
</td>
<td>
{{ telegram.message }}
</td>
<td class="minimal">
{{ telegram.time|date(config.post_date) }}
</td>
<td>
{% if telegram.seen %}
{% trans 'Yes' %}
{% else %}
{% trans 'No' %}
{% endif %}
</td>
{% if mod|hasPermission(config.mod.remove_telegrams) %}
<td class="minimal">
<a href="?/IP/{{ ip|cloak_ip|url_encode(true) }}/remove_telegram/{{ telegram.id }}">
<small>[{% trans 'remove' %}]</small>
</a>
</td>
{% endif %}
</tr>
{% endfor %}
</table>
{% endif %}
{% if mod|hasPermission(config.mod.create_telegrams) %}
<form action="" method="post" style="margin:0">
<input type="hidden" name="token" value="{{ security_token }}">
<table>
<tr>
<th>{% trans 'Staff' %}</th>
<td>{{ mod.username|e }}</td>
</tr>
<tr>
<th>
<label for="telegram">{% trans 'Message' %}</label>
</th>
<td>
<textarea id="telegram" name="telegram" rows="5" cols="30"></textarea>
</td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="{% trans 'New telegram' %}"></td>
</tr>
</table>
</form>
{% endif %}
</fieldset>
{% endif %}
{% if bans|count > 0 and mod|hasPermission(config.mod.view_ban) %}
<fieldset id="bans">
{% set bans_on_record = 'ban' ~ (bans|count != 1 ? 's' : '') ~ ' on record' %}