FreedomBox/plinth/templates/clients.html
Joseph Nuthalapati 7e2b96577c
Uniform and consistent buttons and icons for clients apps
- New icons for the mobile app stores
- Both desktop and mobile icons now have the same style
- Launch button has a new glyphicon
- Client app buttons flow into multiple lines in mobile view

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2017-12-04 12:16:32 -05:00

136 lines
4.8 KiB
HTML

{% comment %}
#
# This file is part of Plinth.
#
# 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 i18n %}
{% load plinth_extras %}
{% load static %}
{% if clients %}
<p>
<button id="collapsible-button" type="button" class="btn btn-default collapsed"
data-toggle="collapse" data-target="#clients">
Client Apps
</button>
</p>
<table id="clients" class="table table-hover collapse">
{% if clients|has_web_clients %}
{% with clients|of_type:'web' as web_clients %}
{% for client in web_clients %}
<tr>
{% if forloop.counter == 1 %}
<th rowspan=" {{ web_clients|length }}"> Web </th>
{% endif %}
{% for platform in client.platforms %}
{% if platform.type == 'web' %}
<td> {{ client.name }} </td>
<td>
<a class="btn btn-success" href="{{ platform.url }}" role="button">
Launch <span class="glyphicon glyphicon-new-window"></span>
</a>
</td>
{% endif %}
{% endfor %}
</tr>
{% endfor %}
{% endwith %}
{% endif %}
{% if clients|has_desktop_clients %}
{% with clients|of_type:'desktop' as desktop_clients %}
{% for client in desktop_clients %}
<tr>
{% if forloop.counter == 1 %}
<th rowspan="{{ desktop_clients|length }}"> Desktop </th>
{% endif %}
<td> {{ client.name }} </td>
<td>
{% for platform in client.platforms %}
{% if platform.type == 'download' %}
<a class="btn btn-default" href="{{ platform.url }}" role="button">
{% with 'theme/icons/'|add:platform.os|add:'.png' as icon %}
<img class="client-icon" src="{% static icon %}" /> {{ platform.os|display_name }}
{% endwith %}
</a>
{% endif %}
{% endfor %}
</td>
</tr>
{% endfor %}
{% endwith %}
{% endif %}
{% if clients|has_mobile_clients %}
{% with clients|of_type:'mobile' as mobile_clients %}
{% for client in mobile_clients %}
<tr>
{% if forloop.counter == 1 %}
<th rowspan="{{ mobile_clients|length }}"> Mobile </th>
{% endif %}
<td> {{ client.name }} </td>
<td>
{% for platform in client.platforms %}
{% if platform.type == 'store' and platform.os == 'android' or platform.os == 'ios' %}
<a class="btn btn-default" href="{{ platform.url }}" role="button">
{% with 'theme/icons/'|add:platform.store_name|add:'.png' as icon %}
<img class="client-icon" src="{% static icon %}" /> {{ platform.store_name|display_name }}
{% endwith %}
</a>
{% endif %}
{% endfor %}
</td>
</tr>
{% endfor %}
{% endwith %}
{% endif %}
{% if clients|has_package_clients %}
{% with clients|of_type:'package' as package_clients %}
{% for client in package_clients %}
<tr>
{% if forloop.counter == 1 %}
<th rowspan="{{ package_clients|length }}"> Package </th>
{% endif %}
<td> {{ client.name }} </td>
<td>
<div class="row">
<ul>
{% for platform in client.platforms %}
{% if platform.type == 'package' %}
{% if platform.type == 'package' and platform.format == 'deb' %}
<li> <strong> Debian: </strong> {{ platform.name }} </li>
{% endif %}
{% if platform.type == 'package' and platform.format == 'homebrew' %}
<li> <strong> HomeBrew: </strong> {{ platform.name }} </li>
{% endif %}
{% endif %}
{% endfor %}
</ul>
</div>
</td>
</tr>
{% endfor %}
{% endwith %}
{% endif %}
</table>
{% endif %}