View IP adress page, ban form.

This commit is contained in:
Michael Save 2012-04-13 09:29:08 +10:00
parent f9ca74d763
commit 78f3ea7833
7 changed files with 289 additions and 3 deletions

View file

@ -0,0 +1,59 @@
<form action="?/ban" method="post">
{% if redirect %}
<input type="hidden" name="redirect" value="{{ redirect|e }}">
{% endif %}
<table>
<tr>
<th>
<label for="ip">IP <span class="unimportant">(or subnet)</span></label>
</th>
<td>
<input type="text" name="ip" id="ip" size="30" maxlength="40" value="{{ ip }}">
</td>
</tr>
<tr>
<th>
<label for="reason">Reason</label>
</th>
<td>
<textarea name="reason" id="reason" rows="5" cols="30">{{ reason|e }}</textarea>
</td>
</tr>
<tr>
<th>
<label for="length">Length</label>
</th>
<td>
<input type="text" name="length" id="length" size="20" maxlength="40">
<span class="unimportant">(eg. "2d1h30m" or "2 days")</span></td>
</tr>
<tr>
<th>Board</th>
<td>
<ul style="list-style:none;padding:2px 5px">
<li>
<input type="radio" name="board" value="*" id="ban-allboards" checked>
<label style="display:inline" for="ban-allboards">
<em>all boards</em>
</label>
</li>
{% for board in boards %}
<li>
<input type="radio" name="board" value="{{ board.uri }}" id="ban-board-{{ board.uri }}">
<label style="display:inline" for="ban-board-{{ board.uri }}">
{{ config.board_abbreviation|sprintf(board.uri) }} - {{ board.title }}
</label>
</li>
{% endfor %}
</ul>
</td>
</tr>
<tr>
<td></td>
<td><input name="new_ban" type="submit" value="New Ban"></td>
</tr>
</table>
</form>

View file

@ -0,0 +1,81 @@
<fieldset>
<legend>Boards</legend>
<ul>
{% for board in boards %}
<li>
<a href="?/{{ config.board_path|sprintf(board.uri) }}{{ config.file_index }}">{{ config.board_abbreviation|sprintf(board.uri) }}</a>
-
{{ board.title }}
{% if board.subtitle %}
<small>&mdash; {{ board.subtitle }}</small>
{% endif %}
{% if mod|hasPermission(config.mod.manageboards) %}
<a href="?/manage/{{ board.uri }}"><small>[manage]</small></a>
{% endif %}
</li>
{% endfor %}
{% if mod|hasPermission(config.mod.newboard) %}
<li style="margin-top:15px"><a href="?/new_board"><strong>Create new board</strong></a></li>
{% endif %}
</ul>
</fieldset>
{% if mod|hasPermission(config.mod.noticeboard) %}
<fieldset>
<legend>Noticeboard</legend>
{# TODO #}
</fieldset>
{% endif %}
<fieldset>
<legend>Administration</legend>
<ul>
{% if mod|hasPermission(config.mod.reports) %}
<li><a href="?/reports">Report queue</a></li>
{% endif %}
{% if mod|hasPermission(config.mod.view_banlist) %}
<li><a href="?/bans">Ban list</a></li>
{% endif %}
{% if mod|hasPermission(config.mod.manageusers) %}
<li><a href="?/users">Manage users</a></li>
{% elseif mod|hasPermission(config.mod.change_password) %}
<li><a href="?/users/{{ mod.id }}">Change password</a></li>
{% endif %}
{% if mod|hasPermission(config.mod.modlog) %}
<li><a href="?/log">Moderation log</a></li>
{% endif %}
{% if mod|hasPermission(config.mod.rebuild) %}
<li><a href="?/rebuild">Rebuild</a></li>
{% if config.cache.enabled %}
<li><a href="?/flushcache">Clear cache</a></li>
{% endif %}
{% endif %}
{% if mod|hasPermission(config.mod.show_config) %}
<li><a href="?/config">Configuration</a></li>
{% endif %}
</ul>
</fieldset>
{% if mod|hasPermission(config.mod.themes) %}
<fieldset>
<legend>Themes</legend>
{# TODO #}
</fieldset>
{% endif %}
<fieldset>
<legend>Search</legend>
{# TODO #}
</fieldset>

26
templates/mod/login.html Normal file
View file

@ -0,0 +1,26 @@
{% if error %}<h2 style="text-align:center">{{ error }}</h2>{% endif %}
<form action="" method="post">
<table style="margin-top:25px;">
<tr>
<th>
{% trans %}Username{% endtrans %}
</th>
<td>
<input type="text" name="username" size="20" maxlength="30" value="{{ username|e }}">
</td>
</tr>
<tr>
<th>
{% trans %}Password{% endtrans %}
</th>
<td>
<input type="password" name="password" size="20" maxlength="30" value="">
</td>
</tr>
<tr>
<td></td>
<td>
<input type="submit" name="login" value="{% trans %}Continue{% endtrans %}" />
</td>
</table>
</form>

View file

@ -0,0 +1,18 @@
{% for board_posts in posts %}
<fieldset>
<legend>
<a href="?/{{ config.board_path|sprintf(board.uri) }}{{ config.file_index }}">{{ config.board_abbreviation|sprintf(board_posts.board.uri) }}</a>
-
{{ board_posts.board.title }}
</legend>
{{ board_posts.posts|join('<hr>') }}
</fieldset>
{% endfor %}
{% set redirect = '?/IP/' ~ ip %}
<fieldset>
<legend>New ban</legend>
{% include 'mod/ban_form.html' %}
</fieldset>