mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-20 10:34:30 +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 %}
|
{% endif %}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
|
||||||
<a href='{% url "jsxc:jsxc" %}' target='_blank' class='btn btn-primary'>
|
|
||||||
{% trans "Launch web client" %}</a>
|
|
||||||
</p>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -26,11 +26,6 @@
|
|||||||
<p>{{ paragraph|safe }}</p>
|
<p>{{ paragraph|safe }}</p>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
|
||||||
<p>
|
|
||||||
<a href='{% url "jsxc:jsxc" %}' target='_blank' class='btn btn-primary'>
|
|
||||||
{% trans "Launch web client" %}</a>
|
|
||||||
</p>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block configuration %}
|
{% block configuration %}
|
||||||
|
|||||||
@ -29,6 +29,6 @@ urlpatterns = [
|
|||||||
AppView.as_view(app_id='roundcube', name=roundcube.name,
|
AppView.as_view(app_id='roundcube', name=roundcube.name,
|
||||||
diagnostics_module_name='roundcube',
|
diagnostics_module_name='roundcube',
|
||||||
description=roundcube.description,
|
description=roundcube.description,
|
||||||
show_status_block=False,
|
show_status_block=False, clients=roundcube.clients,
|
||||||
manual_page=roundcube.manual_page), name='index'),
|
manual_page=roundcube.manual_page), name='index'),
|
||||||
]
|
]
|
||||||
|
|||||||
@ -45,8 +45,21 @@
|
|||||||
</p>
|
</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% 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 %}
|
{% include "clients.html" with clients=clients enabled=is_enabled %}
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% block subsubmenu %}
|
{% block subsubmenu %}
|
||||||
{% if subsubmenu %}
|
{% if subsubmenu %}
|
||||||
{% show_subsubmenu subsubmenu %}
|
{% show_subsubmenu subsubmenu %}
|
||||||
|
|||||||
@ -44,7 +44,7 @@
|
|||||||
<td>{{ client.name }}</td>
|
<td>{{ client.name }}</td>
|
||||||
<td>
|
<td>
|
||||||
<a target="_blank" rel="noopener noreferrer"
|
<a target="_blank" rel="noopener noreferrer"
|
||||||
class="btn btn-success" role="button"
|
class="btn btn-default" role="button"
|
||||||
{% if not enabled %} disabled="disabled"
|
{% if not enabled %} disabled="disabled"
|
||||||
{% else %} href="{{ platform.url }}"
|
{% else %} href="{{ platform.url }}"
|
||||||
{% endif %}>
|
{% endif %}>
|
||||||
|
|||||||
@ -67,3 +67,9 @@ def show_subsubmenu(context, menu):
|
|||||||
def clients_of_type(clients, client_type):
|
def clients_of_type(clients, client_type):
|
||||||
"""Filter and get clients of a particular type"""
|
"""Filter and get clients of a particular type"""
|
||||||
return clients_module.of_type(clients, client_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):
|
class YAMLFile(object):
|
||||||
"""A context management class for updating YAML files"""
|
"""A context management class for updating YAML files"""
|
||||||
|
|
||||||
def __init__(self, yaml_file):
|
def __init__(self, yaml_file):
|
||||||
"""Return a context object for the YAML file.
|
"""Return a context object for the YAML file.
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user