Compare commits

...

2 Commits

Author SHA1 Message Date
Felix Blanke
3cae0c6c10 Only show diff if not 0 2023-09-01 15:00:50 +02:00
Felix Blanke
51670ea193 Add links to html template 2023-09-01 14:59:09 +02:00
2 changed files with 17 additions and 2 deletions

View File

@ -16,4 +16,19 @@
{{ image|safe }}
{{ tables|safe }}
</main>
<footer>
<p>Ergebnisse einzelner Landesbezirke:
<a href="/">Bundesweit</a> |
<a href="/BaWü">Baden-Württemberg</a> |
<a href="/Bayern">Bayern</a> |
<a href="/BBR">Berlin-Brandenburg</a> |
<a href="/Hamburg">Hamburg</a> |
<a href="/NDS">Niedersachsen-Bremen</a> |
<a href="/Nord">Nord</a> |
<a href="/NRW">NRW</a> |
<a href="/RLP">Rheinland-Pfalz-Saarland</a> |
<a href="/SAT">Sachsen, Sachsen-Anhalt, Thüringen</a>
</p>
</footer>
</article>

View File

@ -298,7 +298,7 @@ def _print_as_html(df: pd.DataFrame, output_str: list[str], total: int | None =
" </tr>",
]
)
if total:
if total and (diff := total - df['Digitale Befragung'].sum()):
tfoot.extend([
" <tr>",
" <td>Weitere Bezirke</td>",
@ -307,7 +307,7 @@ def _print_as_html(df: pd.DataFrame, output_str: list[str], total: int | None =
tfoot.append(" <td></td>")
tfoot.extend(
[
f" <td>{total - df['Digitale Befragung'].sum()}</td>",
f" <td>{diff}</td>",
" </tr>",
]
)