Commit e736d471 authored by James Valleroy's avatar James Valleroy

backups: Disable create archive when no supported apps are installed

Signed-off-by: James Valleroy's avatarJames Valleroy <jvalleroy@mailbox.org>
parent 25e49ebc
......@@ -39,6 +39,7 @@
<p>{{ paragraph|safe }}</p>
{% endfor %}
{% if available_apps %}
<p>
<a title="{% trans 'Create archive' %}"
role="button" class="btn btn-primary"
......@@ -46,6 +47,15 @@
{% trans 'Create archive' %}
</a>
</p>
{% else %}
<p>
{% blocktrans trimmed %}
No apps that support backup are currently installed. After any app
that supports backup has been installed, then it will be possible to
create backups.
{% endblocktrans %}
</p>
{% endif %}
<h3>{% trans 'Backup archives' %}</h3>
{% if not archives %}
......
......@@ -29,6 +29,7 @@ from django.views.generic import FormView, TemplateView
from urllib.parse import unquote
from plinth.modules import backups
from .backups import _list_of_all_apps_for_backup
from .forms import CreateArchiveForm, ExportArchiveForm
......@@ -45,6 +46,8 @@ class IndexView(TemplateView):
context['info'] = backups.get_info()
context['archives'] = backups.list_archives()
context['exports'] = backups.get_export_files()
apps = _list_of_all_apps_for_backup()
context['available_apps'] = [x[0] for x in apps]
return context
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment