1
0
Fork 0

Admin UI to enable and disable importing

This commit is contained in:
Mouse Reeve 2022-11-17 14:22:45 -08:00
parent 7e10b0cd1f
commit 7c7c0e1a93
6 changed files with 103 additions and 1 deletions

View file

@ -11,6 +11,54 @@
{% block panel %}
<div class="block">
{% if site.imports_enabled %}
<details class="details-panel box">
<summary>
<span role="heading" aria-level="2" class="title is-6">
{% trans "Disable starting new imports" %}
</span>
<span class="details-close icon icon-x" aria-hidden="true"></span>
</summary>
<form
name="disable-imports"
id="disable-imports"
method="POST"
action="{% url 'settings-imports-disable' %}"
>
<div class="notification">
{% trans "This is only intended to be used when things have gone very wrong with imports and you need to pause the feature while addressing issues." %}
{% trans "While imports are disabled, users will not be allowed to start new imports, but existing imports will not be effected." %}
</div>
{% csrf_token %}
<div class="control">
<button type="submit" class="button is-danger">
{% trans "Disable imports" %}
</button>
</div>
</form>
</details>
{% else %}
<form
name="enable-imports"
id="enable-imports"
method="POST"
action="{% url 'settings-imports-enable' %}"
class="box"
>
<div class="notification is-danger is-light">
{% trans "Users are currently unable to start new imports" %}
</div>
{% csrf_token %}
<div class="control">
<button type="submit" class="button is-success">
{% trans "Enable imports" %}
</button>
</div>
</form>
{% endif %}
</div>
<div class="block">
<div class="tabs">
<ul>