webapp: only show the bootstrap.d.n link when there is a problem
authorHelmut Grohne <helmut@subdivi.de>
Tue, 5 Mar 2019 20:18:34 +0000 (21:18 +0100)
committerHelmut Grohne <helmut@subdivi.de>
Tue, 5 Mar 2019 20:18:34 +0000 (21:18 +0100)
Thanks to Johannes Schauer for the suggestion.

webapp.py

index dd20ad6..128b816 100644 (file)
--- a/webapp.py
+++ b/webapp.py
@@ -30,8 +30,12 @@ src_template = """<!DOCTYPE html>
     <th>state</th>
     <th>architectures</th>
    </tr>
+   {%- set bootstrapdn = namespace(show=False) -%}
    {%- set okarchs = depresult.pop(None, None) -%}
    {%- for reason, archs in depresult.items()|sort -%}
+    {%- if not reason.startswith("skew ") -%}
+     {%- set bootstrapdn.show = True -%}
+    {%- endif -%}
     <tr>
      <td>{{ reason|e }}</td>
      <td>{{ archs|arch_format }}</td>
@@ -46,9 +50,11 @@ src_template = """<!DOCTYPE html>
   </table>
   <h5>See also</h5>
   <ul>
-   <li>
-    <a href="https://bootstrap.debian.net/cross_all/{{ sourcepackage|e }}.html">bootstrap.debian.net</a>
-   </li>
+   {%- if bootstrapdn.show -%}
+    <li>
+     <a href="https://bootstrap.debian.net/cross_all/{{ sourcepackage|e }}.html">bootstrap.debian.net</a>
+    </li>
+   {%- endif -%}
    <li>
     <a href="https://qa.debian.org/dose/debcheck/cross_unstable_main_amd64/">debcheck</a>
    </li>