Added Import Limit
This commit is contained in:
parent
8ec984c3ff
commit
df54df8309
16 changed files with 138 additions and 9 deletions
|
@ -15,6 +15,11 @@
|
|||
{% endif %}
|
||||
|
||||
{% if site.imports_enabled %}
|
||||
<div class="notification">
|
||||
<p>Currently you are allowed to import {{ import_size_limit }} books every {{ import_limit_reset }} days.</p>
|
||||
<p>You have {{ allowed_imports }} left.</p>
|
||||
</div>
|
||||
|
||||
{% if recent_avg_hours or recent_avg_minutes %}
|
||||
<div class="notification">
|
||||
<p>
|
||||
|
@ -90,7 +95,12 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button class="button is-primary" type="submit">{% trans "Import" %}</button>
|
||||
{% if allowed_imports > 0 %}
|
||||
<button class="button is-primary" type="submit">{% trans "Import" %}</button>
|
||||
{% else %}
|
||||
<button class="button is-primary is-disabled" type="submit">{% trans "Import" %}</button>
|
||||
<p>{% trans "You've reached the import limit." %}</p>
|
||||
{% endif%}
|
||||
</form>
|
||||
{% else %}
|
||||
<div class="box notification has-text-centered is-warning m-6 content">
|
||||
|
|
|
@ -57,8 +57,39 @@
|
|||
</div>
|
||||
</form>
|
||||
{% endif %}
|
||||
<details class="details-panel box">
|
||||
<summary>
|
||||
<span role="heading" aria-level="2" class="title is-6">
|
||||
{% trans "Limit the amount of imports" %}
|
||||
</span>
|
||||
<span class="details-close icon icon-x" aria-hidden="true"></span>
|
||||
</summary>
|
||||
<form
|
||||
name="imports-set-limit"
|
||||
id="imports-set-limit"
|
||||
method="POST"
|
||||
action="{% url 'settings-imports-set-limit' %}"
|
||||
>
|
||||
<div class="notification">
|
||||
{% trans "Some users might try to import a large number of books, which you want to limit." %}
|
||||
{% trans "Set the value to 0 to not enforce any limit." %}
|
||||
</div>
|
||||
<div class="align.to-t">
|
||||
<label for="limit">Set import limit to</label>
|
||||
<input name="limit" class="input is-w-xs is-h-em" type="text" placeholder="0" value={{ import_size_limit }}>
|
||||
<label for="reset">books every</label>
|
||||
<input name="reset" class="input is-w-xs is-h-em" type="text" placeholder="0" value={{ import_limit_reset }}>
|
||||
<label>days.</label>
|
||||
{% csrf_token %}
|
||||
<div class="control">
|
||||
<button type="submit" class="button is-warning">
|
||||
{% trans "Set limit" %}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</details>
|
||||
</div>
|
||||
|
||||
<div class="block">
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue