2024-04-27 21:10:24 +02:00
|
|
|
{{ template "widget-base.html" . }}
|
|
|
|
|
|
|
|
{{ define "widget-content" }}
|
2024-05-12 23:07:58 +02:00
|
|
|
{{ if ne .Style "dynamic-columns-experimental" }}
|
2024-04-27 21:10:24 +02:00
|
|
|
<ul class="list list-gap-20 list-with-separator">
|
2024-05-28 19:01:26 +02:00
|
|
|
{{ range .Markets }}
|
2024-04-27 21:10:24 +02:00
|
|
|
<li class="flex items-center gap-15">
|
2024-05-28 19:01:26 +02:00
|
|
|
{{ template "market" . }}
|
2024-04-27 21:10:24 +02:00
|
|
|
</li>
|
|
|
|
{{ end }}
|
|
|
|
</ul>
|
2024-05-12 23:07:58 +02:00
|
|
|
{{ else }}
|
|
|
|
<div class="dynamic-columns">
|
2024-05-28 19:01:26 +02:00
|
|
|
{{ range .Markets }}
|
2024-05-12 23:07:58 +02:00
|
|
|
<div class="flex items-center gap-15">
|
2024-05-28 19:01:26 +02:00
|
|
|
{{ template "market" . }}
|
2024-05-12 23:07:58 +02:00
|
|
|
</div>
|
|
|
|
{{ end }}
|
|
|
|
</div>
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
|
2024-05-28 19:01:26 +02:00
|
|
|
{{ define "market" }}
|
2024-05-19 19:00:08 +02:00
|
|
|
<div class="min-width-0">
|
2024-05-12 23:07:58 +02:00
|
|
|
<a{{ if ne "" .SymbolLink }} href="{{ .SymbolLink }}" target="_blank" rel="noreferrer"{{ end }} class="color-highlight size-h3 block text-truncate">{{ .Symbol }}</a>
|
|
|
|
<div class="text-truncate">{{ .Name }}</div>
|
|
|
|
</div>
|
|
|
|
|
2024-05-28 19:01:26 +02:00
|
|
|
<a class="market-chart" {{ if ne "" .ChartLink }} href="{{ .ChartLink }}" target="_blank" rel="noreferrer"{{ end }}>
|
|
|
|
<svg class="market-chart shrink-0" viewBox="0 0 100 50">
|
2024-05-12 23:07:58 +02:00
|
|
|
<polyline fill="none" stroke="var(--color-text-subdue)" stroke-width="1.5px" points="{{ .SvgChartPoints }}" vector-effect="non-scaling-stroke"></polyline>
|
|
|
|
</svg>
|
|
|
|
</a>
|
|
|
|
|
|
|
|
<div class="stock-values shrink-0">
|
|
|
|
<div class="size-h3 text-right {{ if eq .PercentChange 0.0 }}{{ else if gt .PercentChange 0.0 }}color-positive{{ else }}color-negative{{ end }}">{{ printf "%+.2f" .PercentChange }}%</div>
|
|
|
|
<div class="text-right">{{ .Currency }}{{ .Price | formatPrice }}</div>
|
|
|
|
</div>
|
2024-04-27 21:10:24 +02:00
|
|
|
{{ end }}
|