summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/banned.html2
-rw-r--r--templates/index.html22
-rw-r--r--templates/main.js29
-rw-r--r--templates/mod/ban_list.html14
-rw-r--r--templates/mod/config-editor.html9
-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
-rw-r--r--templates/mod/search_results.html14
-rw-r--r--templates/mod/user.html20
-rw-r--r--templates/mod/users.html13
-rw-r--r--templates/mod/view_ip.html4
12 files changed, 143 insertions, 61 deletions
diff --git a/templates/banned.html b/templates/banned.html
index a4498cf5..065d61e2 100644
--- a/templates/banned.html
+++ b/templates/banned.html
@@ -30,7 +30,7 @@
{% endif %}
<p>
{% trans %}Your ban was filed on{% endtrans %}
- <strong>{{ ban.set|date(config.ban_date) }}</strong> {% trans %}and{% endtrans %} <span id="expires">
+ <strong>{{ ban.created|date(config.ban_date) }}</strong> {% trans %}and{% endtrans %} <span id="expires">
{% if ban.expires and time() >= ban.expires %}
{% trans %} has since expired. Refresh the page to continue.{% endtrans %}
{% elseif ban.expires %}
diff --git a/templates/index.html b/templates/index.html
index 39576e13..fb7bab07 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -19,8 +19,10 @@
</head>
<body>
{{ boardlist.top }}
+
{% if pm %}<div class="top_notice">You have <a href="?/PM/{{ pm.id }}">an unread PM</a>{% if pm.waiting > 0 %}, plus {{ pm.waiting }} more waiting{% endif %}.</div><hr />{% endif %}
{% if config.url_banner %}<img class="banner" src="{{ config.url_banner }}" {% if config.banner_width or config.banner_height %}style="{% if config.banner_width %}width:{{ config.banner_width }}px{% endif %};{% if config.banner_width %}height:{{ config.banner_height }}px{% endif %}" {% endif %}alt="" />{% endif %}
+
<header>
<h1>{{ board.url }} - {{ board.title|e }}</h1>
<div class="subtitle">
@@ -44,6 +46,15 @@
{{ config.ad.top }}
+ {% if config.page_nav_top %}
+ <div class="pages top">
+ {% for page in pages %}
+ [<a {% if page.selected %}class="selected"{% endif %}{% if not page.selected %}href="{{ page.link }}"{% endif %}>{{ page.num }}</a>]{% if loop.last %} {% endif %}
+ {% endfor %}
+ {{ btn.next }}
+ </div>
+ {% endif %}
+
{% if config.global_message %}<hr /><div class="blotter">{{ config.global_message }}</div>{% endif %}
<hr />
<form name="postcontrols" action="{{ config.post_url }}" method="post">
@@ -52,9 +63,16 @@
{{ body }}
{% include 'report_delete.html' %}
</form>
- <div class="pages">{{ btn.prev }} {% for page in pages %}
+
+ <div class="pages">
+ {{ btn.prev }} {% for page in pages %}
[<a {% if page.selected %}class="selected"{% endif %}{% if not page.selected %}href="{{ page.link }}"{% endif %}>{{ page.num }}</a>]{% if loop.last %} {% endif %}
- {% endfor %} {{ btn.next }}</div>
+ {% endfor %} {{ btn.next }}
+ {% if config.catalog_link %}
+ | <a href="{{ config.root }}{{ board.dir }}{{ config.catalog_link }}">Catalog</a>
+ {% endif %}
+ </div>
+
{{ boardlist.bottom }}
{{ config.ad.bottom }}
diff --git a/templates/main.js b/templates/main.js
index 7e8793cb..6136b11f 100644
--- a/templates/main.js
+++ b/templates/main.js
@@ -67,6 +67,9 @@ function changeStyle(styleName, link) {
if (link) {
link.className = 'selected';
}
+
+ if (typeof $ != 'undefined')
+ $(window).trigger('stylesheet', styleName);
}
@@ -181,22 +184,28 @@ function dopost(form) {
return form.elements['body'].value != "" || form.elements['file'].value != "" || (form.elements.file_url && form.elements['file_url'].value != "");
}
-function citeReply(id) {
- var body = document.getElementById('body');
+function citeReply(id, with_link) {
+ var textarea = document.getElementById('body');
if (document.selection) {
// IE
- body.focus();
+ textarea.focus();
var sel = document.selection.createRange();
sel.text = '>>' + id + '\n';
- } else if (body.selectionStart || body.selectionStart == '0') {
- // Mozilla
- var start = body.selectionStart;
- var end = body.selectionEnd;
- body.value = body.value.substring(0, start) + '>>' + id + '\n' + body.value.substring(end, body.value.length);
+ } else if (textarea.selectionStart || textarea.selectionStart == '0') {
+ var start = textarea.selectionStart;
+ var end = textarea.selectionEnd;
+ textarea.value = textarea.value.substring(0, start) + '>>' + id + '\n' + textarea.value.substring(end, textarea.value.length);
+
+ textarea.selectionStart += ('>>' + id).length + 1;
+ textarea.selectionEnd = textarea.selectionStart;
} else {
// ???
- body.value += '>>' + id + '\n';
+ textarea.value += '>>' + id + '\n';
+ }
+ if (typeof $ != 'undefined') {
+ $(window).trigger('cite', [id, with_link]);
+ $(textarea).change();
}
}
@@ -214,7 +223,7 @@ function rememberStuff() {
document.forms.post.elements['email'].value = localStorage.email;
if (window.location.hash.indexOf('q') == 1)
- citeReply(window.location.hash.substring(2));
+ citeReply(window.location.hash.substring(2), true);
if (sessionStorage.body) {
var saved = JSON.parse(sessionStorage.body);
diff --git a/templates/mod/ban_list.html b/templates/mod/ban_list.html
index f8826ade..b41cef28 100644
--- a/templates/mod/ban_list.html
+++ b/templates/mod/ban_list.html
@@ -17,10 +17,10 @@
<tr{% if ban.expires != 0 and ban.expires < time() %} style="text-decoration:line-through"{% endif %}>
<td style="white-space: nowrap">
<input type="checkbox" name="ban_{{ ban.id }}">
- {% if ban.real_ip %}
- <a href="?/IP/{{ ban.ip }}">{{ ban.ip }}</a>
+ {% if ban.single_addr %}
+ <a href="?/IP/{{ ban.mask }}">{{ ban.mask }}</a>
{% else %}
- {{ ban.ip|e }}
+ {{ ban.mask }}
{% endif %}
</td>
<td>
@@ -38,15 +38,15 @@
{% endif %}
</td>
<td style="white-space: nowrap">
- <span title="{{ ban.set|date(config.post_date) }}">
- {{ ban.set|ago }} ago
+ <span title="{{ ban.created|date(config.post_date) }}">
+ {{ ban.created|ago }} ago
</span>
</td>
<td style="white-space: nowrap">
{% if ban.expires == 0 %}
-
{% else %}
- {{ (ban.expires - ban.set + time()) | until }}
+ {{ (ban.expires - ban.created + time()) | until }}
{% endif %}
</td>
<td style="white-space: nowrap">
@@ -77,7 +77,7 @@
{% endif %}
{% endif %}
- {% elseif ban.mod == -1 %}
+ {% elseif ban.creator == -1 %}
<em>system</em>
{% else %}
<em>{% trans 'deleted?' %}</em>
diff --git a/templates/mod/config-editor.html b/templates/mod/config-editor.html
index a43f8cf7..4f4cba93 100644
--- a/templates/mod/config-editor.html
+++ b/templates/mod/config-editor.html
@@ -42,10 +42,11 @@
<input name="{{ name }}" type="text" value="{{ var.value|e }}">
{% elseif var.permissions %}
<select name="{{ name }}">
- <option value="{{ constant('JANITOR') }}"{% if var.value == constant('JANITOR')%} selected{% endif %}>JANITOR</option>
- <option value="{{ constant('MOD') }}"{% if var.value == constant('MOD')%} selected{% endif %}>MOD</option>
- <option value="{{ constant('ADMIN') }}"{% if var.value == constant('ADMIN')%} selected{% endif %}>ADMIN</option>
- <option value="{{ constant('DISABLED') }}"{% if var.value == constant('DISABLED')%} selected{% endif %}>DISABLED</option>
+ {% for group_value, group_name in config.mod.groups %}
+ <option value="{{ group_value }}"{% if var.value == group_value %} selected{% endif %}>
+ {{ group_name }}
+ </option>
+ {% endfor %}
</select>
{% elseif var.type == 'integer' %}
<input name="{{ name }}" type="number" value="{{ var.value|e }}">
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 %}
diff --git a/templates/mod/search_results.html b/templates/mod/search_results.html
index 0c87f75f..0d3c2a10 100644
--- a/templates/mod/search_results.html
+++ b/templates/mod/search_results.html
@@ -56,10 +56,10 @@
{% for ban in results %}
<tr{% if ban.expires != 0 and ban.expires < time() %} style="text-decoration:line-through"{% endif %}>
<td style="white-space: nowrap">
- {% if ban.real_ip %}
- <a href="?/IP/{{ ban.ip }}#bans">{{ ban.ip }}</a>
+ {% if ban.single_addr %}
+ <a href="?/IP/{{ ban.mask }}#bans">{{ ban.mask }}</a>
{% else %}
- {{ ban.ip|e }}
+ {{ ban.mask|e }}
{% endif %}
</td>
<td>
@@ -77,15 +77,15 @@
{% endif %}
</td>
<td style="white-space: nowrap">
- <span title="{{ ban.set|date(config.post_date) }}">
- {{ ban.set|ago }} ago
+ <span title="{{ ban.created|date(config.post_date) }}">
+ {{ ban.created|ago }} ago
</span>
</td>
<td style="white-space: nowrap">
{% if ban.expires == 0 %}
-
{% else %}
- {{ (ban.expires - ban.set + time()) | until }}
+ {{ (ban.expires - ban.created + time()) | until }}
{% endif %}
</td>
<td style="white-space: nowrap">
@@ -116,7 +116,7 @@
{% endif %}
{% endif %}
- {% elseif ban.mod == -1 %}
+ {% elseif ban.creator == -1 %}
<em>system</em>
{% else %}
<em>{% trans 'deleted?' %}</em>
diff --git a/templates/mod/user.html b/templates/mod/user.html
index 1bb297af..89240824 100644
--- a/templates/mod/user.html
+++ b/templates/mod/user.html
@@ -28,21 +28,15 @@
</tr>
{% if new %}
<tr>
- <th>{% trans 'Class' %}</th>
+ <th>{% trans 'Group' %}</th>
<td>
<ul style="padding:5px 8px;list-style:none">
- <li>
- <input type="radio" name="type" id="janitor" value="{{ constant('JANITOR') }}">
- <label for="janitor">{% trans 'Janitor' %}</label>
- </li>
- <li>
- <input type="radio" name="type" id="mod" value="{{ constant('MOD') }}" checked>
- <label for="mod">{% trans 'Mod' %}</label>
- </li>
- <li>
- <input type="radio" name="type" id="admin" value="{{ constant('Admin') }}">
- <label for="admin">{% trans 'Admin' %}</label>
- </li>
+ {% for group_value, group_name in config.mod.groups if group_name != 'Disabled' %}
+ <li>
+ <input type="radio" name="type" id="group_{{ group_name }}" value="{{ group_value }}">
+ <label for="group_{{ group_name }}">{% trans group_name %}</label>
+ </li>
+ {% endfor %}
</ul>
</td>
</tr>
diff --git a/templates/mod/users.html b/templates/mod/users.html
index fbd43b32..b4c666e1 100644
--- a/templates/mod/users.html
+++ b/templates/mod/users.html
@@ -15,9 +15,10 @@
<td><small>{{ user.id }}</small></td>
<td>{{ user.username|e }}</td>
<td>
- {% if user.type == constant('JANITOR') %}{% trans 'Janitor' %}
- {% elseif user.type == constant('MOD') %}{% trans 'Mod' %}
- {% elseif user.type == constant('ADMIN') %}{% trans 'Admin' %}
+ {% if config.mod.groups[user.type] %}
+ {{ config.mod.groups[user.type] }}
+ {% else %}
+ <em>{% trans 'Unknown' %}</em> ({{ user.type }})
{% endif %}
</td>
<td>
@@ -46,11 +47,11 @@
</td>
{% endif %}
<td>
- {% if mod|hasPermission(config.mod.promoteusers) and user.type < constant('ADMIN') %}
+ {% if mod|hasPermission(config.mod.promoteusers) and user.type < constant(config.mod.groups[0:-1]|last) %}
<a style="float:left;text-decoration:none" href="?/users/{{ user.id }}/promote" title="{% trans 'Promote' %}">&#9650;</a>
{% endif %}
- {% if mod|hasPermission(config.mod.promoteusers) and user.type > constant('JANITOR') %}
- <a style="float:left;text-decoration:none" href="?/users/{{ user.id }}/demote" title="{% trans 'Demote' %}">&#9660;</a>
+ {% if mod|hasPermission(config.mod.promoteusers) and user.type > constant(config.mod.groups|first) %}
+ <a style="float:left;text-decoration:none" href="?/users/{{ user.id }}/demote" title="{% trans 'Demote' %}"{% if mod.id == user.id %} onclick="return confirm('{% trans 'Are you sure you want to demote yourself?' %}')"{% endif %}>&#9660;</a>
{% endif %}
{% if mod|hasPermission(config.mod.modlog) %}
<a class="unimportant" style="margin-left:5px;float:right" href="?/log:{{ user.username|e }}">[{% trans 'log' %}]</a>
diff --git a/templates/mod/view_ip.html b/templates/mod/view_ip.html
index e2dad7af..f73c5d5a 100644
--- a/templates/mod/view_ip.html
+++ b/templates/mod/view_ip.html
@@ -100,7 +100,7 @@
</tr>
<tr>
<th>{% trans 'IP' %}</th>
- <td>{{ ban.ip }}</td>
+ <td>{{ ban.mask }}</td>
</tr>
<tr>
<th>{% trans 'Reason' %}</th>
@@ -124,7 +124,7 @@
</tr>
<tr>
<th>{% trans 'Set' %}</th>
- <td>{{ ban.set|date(config.post_date) }}</td>
+ <td>{{ ban.created|date(config.post_date) }}</td>
</tr>
<tr>
<th>{% trans 'Expires' %}</th>