# HG changeset patch # User Goffi # Date 1521886574 -3600 # Node ID ca42dc037bbf0b917b064e5bf5f64e2d815f3dc1 # Parent 4f27ce980cedd87fec4d3049136346c5c983d47e file (discover): new discovery page: the discovery page will show service, own devices and roster contact devices offering file sharing. An extra field allow to enter free jid. Added a small message in photo/discover.html has photo album discovery is not yes implemented. New block and images macros. diff -r 4f27ce980ced -r ca42dc037bbf default/components/block.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/default/components/block.html Sat Mar 24 11:16:14 2018 +0100 @@ -0,0 +1,17 @@ +{% macro separator(label, align='center') %} +{# display a bloc separator + @param label(unicode): label to show + @param align(unicode): one of "left", "center", "right" +#} +
+ {% if align in ('center', 'right') %} +
+ {% endif %} +
+ {{label}} +
+ {% if align in ('center', 'left') %} +
+ {% endif %} +
+{% endmacro %} diff -r 4f27ce980ced -r ca42dc037bbf default/components/images.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/default/components/images.html Sat Mar 24 11:16:14 2018 +0100 @@ -0,0 +1,15 @@ +{% macro get_icon_client(ident) %} + {% if ident.client %} + {% if ident.client.pc %} + {{ icon('desktop', cls='file__icon') }} + {% elif ident.client.phone %} + {{ icon('mobile', cls='file__icon') }} + {% elif ident.client.web %} + {{ icon('globe', cls='file__icon') }} + {% elif ident.client.console %} + {{ icon('terminal', cls='file__icon') }} + {% else %} + {{ icon('desktop', cls='file__icon') }} + {% endif %} + {% endif %} +{% endmacro %} diff -r 4f27ce980ced -r ca42dc037bbf default/file/discover.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/default/file/discover.html Sat Mar 24 11:16:14 2018 +0100 @@ -0,0 +1,73 @@ +{% extends 'base/base.html' %} +{% import 'components/block.html' as block %} +{% import 'components/images.html' as images with context %} +{% import 'input/form.html' as form with context %} +{% import 'input/field.html' as field with context %} + +{% block body %} +{{ icon_defs('server', 'desktop', 'mobile', 'globe', 'terminal') }} +

+ {% trans %} + Please select the device you want to access + {% endtrans %} +

+
+ {% if disco_service_entities %} + + {% endif %} + {% if disco_own_entities %} +
+ {{ block.separator(_("your devices")) }} + +
+ {% endif %} + {% if disco_roster_entities %} +
+ {{ block.separator(_("your contacts devices")) }} + +
+ {% endif %} +
+ +

{% trans %}Or enter a full jid of a device{% endtrans %}

+{% call form.form(class="form_single") %} + {{ field.text("jid", _("device full jid"), required=true)}} + {{ field.submit(_("Access")) }} +{% endcall %} +{% endblock body %} diff -r 4f27ce980ced -r ca42dc037bbf default/photo/discover.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/default/photo/discover.html Sat Mar 24 11:16:14 2018 +0100 @@ -0,0 +1,11 @@ +{% extends 'base/base.html' %} +{% import 'input/form.html' as form with context %} +{% import 'input/field.html' as field with context %} + +{% block body %} +

{% trans %}Photo discovery is not implemented yet, however you can enter a jid below to find its albums{% endtrans %}

+{% call form.form(class="form_single") %} + {{ field.text("jid", _("device full jid"), required=true)}} + {{ field.submit(_("Access")) }} +{% endcall %} +{% endblock body %} diff -r 4f27ce980ced -r ca42dc037bbf default/static/styles.css --- a/default/static/styles.css Sat Mar 24 11:14:14 2018 +0100 +++ b/default/static/styles.css Sat Mar 24 11:16:14 2018 +0100 @@ -89,6 +89,56 @@ font-style: italic; } +/*** blocks ***/ + +.block_separator { + font-size: 1.4em; + display: flex; +} + +.block_separator__label { + display: inline-block; + margin: 0 0.2em; +} + +.block_separator__line { + height: 1px; + background: #ccc; + flex: 1; + margin-top: 0.7em; +} + +/*** grids ***/ + +.grid { + list-style: none; + display: flex; + flex-wrap: wrap; +} + +.grid--center { + justify-content: center; +} + +.grid__item>a { + text-decoration: none; + color: inherit; +} + +.grid__item--medium { + width: 170px; + padding: 0.2em; + text-align: center; +} + +.grid__item--selectable { + cursor: pointer; +} + +.grid__item--selectable:hover { + background-color: var(--select-bg-color); +} + /*** icons ***/ .icon--medium {