Search update
This commit is contained in:
@@ -2,12 +2,15 @@
|
||||
<label style="display:inline" for="search">{% trans 'Phrase:' %}</label>
|
||||
<input id="search" name="query" type="text" size="60" value="{{ search_query|e }}">
|
||||
<select name="type">
|
||||
<option value="posts"{% if search_type == 'posts'%} selected{% endif %}>Posts</option>
|
||||
<option value="posts"{% if search_type == 'posts'%} selected{% endif %}>{% trans 'Posts' %}</option>
|
||||
{% if mod|hasPermission(config.mod.view_notes) and mod|hasPermission(config.mod.show_ip) %}
|
||||
<option value="IP_notes"{% if search_type == 'IP_notes'%} selected{% endif %}>IP address notes</option>
|
||||
<option value="IP_notes"{% if search_type == 'IP_notes'%} selected{% endif %}>{% trans 'IP address notes' %}</option>
|
||||
{% endif %}
|
||||
{% if mod|hasPermission(config.mod.view_banlist) %}
|
||||
<option value="bans"{% if search_type == 'bans'%} selected{% endif %}>Bans</option>
|
||||
<option value="bans"{% if search_type == 'bans'%} selected{% endif %}>{% trans 'Bans' %}</option>
|
||||
{% endif %}
|
||||
{% if mod|hasPermission(config.mod.modlog) %}
|
||||
<option value="log"{% if search_type == 'log'%} selected{% endif %}>{% trans 'Moderation log' %}</option>
|
||||
{% endif %}
|
||||
</select>
|
||||
<input type="submit" value="{% trans 'Search' %}">
|
||||
|
@@ -41,7 +41,6 @@
|
||||
</table>
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% if search_type == 'bans' %}
|
||||
<table class="modlog" style="width:100%">
|
||||
<tr>
|
||||
@@ -126,4 +125,53 @@
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if search_type == 'log' %}
|
||||
<table class="modlog">
|
||||
<tr>
|
||||
<th>{% trans 'Staff' %}</th>
|
||||
<th>{% trans 'IP address' %}</th>
|
||||
<th>{% trans 'Time' %}</th>
|
||||
<th>{% trans 'Board' %}</th>
|
||||
<th>{% trans 'Action' %}</th>
|
||||
</tr>
|
||||
{% for log in results %}
|
||||
<tr>
|
||||
<td class="minimal">
|
||||
{% if log.username %}
|
||||
<a href="?/log:{{ log.username|e }}">{{ log.username|e }}</a>
|
||||
{% elseif log.mod == -1 %}
|
||||
<em>system</em>
|
||||
{% else %}
|
||||
<em>{% trans 'deleted?' %}</em>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="minimal">
|
||||
<a href="?/IP/{{ log.ip }}">{{ log.ip }}</a>
|
||||
</td>
|
||||
<td class="minimal">
|
||||
<span title="{{ log.time|date(config.post_date) }}">{{ log.time|ago }}</span>
|
||||
</td>
|
||||
<td class="minimal">
|
||||
{% if log.board %}
|
||||
<a href="?/{{ config.board_path|sprintf(log.board) }}{{ config.file_index }}">{{ config.board_abbreviation|sprintf(log.board) }}</a>
|
||||
{% else %}
|
||||
-
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{{ log.text }}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endif %}
|
||||
|
||||
{% if result_count > results|count %}
|
||||
<p class="unimportant" style="text-align:center;word-wrap:break-word">
|
||||
{% for i in range(0, (result_count - 1) / config.mod.search_page) %}
|
||||
<a href="?/search/{{ search_type }}/{{ search_query_escaped }}/{{ i + 1 }}">[{{ i + 1 }}]</a>
|
||||
{% endfor %}
|
||||
</p>
|
||||
{% endif %}
|
Reference in New Issue
Block a user