Add configurable report and ban window timeouts.

On the success page for bans and reports, the window can now be
configured to close after N seconds if desired.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2022-06-24 16:21:41 -07:00
parent 412045e015
commit 36f73a2d31
5 changed files with 40 additions and 23 deletions

View File

@@ -5,7 +5,8 @@
{# Body #}
{% block content %}
<div class="row" id="message">
{% translate "A ban has been created. This window will close in 1 second." %}
{# We do not use pluralize filter for "seconds" because it's a pain to get it to translate. #}
{% blocktranslate %}A ban has been created. This window will close in {{window_timeout}} second(s).{% endblocktranslate %}
</div>
<script>
@@ -23,7 +24,7 @@ setTimeout(function() {
} else {
window.close();
}
}, 1000);
}, 1000 * {{window_timeout}});
</script>
{% endblock %}

View File

@@ -5,7 +5,8 @@
{# Body #}
{% block content %}
<div class="row" id="message">
{% translate "Post reported. This window will close in 1 second." %}
{# We do not use pluralize filter for "seconds" because it's a pain to get it to translate. #}
{% blocktranslate %}Post reported. This window will close in {{window_timeout}} second(s).{% endblocktranslate %}
</div>
<script>
@@ -23,7 +24,7 @@ setTimeout(function() {
} else {
window.close();
}
}, 1000);
}, 1000 * {{window_timeout}});
</script>
{% endblock %}