summaryrefslogtreecommitdiff
path: root/templates/mod/debug
diff options
context:
space:
mode:
authorczaks <marcin@6irc.net>2013-09-17 10:43:44 -0400
committerczaks <marcin@6irc.net>2013-09-17 10:43:44 -0400
commit6cb7eb939e549f978ca6dd7d2afe2dabc0f18025 (patch)
tree8b2342bbf5c15847717db733ecf4f2f46718dacb /templates/mod/debug
parent069f1def9bf8c8d769afdc5740e9ff13271065bd (diff)
parent803f0c8ce1487ea791824197de9d1ee140127838 (diff)
Merge branch 'master' of https://github.com/savetheinternet/Tinyboard into vichan-devel-4.5
Conflicts: inc/config.php inc/display.php inc/mod/pages.php install.php js/quick-reply.js post.php templates/index.html
Diffstat (limited to 'templates/mod/debug')
-rw-r--r--templates/mod/debug/antispam.html26
-rw-r--r--templates/mod/debug/recent_posts.html43
-rw-r--r--templates/mod/debug/sql.html8
3 files changed, 68 insertions, 9 deletions
diff --git a/templates/mod/debug/antispam.html b/templates/mod/debug/antispam.html
index 95aa61a6..9979a093 100644
--- a/templates/mod/debug/antispam.html
+++ b/templates/mod/debug/antispam.html
@@ -14,11 +14,14 @@
<tr>
<td>{{ config.board_abbreviation|sprintf(hash.board) }}</td>
<td>
- {% if hash.thread %}
+ {% if hash.thread > 0 %}
{{ hash.thread }}
+ {% elseif hash.thread < 0 %}
+ Index (page {{ - hash.thread }})
{% else %}
-
- {% endif %}</td>
+ {% endif %}
+ </td>
<td>
<small><code>{{ hash.hash }}</code></small>
</td>
@@ -28,7 +31,11 @@
<td>
{% if hash.expires %}
<span title="{{ hash.expires|date(config.post_date) }}">
- {{ hash.expires|until }}
+ {% if hash.expires < time() %}
+ {{ hash.expires|ago }} ago
+ {% else %}
+ {{ hash.expires|until }}
+ {% endif %}
</span>
{% else %}
-
@@ -55,11 +62,14 @@
<tr>
<td>{{ config.board_abbreviation|sprintf(hash.board) }}</td>
<td>
- {% if hash.thread %}
+ {% if hash.thread > 0 %}
{{ hash.thread }}
+ {% elseif hash.thread < 0 %}
+ Index (page {{ - hash.thread }})
{% else %}
-
- {% endif %}</td>
+ {% endif %}
+ </td>
<td>
<small><code>{{ hash.hash }}</code></small>
</td>
@@ -69,7 +79,11 @@
<td>
{% if hash.expires %}
<span title="{{ hash.expires|date(config.post_date) }}">
- {{ hash.expires|until }}
+ {% if hash.expires < time() %}
+ {{ hash.expires|ago }} ago
+ {% else %}
+ {{ hash.expires|until }}
+ {% endif %}
</span>
{% else %}
-
diff --git a/templates/mod/debug/recent_posts.html b/templates/mod/debug/recent_posts.html
index b84d24ab..e4eb4f3a 100644
--- a/templates/mod/debug/recent_posts.html
+++ b/templates/mod/debug/recent_posts.html
@@ -1,3 +1,40 @@
+<p style="text-align:center">
+ Flood prevention cache:
+</p>
+<table class="modlog" style="width:1%;">
+ <tr>
+ <th>#</th>
+ <th>Time</th>
+ <th>Board</th>
+ <th>Post hash</th>
+ <th>File hash</th>
+ </tr>
+ {% for post in flood_posts %}
+ <tr>
+ <td class="minimal">{{ post.id }}</td>
+ <td class="minimal"{% if post.in_flood_table %} style="color:red" title="Still in flood prevention cache."{% endif %}>
+ <small>{{ post.time | ago }} ago</small>
+ </td>
+ <td class="minimal">
+ <a href="?/{{ config.board_path|sprintf(post.board) }}{{ config.file_index }}">
+ {{ config.board_abbreviation|sprintf(post.board) }}
+ </a>
+ </td>
+ <td><code>{{ post.posthash }}</code></td>
+ <td>
+ {% if post.filehash %}
+ <code>{{ post.filehash }}</code>
+ {% else %}
+ <em>No file</em>
+ {% endif %}
+ </td>
+ </tr>
+ {% endfor %}
+</table>
+
+<p style="text-align:center">
+ Most recent {{ posts|count }} posts:
+</p>
<table class="modlog" style="word-wrap: break-word;">
<tr>
<th>Time</th>
@@ -12,11 +49,13 @@
</tr>
{% for post in posts %}
<tr>
- <td class="minimal">
+ <td class="minimal"{% if post.in_flood_table %} style="color:red" title="Still in flood prevention cache."{% endif %}>
<small>{{ post.time | ago }} ago</small>
</td>
<td class="minimal">
- <a href="?/{{ config.board_path|sprintf(post.board) }}{{ config.file_index }}">{{ config.board_abbreviation|sprintf(post.board) }}</a>
+ <a href="?/{{ config.board_path|sprintf(post.board) }}{{ config.file_index }}">
+ {{ config.board_abbreviation|sprintf(post.board) }}
+ </a>
</td>
<td class="minimal" >
{% if post.thread %}
diff --git a/templates/mod/debug/sql.html b/templates/mod/debug/sql.html
index 755995f9..249d05e3 100644
--- a/templates/mod/debug/sql.html
+++ b/templates/mod/debug/sql.html
@@ -16,7 +16,13 @@
{% for row in result %}
<tr>
{% for col in row %}
- <td>{{ col | e }}</td>
+ <td>
+ {% if col != null %}
+ {{ col | e }}
+ {% else %}
+ <em>NULL</em>
+ {% endif %}
+ </td>
{% endfor %}
</tr>
{% endfor %}