changeset 231:aa37750c2617

theme (default): various fixes: - added missing </tr> in event/admin.html - fixed used of identities - uses `class` from kwargs in input/field.html
author Goffi <goffi@goffi.org>
date Tue, 19 May 2020 00:04:47 +0200 (2020-05-18)
parents 0e69b5843c2f
children 741dae9b0612
files sat_templates/templates/default/blog/item.html sat_templates/templates/default/event/admin.html sat_templates/templates/default/file/discover.html sat_templates/templates/default/input/field.html
diffstat 4 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/sat_templates/templates/default/blog/item.html	Tue May 19 00:02:34 2020 +0200
+++ b/sat_templates/templates/default/blog/item.html	Tue May 19 00:04:47 2020 +0200
@@ -42,7 +42,7 @@
                 {% if avatar is defined %}
                     {{ avatar.avatar(item.author_jid, "avatar--float-left") }}
                 {% endif %}
-                <span class="blog__author">{{identities[item.author_jid].nicknames[0] | default(item.author)}}</span>
+                <span class="blog__author">{{identities[item.author_jid].nicknames[0] if identities[item.author_jid].nicknames else item.author}}</span>
             {% else %}
                 <span class="blog__author">{{item.author}}</span>
             {% endif %}
--- a/sat_templates/templates/default/event/admin.html	Tue May 19 00:02:34 2020 +0200
+++ b/sat_templates/templates/default/event/admin.html	Tue May 19 00:04:47 2020 +0200
@@ -33,6 +33,7 @@
                 <th>{% trans %}name{% endtrans %}</th>
                 <th>{% trans %}coming?{% endtrans %}</th>
                 <th>{% trans %}guests{% endtrans %}</th>
+            </tr>
             {% for name, data in invitees.items() %}
                 <tr>
                     <td>{{name}}</td>
--- a/sat_templates/templates/default/file/discover.html	Tue May 19 00:02:34 2020 +0200
+++ b/sat_templates/templates/default/file/discover.html	Tue May 19 00:04:47 2020 +0200
@@ -24,7 +24,7 @@
                                 {% if disco_service_entities|count == 1 %}
                                     {% trans %}your server{% endtrans %}
                                 {% else %}
-                                    {{ ident.values()[0].values()[0][0] }}
+                                    {{ (ident.values()|first).values()|first|first }}
                                 {% endif %}
                             </span>
                         </a>
@@ -41,7 +41,9 @@
                     <li class='grid__item grid__item--medium grid__item--selectable'>
                         <a href="{{entities_url[entity]}}">
                             {{images.get_icon_client(ident)}}
-                            <span>{{ ident.values()[0].values()[0][0] }}</span>
+                            <span>
+                                {{ (ident.values()|first).values()|first|first }}
+                            </span>
                         </a>
                     </li>
                 {% endfor %}
--- a/sat_templates/templates/default/input/field.html	Tue May 19 00:02:34 2020 +0200
+++ b/sat_templates/templates/default/input/field.html	Tue May 19 00:04:47 2020 +0200
@@ -93,5 +93,5 @@
     @param text(str): label of the button
     @param id(none, str): id of the element
     #}
-    <input {{ 'id="{id}"'.format(id=id)|safe if id }} class="form_submit btn" type="submit" value="{{text}}" class="{{kwargs.pop('class', '')}}">
+    <input {{ 'id="{id}"'.format(id=id)|safe if id }} class="form_submit btn {{kwargs.pop('class', '')}}" type="submit" value="{{text}}">
 {% endmacro %}