From 784b1284cb5f49bb6a4bf0ba3cc348cb9dfa244d Mon Sep 17 00:00:00 2001
From: Olimpia Magliulo <olimpiam@intern-ikts-MacBook-Air.local>
Date: Tue, 2 Jan 2018 15:32:08 +0100
Subject: [PATCH] Fix attribute table overflow/wordwrap

+twig indentation
---
 templates/_table.twig          | 23 ++++++++++++-----------
 templates/auth_status.twig     | 14 ++++++--------
 www/assets/css/src/default.css |  7 +++++++
 3 files changed, 25 insertions(+), 19 deletions(-)

diff --git a/templates/_table.twig b/templates/_table.twig
index 3053f066c..5d8d4aff6 100644
--- a/templates/_table.twig
+++ b/templates/_table.twig
@@ -3,20 +3,21 @@
 
 {% for name, values in items %}
     <tr class="{{ cycle(['odd', 'even'], loop.index0) }}">
-    {% block namecol %}
-        <td class="attrname">{{ name }}</td>
-    {% endblock %}
+        {% block namecol -%}
+            <td class="attrname">{{ name }}</td>
+        {%- endblock %}
 
-        <td class="attrvalue">
-            {% for value in values %}
-                {% if loop.length>1 and loop.first %}<ul>{% endif %}
-                {% if loop.length>1 %}<li>{% endif %}
+        <td class="attrvalue">{% spaceless %}
+                {% for value in values %}
+                    {% if loop.length>1 and loop.first %}<ul>{% endif %}
+                    {% if loop.length>1 %}<li>{% endif -%}
 
-                {% block value %}{% endblock %}
+                    {% block value %}{% endblock %}
 
-                {% if loop.length>1 %}</li>{% endif %}
-                {% if loop.length>1 and loop.last %}</ul>{% endif %}
-            {% endfor %}
+                    {% if loop.length>1 %}</li>{% endif %}
+                    {% if loop.length>1 and loop.last %}</ul>{% endif %}
+                {% endfor %}
+            {% endspaceless -%}
         </td>
     </tr>
 {% endfor %}
diff --git a/templates/auth_status.twig b/templates/auth_status.twig
index 2e743b91b..79f24e2bf 100644
--- a/templates/auth_status.twig
+++ b/templates/auth_status.twig
@@ -14,24 +14,22 @@
 <h2>{{ 'Your attributes'|trans }}</h2>
     {% set items = attributes %}
 
-{% embed '_table.twig' %}
+{% embed '_table.twig' -%}
 
-    {% block namecol %}
+    {% block namecol -%}
     {% set attr = ('{attributes:attribute_'~(name|lower)~'}') %}
     {% set translated = attr|trans %}
     <td class="attrname">{% if translated != attr %} {{ translated }} <br>{% endif %} <samp>{{ name }}</samp></td>
     {% endblock %}
 
 
-    {% block value %}
-    {% if name =='jpegPhoto'%}
+    {% block value -%}
+    {% if name =='jpegPhoto'-%}
         <img src="data:image/jpeg;base64,{{ value }}" />
-    {% else %}
-        {{ value }}
-    {% endif %}
+    {% else %}{{ value }}{% endif -%}
     {% endblock %}
 
-{% endembed %}
+{%- endembed %}
 
 
 {% if nameid %}
diff --git a/www/assets/css/src/default.css b/www/assets/css/src/default.css
index dc0146099..dee63a056 100644
--- a/www/assets/css/src/default.css
+++ b/www/assets/css/src/default.css
@@ -510,8 +510,15 @@ span.fa, i.fa {
 TABLES
 ************************************************************ */
 .pure-table-attributes{
+    table-layout: fixed;
     width:100%;
 }
+.attrname{
+    text-align: right;
+}
+.attrvalue{
+    overflow-wrap: break-word;
+}
 table.attributes ul{
     padding: inherit;
 }
-- 
GitLab