mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
clients: implement launch button feature
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
This commit is contained in:
parent
42949bf212
commit
8e3bbdb089
@ -42,10 +42,6 @@
|
||||
{% endif %}
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href='{% url "jsxc:jsxc" %}' target='_blank' class='btn btn-primary'>
|
||||
{% trans "Launch web client" %}</a>
|
||||
</p>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
@ -26,11 +26,6 @@
|
||||
<p>{{ paragraph|safe }}</p>
|
||||
{% endfor %}
|
||||
|
||||
|
||||
<p>
|
||||
<a href='{% url "jsxc:jsxc" %}' target='_blank' class='btn btn-primary'>
|
||||
{% trans "Launch web client" %}</a>
|
||||
</p>
|
||||
{% endblock %}
|
||||
|
||||
{% block configuration %}
|
||||
|
||||
@ -29,6 +29,6 @@ urlpatterns = [
|
||||
AppView.as_view(app_id='roundcube', name=roundcube.name,
|
||||
diagnostics_module_name='roundcube',
|
||||
description=roundcube.description,
|
||||
show_status_block=False,
|
||||
show_status_block=False, clients=roundcube.clients,
|
||||
manual_page=roundcube.manual_page), name='index'),
|
||||
]
|
||||
|
||||
@ -45,7 +45,20 @@
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
{% include "clients.html" with clients=clients enabled=is_enabled %}
|
||||
{% if clients|length == 1 and clients|first|lookup:'platforms'|length == 1 and clients|first|lookup:'platforms'|first|lookup:'type' == 'web' %}
|
||||
|
||||
{% block launch_button %}
|
||||
<p>
|
||||
<a href='{{ clients|first|lookup:"platforms"|first|lookup:"url" }}' target='_blank' class='btn btn-primary'>
|
||||
{% trans "Launch web client" %}</a>
|
||||
</p>
|
||||
{% endblock %}
|
||||
|
||||
{% else %}
|
||||
|
||||
{% include "clients.html" with clients=clients enabled=is_enabled %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% block subsubmenu %}
|
||||
{% if subsubmenu %}
|
||||
|
||||
@ -44,7 +44,7 @@
|
||||
<td>{{ client.name }}</td>
|
||||
<td>
|
||||
<a target="_blank" rel="noopener noreferrer"
|
||||
class="btn btn-success" role="button"
|
||||
class="btn btn-default" role="button"
|
||||
{% if not enabled %} disabled="disabled"
|
||||
{% else %} href="{{ platform.url }}"
|
||||
{% endif %}>
|
||||
|
||||
@ -67,3 +67,9 @@ def show_subsubmenu(context, menu):
|
||||
def clients_of_type(clients, client_type):
|
||||
"""Filter and get clients of a particular type"""
|
||||
return clients_module.of_type(clients, client_type)
|
||||
|
||||
|
||||
@register.filter(name='lookup')
|
||||
def lookup(dictionary, key):
|
||||
"""Get the value in the dictionary at given key"""
|
||||
return dictionary[key]
|
||||
|
||||
@ -76,7 +76,6 @@ def is_user_admin(request, cached=False):
|
||||
|
||||
class YAMLFile(object):
|
||||
"""A context management class for updating YAML files"""
|
||||
|
||||
def __init__(self, yaml_file):
|
||||
"""Return a context object for the YAML file.
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user