webapp: reduce size of comparison output
authorHelmut Grohne <helmut@subdivi.de>
Thu, 2 May 2013 16:48:14 +0000 (18:48 +0200)
committerHelmut Grohne <helmut@subdivi.de>
Thu, 2 May 2013 16:48:14 +0000 (18:48 +0200)
Only add rowspan when it carries a meaning.

webapp.py

index 345bb40..2cc8a7e 100755 (executable)
--- a/webapp.py
+++ b/webapp.py
@@ -78,7 +78,7 @@ detail_template = jinjaenv.from_string(
 <table border='1'><tr><th colspan="2">{{ details1.package|e }}</th><th colspan="2">{{ details2.package|e }}</th></tr>
 <tr><th>size</th><th>filename</th><th>hash functions</th><th>filename</th></tr>
 {%- for entry in shared -%}
-    <tr><td rowspan={{ entry.matches|length }}>{{ entry.size|format_size }}</td><td rowspan={{ entry.matches|length }}>
+    <tr><td{% if entry.matches|length > 1 %} rowspan={{ entry.matches|length }}{% endif %}>{{ entry.size|format_size }}</td><td{% if entry.matches|length > 1 %} rowspan={{ entry.matches|length }}{% endif %}>
     {%- for filename in entry.filenames %}<span class="filename">{{ filename|e }}</span>{% endfor -%}</td><td>
     {% for filename, match in entry.matches.items() -%}
         {% if not loop.first %}<tr><td>{% endif -%}