FreedomBox/plinth/templates/toolbar.html
Sunil Mohan Adapa f1060fbf6b
app: Add backup and restore menu items to toolbar menu
Closes: #2316.

Tests:

- Go to to power app. There is no menu.

- Go to firewall app. There is a menu item but no backup and restore items present.

- Go to bepasty app. There are backup and restore menu items in menu. Clicking
backup items takes us to create backup page with only Bepasty app selected.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
[jvalleroy: Fix CSS classes for new menu items]
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-02-12 14:13:24 -05:00

66 lines
2.3 KiB
HTML

{% comment %}
# SPDX-License-Identifier: AGPL-3.0-or-later
{% endcomment %}
{% load i18n %}
{% block toolbar %}
<section class="toolbar">
<div class="btn-toolbar" role="toolbar">
{% include "clients-button.html" with clients=app_info.clients enabled=is_enabled %}
{% if app_info.donation_url %}
<a target="_blank" rel="noopener noreferrer"
class="btn btn-default button-secondary button-donate" role="button"
href="{{ app_info.donation_url }}">
<span class="fa fa-heart"></span>
{% trans "Donate" %}
<span class="fa fa-external-link"></span>
</a>
{% endif %}
{% if has_diagnostics or show_uninstall or has_backup_restore %}
<!-- Single button -->
<div class="btn-group button-secondary">
<button type="button" class="btn btn-default dropdown-toggle"
data-toggle="dropdown" aria-haspopup="true"
aria-expanded="false" id="id_extra_actions_button">
<span class="fa fa-cog" aria-hidden="true"></span>
</button>
<div class="dropdown-menu" aria-labelledby="id_extra_actions_button">
{% if has_diagnostics %}
{% include "diagnostics_button.html" with app_id=app_id enabled=is_enabled %}
{% endif %}
{% if has_backup_restore %}
<a class="dropdown-item backup-item"
href="{% url 'backups:create' app_id=app_id %}"
title="{% trans "Backup" %}">
{% trans "Backup" %}
</a>
<a class="dropdown-item restore-item"
href="{% url 'backups:index' %}"
title="{% trans "Restore" %}">
{% trans "Restore" %}
</a>
{% endif %}
{% if show_uninstall %}
<a class="dropdown-item uninstall-item"
href="{% url 'uninstall' app_id=app_id %}"
title="{% trans "Uninstall" %}">
{% trans "Uninstall" %}
</a>
{% endif %}
</div>
</div>
{% endif %}
</div>
<div class="toolbar-collapsed-content">
{% include "clients.html" with clients=app_info.clients enabled=is_enabled %}
</div>
</section>
{% endblock toolbar %}