From e62b83e79c8ed3b9ddf6e7e4b8bdeedc0d319ff4 Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Sat, 20 Jul 2013 07:50:33 -0400 Subject: Bring back search (searching posts not implemented yet) --- templates/mod/dashboard.html | 11 +--- templates/mod/search_form.html | 15 +++++ templates/mod/search_results.html | 129 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 147 insertions(+), 8 deletions(-) create mode 100644 templates/mod/search_form.html create mode 100644 templates/mod/search_results.html (limited to 'templates') diff --git a/templates/mod/dashboard.html b/templates/mod/dashboard.html index e54b3cd3..619663f5 100644 --- a/templates/mod/dashboard.html +++ b/templates/mod/dashboard.html @@ -101,22 +101,17 @@ -{# +{% if mod|hasPermission(config.mod.search) %}
{% trans 'Search' %}
-#} +{% endif %} {% if config.debug %}
diff --git a/templates/mod/search_form.html b/templates/mod/search_form.html new file mode 100644 index 00000000..c74121fd --- /dev/null +++ b/templates/mod/search_form.html @@ -0,0 +1,15 @@ +
+ + + + +
+

{% trans '(Search is case-insensitive and based on keywords. To match exact phrases, use "quotes". Use an asterisk (*) for wildcard.)' %}

\ No newline at end of file diff --git a/templates/mod/search_results.html b/templates/mod/search_results.html new file mode 100644 index 00000000..84de8969 --- /dev/null +++ b/templates/mod/search_results.html @@ -0,0 +1,129 @@ +
+ {% trans 'Search' %} + +
    +
  • + {% include 'mod/search_form.html' %} +
  • +
+
+ +

Showing {{ result_count }} result{% if result_count != 1 %}s{% endif %}.

+ +{% if search_type == 'IP_notes' %} + + + + + + + + {% for note in results %} + + + + + + + {% endfor %} +
{% trans 'IP address' %}{% trans 'Staff' %}{% trans 'Note' %}{% trans 'Date' %}
+ {{ note.ip }} + + {% if note.username %} + {{ note.username|e }} + {% else %} + {% trans 'deleted?' %} + {% endif %} + + {{ note.body }} + + {{ note.time|date(config.post_date) }} +
+{% endif %} + + +{% if search_type == 'bans' %} + + + + + + + + + + + + {% for ban in results %} + + + + + + + + + + + {% endfor %} +
{% trans 'IP address/mask' %}{% trans 'Reason' %}{% trans 'Board' %}{% trans 'Set' %}{% trans 'Duration' %}{% trans 'Expires' %}{% trans 'Seen' %}{% trans 'Staff' %}
+ {% if ban.real_ip %} + {{ ban.ip }} + {% else %} + {{ ban.ip|e }} + {% endif %} + + {% if ban.reason %} + {{ ban.reason }} + {% else %} + - + {% endif %} + + {% if ban.board %} + {{ config.board_abbreviation|sprintf(ban.board) }} + {% else %} + {% trans 'all boards' %} + {% endif %} + + + {{ ban.set|ago }} ago + + + {% if ban.expires == 0 %} + - + {% else %} + {{ (ban.expires - ban.set + time()) | until }} + {% endif %} + + {% if ban.expires == 0 %} + {% trans 'never' %} + {% else %} + {{ ban.expires|date(config.post_date) }} + {% if ban.expires > time() %} + (in {{ ban.expires|until }}) + {% endif %} + {% endif %} + + {% if ban.seen %} + {% trans 'Yes' %} + {% else %} + {% trans 'No' %} + {% endif %} + + {% if ban.username %} + {% if mod|hasPermission(config.mod.view_banstaff) %} + {{ ban.username|e }} + {% else %} + {% if mod|hasPermission(config.mod.view_banquestionmark) %} + ? + {% else %} + + {% endif %} + {% endif %} + {% elseif ban.mod == -1 %} + system + {% else %} + {% trans 'deleted?' %} + {% endif %} +
+{% endif %} \ No newline at end of file -- cgit v1.3