Commit c0e8e04f authored by betz's avatar betz

books in tables instead list

parent 3d1dc0ed
Pipeline #42322829 passed with stages
in 1 minute and 36 seconds
......@@ -3,15 +3,14 @@
{{ range $year, $yearstats := .Site.Data.books.books }}
{{ if eq $argyear $year }}
<ul>
<table style="">
{{ range $category, $value := $yearstats }}
{{ if ne $value.in 0 }}
<li><strong>{{ $value.title }}:</strong> {{ $value.in }}€</li>
<tr><td style="padding: 0 25px 0 0"><strong>{{ $value.title }}</strong></td><td>{{ $value.in }}€</td></tr>
{{ $.Scratch.Set "total" (add ($.Scratch.Get "total") $value.in) }}
{{ end }}
{{ end }}
</ul>
<tr style="border-top: 1px solid black;"><td><strong>Total</strong></td><td><strong>{{ math.Round ($.Scratch.Get "total") }}€</strong></td></tr>
</table>
{{ end }}
{{ end }}
==> <strong>Total:</strong> {{ math.Round ($.Scratch.Get "total") }}€
\ No newline at end of file
......@@ -2,16 +2,15 @@
{{ $.Scratch.Set "total" 0 }}
{{ range $year, $yearstats := .Site.Data.books.books }}
{{ if eq $argyear $year }}
<ul>
{{ if eq $argyear $year }}
<table style="">
{{ range $category, $value := $yearstats }}
{{ if ne $value.out 0 }}
<li><strong>{{ $value.title }}:</strong> {{ $value.out }}€</li>
{{ $.Scratch.Set "total" (add ($.Scratch.Get "total") $value.out) }}
<tr><td style="padding: 0 25px 0 0"><strong>{{ $value.title }}</strong></td><td>{{ $value.out }}€</td></tr>
{{ $.Scratch.Set "total" (add ($.Scratch.Get "total") $value.out) }}
{{ end }}
{{ end }}
</ul>
<tr style="border-top: 1px solid black;"><td><strong>Total</strong></td><td><strong>{{ math.Round ($.Scratch.Get "total") }}€</strong></td></tr>
</table>
{{ end }}
{{ end }}
{{ end }}
==> <strong>Total:</strong> {{ math.Round ($.Scratch.Get "total") }}€
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment