mirror of
https://github.com/Circlepuller/Tinyboard.git
synced 2025-01-16 21:08:30 +01:00
Twig 2.9 updates
This commit is contained in:
parent
191578f47f
commit
4037beebab
@ -9,7 +9,7 @@
|
||||
},
|
||||
"require": {
|
||||
"gettext/gettext": "^4.4",
|
||||
"twig/twig": "^2.4",
|
||||
"twig/twig": "^2.9",
|
||||
"twig/extensions": "^1.5",
|
||||
"geoip/geoip": "^1.16",
|
||||
"mrclay/minify": "^3.0",
|
||||
|
2
composer.lock
generated
2
composer.lock
generated
@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "024e398738753e998a1e2b62235843a3",
|
||||
"content-hash": "cd1eb38aad1ab9b78eddde4761daa8b6",
|
||||
"packages": [
|
||||
{
|
||||
"name": "awsumchan/ip",
|
||||
|
@ -875,7 +875,7 @@
|
||||
// Timezone to use for displaying dates/tiems.
|
||||
$config['timezone'] = 'America/Los_Angeles';
|
||||
// The format string passed to strftime() for displaying dates.
|
||||
// http://www.php.net/manual/en/function.strftime.php
|
||||
// https://www.php.net/manual/en/function.strftime.php
|
||||
$config['post_date'] = '%m/%d/%y (%a) %H:%M:%S';
|
||||
// Same as above, but used for "you are banned' pages.
|
||||
$config['ban_date'] = '%A %e %B, %Y';
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright (c) 2010-2018 Tinyboard Development Group
|
||||
* Copyright (c) 2010-2020 Tinyboard Development Group
|
||||
*/
|
||||
|
||||
defined('TINYBOARD') or exit;
|
||||
@ -116,13 +116,11 @@ class Twig_Extensions_Extension_Tinyboard extends Twig\Extension\AbstractExtensi
|
||||
new Twig\TwigFilter('truncate_body', 'truncate'),
|
||||
new Twig\TwigFilter('truncate_filename', 'twig_filename_truncate_filter'),
|
||||
new Twig\TwigFilter('extension', 'twig_extension_filter'),
|
||||
new Twig\TwigFilter('sprintf', 'sprintf'),
|
||||
new Twig\TwigFilter('capcode', 'capcode'),
|
||||
new Twig\TwigFilter('remove_modifiers', 'remove_modifiers'),
|
||||
new Twig\TwigFilter('hasPermission', 'twig_hasPermission_filter'),
|
||||
new Twig\TwigFilter('date', 'twig_date_filter'),
|
||||
new Twig\TwigFilter('strftime', 'twig_strftime_filter'),
|
||||
new Twig\TwigFilter('poster_id', 'poster_id'),
|
||||
new Twig\TwigFilter('remove_whitespace', 'twig_remove_whitespace_filter'),
|
||||
new Twig\TwigFilter('ago', 'ago'),
|
||||
new Twig\TwigFilter('until', 'until'),
|
||||
new Twig\TwigFilter('push', 'twig_push_filter'),
|
||||
@ -140,8 +138,6 @@ class Twig_Extensions_Extension_Tinyboard extends Twig\Extension\AbstractExtensi
|
||||
{
|
||||
return [
|
||||
new Twig\TwigFunction('time', 'time'),
|
||||
new Twig\TwigFunction('floor', 'floor'),
|
||||
new Twig\TwigFunction('timezone', 'twig_timezone_function'),
|
||||
new Twig\TwigFunction('hiddenInputs', 'hiddenInputs'),
|
||||
new Twig\TwigFunction('hiddenInputsHash', 'hiddenInputsHash'),
|
||||
new Twig\TwigFunction('ratio', 'twig_ratio_function'),
|
||||
@ -162,20 +158,12 @@ class Twig_Extensions_Extension_Tinyboard extends Twig\Extension\AbstractExtensi
|
||||
}
|
||||
}
|
||||
|
||||
function twig_timezone_function() {
|
||||
return 'Z';
|
||||
}
|
||||
|
||||
function twig_push_filter($array, $value) {
|
||||
array_push($array, $value);
|
||||
return $array;
|
||||
}
|
||||
|
||||
function twig_remove_whitespace_filter($data) {
|
||||
return preg_replace('/[\t\r\n]/', '', $data);
|
||||
}
|
||||
|
||||
function twig_date_filter($date, $format) {
|
||||
function twig_strftime_filter($date, $format) {
|
||||
return gmstrftime($format, $date);
|
||||
}
|
||||
|
||||
@ -190,10 +178,6 @@ function twig_extension_filter($value, $case_insensitive = true) {
|
||||
return $ext;
|
||||
}
|
||||
|
||||
function twig_sprintf_filter( $value, $var) {
|
||||
return sprintf($value, $var);
|
||||
}
|
||||
|
||||
function twig_truncate_filter($value, $length = 30, $preserve = false, $separator = '…') {
|
||||
if (mb_strlen($value) > $length) {
|
||||
if ($preserve) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% filter remove_whitespace %}
|
||||
{% apply spaceless %}
|
||||
{# Automatically removes unnecessary whitespace #}
|
||||
<div class="ban">
|
||||
{% if ban.expires and time() >= ban.expires %}
|
||||
@ -13,7 +13,7 @@
|
||||
{% trans %}You have been banned from{% endtrans %}
|
||||
{% endif %}
|
||||
{% if ban.board %}
|
||||
<strong>{{ config.board_abbreviation|sprintf(ban.board) }}</strong>
|
||||
<strong>{{ config.board_abbreviation|format(ban.board) }}</strong>
|
||||
{% else %}
|
||||
{% trans %}all boards{% endtrans %}
|
||||
{% endif %}
|
||||
@ -30,7 +30,7 @@
|
||||
{% endif %}
|
||||
<p>
|
||||
{% trans %}Your ban was filed on{% endtrans %}
|
||||
<strong>{{ ban.created|date(config.ban_date) }}</strong>
|
||||
<strong>{{ ban.created|strftime(config.ban_date) }}</strong>
|
||||
{% if config.show_modname %}
|
||||
{% if ban.username %}
|
||||
{% trans %}by{% endtrans %} <strong> {{ ban.username }} </strong>
|
||||
@ -44,7 +44,7 @@
|
||||
{% elseif ban.expires %}
|
||||
{% trans %}expires{% endtrans %} <span id="countdown">{{ ban.expires|until }}</span> {% trans %}from now, which is on{% endtrans %}
|
||||
<strong>
|
||||
{{ ban.expires|date(config.ban_date) }}
|
||||
{{ ban.expires|strftime(config.ban_date) }}
|
||||
</strong>
|
||||
<script>
|
||||
var secondsLeft = {{ ban.expires - time() }};
|
||||
@ -101,13 +101,13 @@
|
||||
{% if pending_appeal %}
|
||||
<p>
|
||||
{% trans %}You submitted an appeal for this ban on{% endtrans %}
|
||||
<strong>{{ pending_appeal|date(config.ban_date) }}</strong>. {% trans %}It is still pending{% endtrans %}.
|
||||
<strong>{{ pending_appeal|strftime(config.ban_date) }}</strong>. {% trans %}It is still pending{% endtrans %}.
|
||||
</p>
|
||||
{% elseif denied_appeals|length >= config.ban_appeals_max %}
|
||||
{% if denied_appeals|length == 1 %}
|
||||
<p>
|
||||
{% trans %}You appealed this ban on{% endtrans %}
|
||||
<strong>{{ denied_appeals[0]|date(config.ban_date) }}</strong>
|
||||
<strong>{{ denied_appeals[0]|strftime(config.ban_date) }}</strong>
|
||||
{% trans %}and it was denied. You may not appeal this ban again.{% endtrans %}
|
||||
</p>
|
||||
{% else %}
|
||||
@ -118,14 +118,14 @@
|
||||
{% if denied_appeals|length == 1 %}
|
||||
<p>
|
||||
{% trans %}You appealed this ban on{% endtrans %}
|
||||
<strong>{{ denied_appeals[0]|date(config.ban_date) }}</strong>
|
||||
<strong>{{ denied_appeals[0]|strftime(config.ban_date) }}</strong>
|
||||
{% trans %}and it was denied.{% endtrans %}
|
||||
</p>
|
||||
<p>{% trans %}You may appeal this ban again. Please enter your reasoning below.{% endtrans %}</p>
|
||||
{% else %}
|
||||
<p>
|
||||
{% trans %}You last appealed this ban on{% endtrans %}
|
||||
<strong>{{ denied_appeals[denied_appeals|length - 1]|date(config.ban_date) }}</strong>
|
||||
<strong>{{ denied_appeals[denied_appeals|length - 1]|strftime(config.ban_date) }}</strong>
|
||||
{% trans %}and it was denied.{% endtrans %}
|
||||
</p>
|
||||
<p>{% trans %}You may appeal this ban again. Please enter your reasoning below.{% endtrans %}</p>
|
||||
@ -141,4 +141,4 @@
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
|
@ -33,7 +33,7 @@
|
||||
<th>{% trans 'Board' %}</th>
|
||||
<td>
|
||||
{% if ban.board %}
|
||||
{{ config.board_abbreviation|sprintf(ban.board) }}
|
||||
{{ config.board_abbreviation|format(ban.board) }}
|
||||
{% else %}
|
||||
<em>{% trans 'all boards' %}</em>
|
||||
{% endif %}
|
||||
@ -41,13 +41,13 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{% trans 'Set' %}</th>
|
||||
<td>{{ ban.created|date(config.post_date) }}</td>
|
||||
<td>{{ ban.created|strftime(config.post_date) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{% trans 'Expires' %}</th>
|
||||
<td>
|
||||
{% if ban.expires %}
|
||||
{{ ban.expires|date(config.post_date) }}
|
||||
{{ ban.expires|strftime(config.post_date) }}
|
||||
{% else %}
|
||||
<em>{% trans 'never' %}</em>
|
||||
{% endif %}
|
||||
@ -78,7 +78,7 @@
|
||||
<table style="margin: 10px 0">
|
||||
<tr>
|
||||
<th>{% trans 'Appeal time' %}</th>
|
||||
<td>{{ ban.time|date(config.post_date) }}</td>
|
||||
<td>{{ ban.time|strftime(config.post_date) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{% trans 'Appeal reason' %}</th>
|
||||
|
@ -76,7 +76,7 @@
|
||||
<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|e }}
|
||||
{{ config.board_abbreviation|format(board.uri) }} - {{ board.title|e }}
|
||||
</label>
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
@ -36,13 +36,13 @@
|
||||
</td>
|
||||
<td style="white-space: nowrap">
|
||||
{% if ban.board %}
|
||||
{{ config.board_abbreviation|sprintf(ban.board) }}
|
||||
{{ config.board_abbreviation|format(ban.board) }}
|
||||
{% else %}
|
||||
<em>{% trans 'all boards' %}</em>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td style="white-space: nowrap" data-sort-value="{{ ban.created }}">
|
||||
<span title="{{ ban.created|date(config.post_date) }}">
|
||||
<span title="{{ ban.created|strftime(config.post_date) }}">
|
||||
{{ ban.created|ago }} ago
|
||||
</span>
|
||||
</td>
|
||||
@ -56,7 +56,7 @@
|
||||
{{ (ban.expires - ban.created + time())|until }}
|
||||
</td>
|
||||
<td style="white-space: nowrap" data-sort-value="{{ ban.expires }}">
|
||||
{{ ban.expires|date(config.post_date) }}
|
||||
{{ ban.expires|strftime(config.post_date) }}
|
||||
{% if ban.expires > time() %}
|
||||
<small>(in {{ ban.expires|until }})</small>
|
||||
{% endif %}
|
||||
|
@ -11,7 +11,7 @@
|
||||
<th>{% trans 'URI' %}</th>
|
||||
<td>
|
||||
{% if not new %}
|
||||
{{ config.board_abbreviation|sprintf(board.uri) }}
|
||||
{{ config.board_abbreviation|format(board.uri) }}
|
||||
{% else %}
|
||||
/<input size="10" maxlength="255" type="text" name="uri" autocomplete="off">/
|
||||
{% endif %}
|
||||
|
@ -9,7 +9,7 @@
|
||||
{% endif %}
|
||||
{% for _board in boards if _board.uri != board %}
|
||||
<li>
|
||||
<a href="?/config/{{ _board.uri }}">Edit config for {{ config.board_abbreviation|sprintf(_board.uri) }}</a>
|
||||
<a href="?/config/{{ _board.uri }}">Edit config for {{ config.board_abbreviation|format(_board.uri) }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
@ -8,7 +8,7 @@
|
||||
{% endif %}
|
||||
{% for _board in boards if _board.uri != board %}
|
||||
<li>
|
||||
<a href="?/config/{{ _board.uri }}">Edit config for {{ config.board_abbreviation|sprintf(_board.uri) }}</a>
|
||||
<a href="?/config/{{ _board.uri }}">Edit config for {{ config.board_abbreviation|format(_board.uri) }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<ul>
|
||||
{% for board in boards %}
|
||||
<li>
|
||||
<a href="?/{{ config.board_path|sprintf(board.uri) }}{{ config.file_index }}">{{ config.board_abbreviation|sprintf(board.uri) }}</a>
|
||||
<a href="?/{{ config.board_path|format(board.uri) }}{{ config.file_index }}">{{ config.board_abbreviation|format(board.uri) }}</a>
|
||||
-
|
||||
{{ board.title|e }}
|
||||
{% if board.subtitle %}
|
||||
@ -56,7 +56,7 @@
|
||||
<em>deleted?</em>
|
||||
{% endif %}
|
||||
at
|
||||
{{ post.time|date(config.post_date) }}
|
||||
{{ post.time|strftime(config.post_date) }}
|
||||
</small>
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
@ -12,7 +12,7 @@
|
||||
</tr>
|
||||
{% for hash in recent %}
|
||||
<tr>
|
||||
<td>{{ config.board_abbreviation|sprintf(hash.board) }}</td>
|
||||
<td>{{ config.board_abbreviation|format(hash.board) }}</td>
|
||||
<td>
|
||||
{% if hash.thread > 0 %}
|
||||
{{ hash.thread }}
|
||||
@ -26,11 +26,11 @@
|
||||
<small><code>{{ hash.hash }}</code></small>
|
||||
</td>
|
||||
<td>
|
||||
<span title="{{ hash.created|date(config.post_date) }}">{{ hash.created|ago }} ago</span>
|
||||
<span title="{{ hash.created|strftime(config.post_date) }}">{{ hash.created|ago }} ago</span>
|
||||
</td>
|
||||
<td>
|
||||
{% if hash.expires %}
|
||||
<span title="{{ hash.expires|date(config.post_date) }}">
|
||||
<span title="{{ hash.expires|strftime(config.post_date) }}">
|
||||
{% if hash.expires < time() %}
|
||||
{{ hash.expires|ago }} ago
|
||||
{% else %}
|
||||
@ -60,7 +60,7 @@
|
||||
</tr>
|
||||
{% for hash in top %}
|
||||
<tr>
|
||||
<td>{{ config.board_abbreviation|sprintf(hash.board) }}</td>
|
||||
<td>{{ config.board_abbreviation|format(hash.board) }}</td>
|
||||
<td>
|
||||
{% if hash.thread > 0 %}
|
||||
{{ hash.thread }}
|
||||
@ -74,11 +74,11 @@
|
||||
<small><code>{{ hash.hash }}</code></small>
|
||||
</td>
|
||||
<td>
|
||||
<span title="{{ hash.created|date(config.post_date) }}">{{ hash.created|ago }} ago</span>
|
||||
<span title="{{ hash.created|strftime(config.post_date) }}">{{ hash.created|ago }} ago</span>
|
||||
</td>
|
||||
<td>
|
||||
{% if hash.expires %}
|
||||
<span title="{{ hash.expires|date(config.post_date) }}">
|
||||
<span title="{{ hash.expires|strftime(config.post_date) }}">
|
||||
{% if hash.expires < time() %}
|
||||
{{ hash.expires|ago }} ago
|
||||
{% else %}
|
||||
|
@ -16,8 +16,8 @@
|
||||
<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 href="?/{{ config.board_path|format(post.board) }}{{ config.file_index }}">
|
||||
{{ config.board_abbreviation|format(post.board) }}
|
||||
</a>
|
||||
</td>
|
||||
<td><code>{{ post.posthash }}</code></td>
|
||||
@ -53,8 +53,8 @@
|
||||
<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 href="?/{{ config.board_path|format(post.board) }}{{ config.file_index }}">
|
||||
{{ config.board_abbreviation|format(post.board) }}
|
||||
</a>
|
||||
</td>
|
||||
<td class="minimal" >
|
||||
|
@ -23,7 +23,7 @@
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="minimal">
|
||||
{{ message.time|date(config.post_date) }}
|
||||
{{ message.time|strftime(config.post_date) }}
|
||||
</td>
|
||||
<td>
|
||||
<a href="?/PM/{{ message.id }}">
|
||||
|
@ -36,11 +36,11 @@
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="minimal" data-sort-value="{{ log.time }}">
|
||||
<span title="{{ log.time|date(config.post_date) }}">{{ log.time|ago }}</span>
|
||||
<span title="{{ log.time|strftime(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>
|
||||
<a href="?/{{ config.board_path|format(log.board) }}{{ config.file_index }}">{{ config.board_abbreviation|format(log.board) }}</a>
|
||||
{% else %}
|
||||
-
|
||||
{% endif %}
|
||||
|
@ -6,7 +6,7 @@
|
||||
{% trans 'Thread ID' %}
|
||||
</th>
|
||||
<td>
|
||||
>>>{{ config.board_abbreviation|sprintf(board) }}{{ post }}
|
||||
>>>{{ config.board_abbreviation|format(board) }}{{ post }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -26,7 +26,7 @@
|
||||
<li>
|
||||
<input type="radio" name="board" value="{{ targetboard.uri }}" id="ban-board-{{ targetboard.uri }}" {% if boards|length == 2 %}checked{% endif %}>
|
||||
<label style="display:inline" for="ban-board-{{ targetboard.uri }}">
|
||||
{{ config.board_abbreviation|sprintf(targetboard.uri) }} - {{ targetboard.title|e }}
|
||||
{{ config.board_abbreviation|format(targetboard.uri) }} - {{ targetboard.title|e }}
|
||||
</label>
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
@ -6,7 +6,7 @@
|
||||
{% trans 'Post ID' %}
|
||||
</th>
|
||||
<td>
|
||||
>>>{{ config.board_abbreviation|sprintf(board) }}{{ post }}
|
||||
>>>{{ config.board_abbreviation|format(board) }}{{ post }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -17,7 +17,7 @@
|
||||
<li>
|
||||
<input type="radio" name="board" value="{{ targetboard.uri }}" id="ban-board-{{ targetboard.uri }}" {% if boards|length == 2 %}checked{% endif %}>
|
||||
<label style="display:inline" for="ban-board-{{ targetboard.uri }}">
|
||||
{{ config.board_abbreviation|sprintf(targetboard.uri) }} - {{ targetboard.title|e }}
|
||||
{{ config.board_abbreviation|format(targetboard.uri) }} - {{ targetboard.title|e }}
|
||||
</label>
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
@ -53,7 +53,7 @@
|
||||
<em>{% trans 'no subject' %}</em>
|
||||
{% endif %}
|
||||
<small class="unimportant">
|
||||
— {% trans 'by' %} {{ post.name }} {% trans 'at' %} {{ post.time|date(config.post_date) }}
|
||||
— {% trans 'by' %} {{ post.name }} {% trans 'at' %} {{ post.time|strftime(config.post_date) }}
|
||||
</small>
|
||||
</h2>
|
||||
<p>
|
||||
|
@ -48,7 +48,7 @@
|
||||
<em>{% trans 'deleted?' %}</em>
|
||||
{% endif %}
|
||||
{% trans 'at' %}
|
||||
{{ post.time|date(config.post_date) }}
|
||||
{{ post.time|strftime(config.post_date) }}
|
||||
</small>
|
||||
</h2>
|
||||
<p>
|
||||
|
@ -20,7 +20,7 @@
|
||||
{% endif %}
|
||||
<tr>
|
||||
<th>{% trans 'Date' %}</th>
|
||||
<td>{{ time|date(config.post_date) }} <small>({{ time|ago }} ago)</small></td>
|
||||
<td>{{ time|strftime(config.post_date) }} <small>({{ time|ago }} ago)</small></td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -60,7 +60,7 @@
|
||||
<li>
|
||||
<input type="checkbox" name="board_{{ board.uri }}" id="board-{{ board.uri }}" checked>
|
||||
<label for="board-{{ board.uri }}">
|
||||
{{ config.board_abbreviation|sprintf(board.uri) }} - {{ board.title|e }}
|
||||
{{ config.board_abbreviation|format(board.uri) }} - {{ board.title|e }}
|
||||
</label>
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
@ -1,10 +1,10 @@
|
||||
<div class="report">
|
||||
<hr>
|
||||
{% trans 'Board' %}: <a href="?/{{ report.board }}/{{ config.file_index }}">{{ config.board_abbreviation|sprintf(report.board) }}</a>
|
||||
{% trans 'Board' %}: <a href="?/{{ report.board }}/{{ config.file_index }}">{{ config.board_abbreviation|format(report.board) }}</a>
|
||||
<br>
|
||||
{% trans 'Reason' %}: {{ report.reason }}
|
||||
<br>
|
||||
{% trans 'Report date' %}: {{ report.time|date(config.post_date) }}
|
||||
{% trans 'Report date' %}: {{ report.time|strftime(config.post_date) }}
|
||||
<br>
|
||||
{% if mod|hasPermission(config.mod.show_ip, report.board) %}
|
||||
{% trans 'Reported by' %}: <a href="?/IP/{{ report.ip }}">{{ report.ip }}</a>
|
||||
|
@ -34,7 +34,7 @@
|
||||
{{ note.body }}
|
||||
</td>
|
||||
<td class="minimal">
|
||||
{{ note.time|date(config.post_date) }}
|
||||
{{ note.time|strftime(config.post_date) }}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
@ -71,13 +71,13 @@
|
||||
</td>
|
||||
<td style="white-space: nowrap">
|
||||
{% if ban.board %}
|
||||
{{ config.board_abbreviation|sprintf(ban.board) }}
|
||||
{{ config.board_abbreviation|format(ban.board) }}
|
||||
{% else %}
|
||||
<em>{% trans 'all boards' %}</em>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td style="white-space: nowrap">
|
||||
<span title="{{ ban.created|date(config.post_date) }}">
|
||||
<span title="{{ ban.created|strftime(config.post_date) }}">
|
||||
{{ ban.created|ago }} ago
|
||||
</span>
|
||||
</td>
|
||||
@ -92,7 +92,7 @@
|
||||
{% if ban.expires == 0 %}
|
||||
<em>{% trans 'never' %}</em>
|
||||
{% else %}
|
||||
{{ ban.expires|date(config.post_date) }}
|
||||
{{ ban.expires|strftime(config.post_date) }}
|
||||
{% if ban.expires > time() %}
|
||||
<small>(in {{ ban.expires|until }})</small>
|
||||
{% endif %}
|
||||
@ -151,11 +151,11 @@
|
||||
<a href="?/IP/{{ log.ip }}">{{ log.ip }}</a>
|
||||
</td>
|
||||
<td class="minimal">
|
||||
<span title="{{ log.time|date(config.post_date) }}">{{ log.time|ago }}</span>
|
||||
<span title="{{ log.time|strftime(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>
|
||||
<a href="?/{{ config.board_path|format(log.board) }}{{ config.file_index }}">{{ config.board_abbreviation|format(log.board) }}</a>
|
||||
{% else %}
|
||||
-
|
||||
{% endif %}
|
||||
@ -187,7 +187,7 @@
|
||||
<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|format(post.board) }}{{ config.file_index }}">{{ config.board_abbreviation|format(post.board) }}</a>
|
||||
</td>
|
||||
<td class="minimal">
|
||||
{% if post.thread %}
|
||||
|
@ -1,2 +1,2 @@
|
||||
<p style="text-align:center">{{ 'Successfully rebuilt the <strong>%s</strong> theme.'|trans|sprintf(theme_name) }}</p>
|
||||
<p style="text-align:center">{{ 'Successfully rebuilt the <strong>%s</strong> theme.'|trans|format(theme_name) }}</p>
|
||||
<p style="text-align:center"><a href="?/themes">{% trans 'Go back to themes' %}</a>.</p>
|
||||
|
@ -64,7 +64,7 @@
|
||||
{% endif %}
|
||||
>
|
||||
<label for="board_{{ board.uri }}">
|
||||
{{ config.board_abbreviation|sprintf(board.uri) }}
|
||||
{{ config.board_abbreviation|format(board.uri) }}
|
||||
-
|
||||
{{ board.title|e }}
|
||||
</label>
|
||||
@ -101,11 +101,11 @@
|
||||
<a href="?/IP/{{ log.ip }}">{{ log.ip }}</a>
|
||||
</td>
|
||||
<td class="minimal">
|
||||
<span title="{{ log.time|date(config.post_date) }}">{{ log.time|ago }}</span>
|
||||
<span title="{{ log.time|strftime(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>
|
||||
<a href="?/{{ config.board_path|format(log.board) }}{{ config.file_index }}">{{ config.board_abbreviation|format(log.board) }}</a>
|
||||
{% else %}
|
||||
-
|
||||
{% endif %}
|
||||
|
@ -31,7 +31,7 @@
|
||||
{% set boards = user.boards|split(',') %}
|
||||
{% set _boards = [] %}
|
||||
{% for board in boards %}
|
||||
{% set _boards = _boards|push(board == '*' ? '*' : config.board_abbreviation|sprintf(board)) %}
|
||||
{% set _boards = _boards|push(board == '*' ? '*' : config.board_abbreviation|format(board)) %}
|
||||
{% endfor %}
|
||||
{% set _boards = _boards|sort %}
|
||||
{{ _boards|join(', ') }}
|
||||
|
@ -1,8 +1,8 @@
|
||||
{% for board_posts in posts %}
|
||||
<fieldset>
|
||||
<legend>
|
||||
<a href="?/{{ config.board_path|sprintf(board_posts.board.uri) }}{{ config.file_index }}">
|
||||
{{ config.board_abbreviation|sprintf(board_posts.board.uri) }}
|
||||
<a href="?/{{ config.board_path|format(board_posts.board.uri) }}{{ config.file_index }}">
|
||||
{{ config.board_abbreviation|format(board_posts.board.uri) }}
|
||||
-
|
||||
{{ board_posts.board.title|e }}
|
||||
</a>
|
||||
@ -41,7 +41,7 @@
|
||||
{{ note.body }}
|
||||
</td>
|
||||
<td class="minimal">
|
||||
{{ note.time|date(config.post_date) }}
|
||||
{{ note.time|strftime(config.post_date) }}
|
||||
</td>
|
||||
{% if mod|hasPermission(config.mod.remove_notes) %}
|
||||
<td class="minimal">
|
||||
@ -118,7 +118,7 @@
|
||||
<th>{% trans 'Board' %}</th>
|
||||
<td>
|
||||
{% if ban.board %}
|
||||
{{ config.board_abbreviation|sprintf(ban.board) }}
|
||||
{{ config.board_abbreviation|format(ban.board) }}
|
||||
{% else %}
|
||||
<em>{% trans 'all boards' %}</em>
|
||||
{% endif %}
|
||||
@ -126,13 +126,13 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{% trans 'Set' %}</th>
|
||||
<td>{{ ban.created|date(config.post_date) }}</td>
|
||||
<td>{{ ban.created|strftime(config.post_date) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{% trans 'Expires' %}</th>
|
||||
<td>
|
||||
{% if ban.expires %}
|
||||
{{ ban.expires|date(config.post_date) }}
|
||||
{{ ban.expires|strftime(config.post_date) }}
|
||||
{% else %}
|
||||
<em>{% trans 'never' %}</em>
|
||||
{% endif %}
|
||||
@ -196,11 +196,11 @@
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="minimal">
|
||||
<span title="{{ log.time|date(config.post_date) }}">{{ log.time|ago }}</span>
|
||||
<span title="{{ log.time|strftime(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>
|
||||
<a href="?/{{ config.board_path|format(log.board) }}{{ config.file_index }}">{{ config.board_abbreviation|format(log.board) }}</a>
|
||||
{% else %}
|
||||
-
|
||||
{% endif %}
|
||||
|
@ -3,7 +3,7 @@
|
||||
{% if config.country_flags_condensed %}
|
||||
class="flag flag-{{ post.modifiers.flag }}" src="{{ config.image_blank }}"
|
||||
{% else %}
|
||||
class="flag" src="{{ config.uri_flags|sprintf(post.modifiers.flag) }}"
|
||||
class="flag" src="{{ config.uri_flags|format(post.modifiers.flag) }}"
|
||||
{% endif %}
|
||||
style="{% if post.modifiers['flag style'] %}
|
||||
{{ post.modifiers['flag style'] }}
|
||||
|
@ -15,9 +15,9 @@
|
||||
poster="
|
||||
{{ config.root }}
|
||||
{% if config.file_icons[post.filename|extension] %}
|
||||
{{ config.file_thumb|sprintf(config.file_icons[post.filename|extension]) }}
|
||||
{{ config.file_thumb|format(config.file_icons[post.filename|extension]) }}
|
||||
{% else %}
|
||||
{{ config.file_thumb|sprintf(config.file_icons.default) }}
|
||||
{{ config.file_thumb|format(config.file_icons.default) }}
|
||||
{% endif %}
|
||||
"
|
||||
style="width:{{ post.thumbwidth }}px;height:{{ post.thumbheight }}px"
|
||||
@ -29,9 +29,9 @@
|
||||
{% if post.thumb == 'file' %}
|
||||
{{ config.root }}
|
||||
{% if config.file_icons[post.filename|extension] %}
|
||||
{{ config.file_thumb|sprintf(config.file_icons[post.filename|extension]) }}
|
||||
{{ config.file_thumb|format(config.file_icons[post.filename|extension]) }}
|
||||
{% else %}
|
||||
{{ config.file_thumb|sprintf(config.file_icons.default) }}
|
||||
{{ config.file_thumb|format(config.file_icons.default) }}
|
||||
{% endif %}
|
||||
{% elseif post.thumb == 'spoiler' %}
|
||||
{{ config.root }}{{ config.spoiler_image }}
|
||||
|
@ -1 +1 @@
|
||||
<time datetime="{{ post.time|date('%Y-%m-%dT%H:%M:%S') }}{{ timezone() }}">{{ post.time|date(config.post_date) }}</time>
|
||||
<time datetime="{{ post.time|strftime('%Y-%m-%dT%H:%M:%S') }}Z">{{ post.time|strftime(config.post_date) }}</time>
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% filter remove_whitespace %}
|
||||
{% apply spaceless %}
|
||||
{# tabs and new lines will be ignored #}
|
||||
<div class="post reply" id="reply_{{ post.id }}">
|
||||
<p class="intro">
|
||||
@ -18,11 +18,11 @@
|
||||
{% include 'post/fileinfo.html' %}
|
||||
{% include 'post/post_controls.html' %}
|
||||
<div class="body" {% if post.files|length > 1 %}style="clear:both"{% endif %}>
|
||||
{% endfilter %}{% if index %}{{ post.body|truncate_body(post.link) }}{% else %}{{ post.body }}{% endif %}{% filter remove_whitespace %}
|
||||
{% endapply %}{% if index %}{{ post.body|truncate_body(post.link) }}{% else %}{{ post.body }}{% endif %}{% apply spaceless %}
|
||||
{% if post.modifiers['ban message'] %}
|
||||
{{ config.mod.ban_message|sprintf(post.modifiers['ban message']) }}
|
||||
{{ config.mod.ban_message|format(post.modifiers['ban message']) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% filter remove_whitespace %}
|
||||
{% apply spaceless %}
|
||||
{# tabs and new lines will be ignored #}
|
||||
|
||||
<div class="thread" id="thread_{{ post.id }}" data-board="{{ board.uri }}">
|
||||
@ -58,9 +58,9 @@
|
||||
{% include 'post/post_controls.html' %}
|
||||
</p>
|
||||
<div class="body">
|
||||
{% endfilter %}{% if index %}{{ post.body|truncate_body(post.link) }}{% else %}{{ post.body }}{% endif %}{% filter remove_whitespace %}
|
||||
{% endapply %}{% if index %}{{ post.body|truncate_body(post.link) }}{% else %}{{ post.body }}{% endif %}{% apply spaceless %}
|
||||
{% if post.modifiers['ban message'] %}
|
||||
{{ config.mod.ban_message|sprintf(post.modifiers['ban message']) }}
|
||||
{{ config.mod.ban_message|format(post.modifiers['ban message']) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if post.omitted or post.omitted_images %}
|
||||
@ -86,7 +86,7 @@
|
||||
{% endif %}
|
||||
{% if not index %}
|
||||
{% endif %}
|
||||
</div>{% endfilter %}
|
||||
</div>{% endapply %}
|
||||
{% set hr = post.hr %}
|
||||
{% for post in post.posts %}
|
||||
{% include 'post_reply.html' %}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% filter remove_whitespace %}
|
||||
{% apply spaceless %}
|
||||
{# tabs and new lines will be ignored #}
|
||||
|
||||
{# we are intentionally breaking the thread_ID convention: the jses need to handle this case differently #}
|
||||
@ -39,4 +39,4 @@
|
||||
<a href="{{ post.root }}{{ board.dir }}{{ config.dir.res }}{{ link_for(post) }}">[{% trans %}Reply{% endtrans %}]</a>
|
||||
|
||||
</tr>
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit f94be057545c43ed673fabc017bcc7f383cf2446
|
||||
Subproject commit 0a0c9102709cac4ad1d5e333fcd2355d7488c1b4
|
@ -1,4 +1,4 @@
|
||||
{% filter remove_whitespace %}
|
||||
{% apply spaceless %}
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
@ -29,7 +29,7 @@
|
||||
{% else %}
|
||||
<em>no subject</em>
|
||||
{% endif %}
|
||||
<span class="unimportant"> — by {{ entry.name }} at {{ entry.time|date(config.post_date, config.timezone) }}</span>
|
||||
<span class="unimportant"> — by {{ entry.name }} at {{ entry.time|strftime(config.post_date, config.timezone) }}</span>
|
||||
</h2>
|
||||
<p>{{ entry.body }}</p>
|
||||
{% endfor %}
|
||||
@ -39,9 +39,9 @@
|
||||
<hr/>
|
||||
<footer>
|
||||
<p class="unimportant" style="margin-top:20px;text-align:center;">Powered by Tinyboard {{ config.version }}
|
||||
<br>Tinyboard Copyright © 2010-2018 Tinyboard Development Group
|
||||
<br>Tinyboard Copyright © 2010-2020 Tinyboard Development Group
|
||||
<br><a href="https://engine.vichan.net/">vichan</a> Copyright © 2012-2016 vichan-devel</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% filter remove_whitespace %}
|
||||
{% apply spaceless %}
|
||||
<!doctype html>
|
||||
<html lang="{{ config.locale }}">
|
||||
<head>
|
||||
@ -54,7 +54,7 @@
|
||||
data-name="{{ post.name|e }}"
|
||||
data-muhdifference="{{ post.muhdifference }}"
|
||||
class="{{ post.board }} thread-image"
|
||||
title="{{ post.bump|date('%b %d %H:%M') }}">
|
||||
title="{{ post.bump|strftime('%b %d %H:%M') }}">
|
||||
</a>
|
||||
<div class="replies">
|
||||
<strong>R: {{ post.reply_count }} / I: {{ post.image_count }}{% if post.sticky %} (sticky){% endif %}</strong>
|
||||
@ -90,4 +90,4 @@
|
||||
</script>{% endverbatim %}
|
||||
</body>
|
||||
</html>
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% filter remove_whitespace %}
|
||||
{% apply spaceless %}
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
@ -24,7 +24,7 @@
|
||||
{% else %}
|
||||
<em>{% trans %}no subject{% endtrans %}</em>
|
||||
{% endif %}
|
||||
<span class="unimportant"> — {% trans %}by{% endtrans %} {{ entry.name }} {% trans %}at{% endtrans %} {{ entry.time|date(config.post_date) }}</span>
|
||||
<span class="unimportant"> — {% trans %}by{% endtrans %} {{ entry.name }} {% trans %}at{% endtrans %} {{ entry.time|strftime(config.post_date) }}</span>
|
||||
</h2>
|
||||
<p>{{ entry.body }}</p>
|
||||
{% endfor %}
|
||||
@ -33,9 +33,9 @@
|
||||
|
||||
<footer>
|
||||
<p class="unimportant" style="margin-top:20px;text-align:center;">Powered by Tinyboard {{ config.version }}
|
||||
<br>Tinyboard Copyright © 2010-2018 Tinyboard Development Group
|
||||
<br>Tinyboard Copyright © 2010-2020 Tinyboard Development Group
|
||||
<br><a href="https://engine.vichan.net/">vichan</a> Copyright © 2012-2016 vichan-devel</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% filter remove_whitespace %}
|
||||
{% apply spaceless %}
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
@ -51,4 +51,4 @@
|
||||
{% endfor %}
|
||||
</body>
|
||||
</html>
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% filter remove_whitespace %}
|
||||
{% apply spaceless %}
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
@ -23,7 +23,7 @@
|
||||
{% else %}
|
||||
<em>no subject</em>
|
||||
{% endif %}
|
||||
<span class="unimportant"> — by {{ entry.name }} at {{ entry.time|date(config.post_date) }}</span>
|
||||
<span class="unimportant"> — by {{ entry.name }} at {{ entry.time|strftime(config.post_date) }}</span>
|
||||
</h2>
|
||||
<p>{{ entry.body }}</p>
|
||||
{% endfor %}
|
||||
@ -32,9 +32,9 @@
|
||||
|
||||
<footer>
|
||||
<p class="unimportant" style="margin-top:20px;text-align:center;">Powered by Tinyboard {{ config.version }}
|
||||
<br>Tinyboard Copyright © 2010-2018 Tinyboard Development Group
|
||||
<br>Tinyboard Copyright © 2010-2020 Tinyboard Development Group
|
||||
<br><a href="https://engine.vichan.net/">vichan</a> Copyright © 2012-2016 vichan-devel</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% filter remove_whitespace %}
|
||||
{% apply spaceless %}
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
@ -29,7 +29,7 @@
|
||||
<ul>
|
||||
{% for board in boards %}
|
||||
<li>
|
||||
<a href="{{ config.board_path|sprintf(board.uri) }}">
|
||||
<a href="{{ config.board_path|format(board.uri) }}">
|
||||
{{ board.title|e }}
|
||||
</a>
|
||||
</li>
|
||||
@ -38,4 +38,4 @@
|
||||
</fieldset>
|
||||
</body>
|
||||
</html>
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% filter remove_whitespace %}
|
||||
{% apply spaceless %}
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
@ -57,9 +57,9 @@
|
||||
<hr/>
|
||||
<footer>
|
||||
<p class="unimportant" style="margin-top:20px;text-align:center;">Powered by Tinyboard {{ config.version }}
|
||||
<br>Tinyboard Copyright © 2010-2014 Tinyboard Development Group
|
||||
<br>Tinyboard Copyright © 2010-2020 Tinyboard Development Group
|
||||
<br><a href="https://engine.vichan.net/">vichan</a> Copyright © 2012-2016 vichan-devel</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% filter remove_whitespace %}
|
||||
{% apply remove_whitespace %}
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<rss xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
version="2.0">
|
||||
@ -25,4 +25,4 @@
|
||||
{% endfor %}
|
||||
</channel>
|
||||
</rss>
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
|
@ -1,9 +1,9 @@
|
||||
{% filter remove_whitespace %}
|
||||
{% apply remove_whitespace %}
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
{% for board in boards %}
|
||||
<url>
|
||||
<loc>{{ settings.url ~ (config.board_path | format(board)) ~ config.file_index }}</loc>
|
||||
<loc>{{ settings.url ~ (config.board_path|format(board)) ~ config.file_index }}</loc>
|
||||
</url>
|
||||
{% endfor %}
|
||||
{% for board, thread_list in threads %}
|
||||
@ -16,4 +16,4 @@
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</urlset>
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user