FreedomBox/plinth/templates/toolbar.html
Alice Kile 6a4a941bb6
toolbar: Move diagnostics button into dropdown menu
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-01 16:40:31 -05:00

105 lines
3.6 KiB
HTML

{% comment %}
#
# This file is part of FreedomBox.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
{% endcomment %}
{% load bootstrap %}
{% load i18n %}
{% load plinth_extras %}
{% load static %}
{% block toolbar %}
{% if clients %}
<div class="toolbar toolbar-default">
<div class="toolbar-heading">
<section class="toolbar-title">
{% if clients|get_self_hosted_web_apps|length == 1 and clients|length == 1 %}
<a
{% if enabled %}
href='{{ clients|get_self_hosted_web_apps|first|lookup:"url" }}'
{% endif %}
target='_blank'
>
<button
role="button"
type="button"
class="btn btn-primary"
{% if not enabled %}
disabled="disabled"
{% endif %}
>
{% trans "Launch web client" %}
</button>
</a>
{% elif clients|get_self_hosted_web_apps|length == 1 %}
<button type="button" class="btn btn-default collapsed collapsible-button"
data-toggle="collapse" data-target="#clients">
<span class="fa fa-chevron-right fa-fw" aria-hidden="true"></span>
{% trans "Client Apps" %}
</button>
<a
{% if enabled %}
href='{{ clients|get_self_hosted_web_apps|first|lookup:"url" }}'
{% endif %}
target='_blank'
>
<button
role="button"
type="button"
class="btn btn-primary"
{% if not enabled %}
disabled="disabled"
{% endif %}
>
{% trans "Launch web client" %}
</button>
</a>
{% else %}
<button type="button" class="btn btn-default collapsed collapsible-button"
data-toggle="collapse" data-target="#clients">
<span class="fa fa-chevron-right fa-fw" aria-hidden="true"></span>
{% trans "Client Apps" %}
</button>
{% endif %}
{% block diagnostics %}
{% if diagnostics_module_name %}
<!-- Single button -->
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="glyphicon glyphicon glyphicon-cog" aria-hidden="true"></span> <span class="caret"></span>
</button>
<div class="dropdown-menu">
{% include "diagnostics_button.html" with module=diagnostics_module_name enabled=is_enabled %}
</div>
</div>
{% endif %}
{% endblock %}
</section>
</div>
<div class="toolbar-body">
{% include "clients.html" with clients=clients enabled=is_enabled %}
</div>
</div>
{% endif %}
{% endblock toolbar %}