us-dop-api/assets/templates/components/latestprice.html.tmpl
2024-07-21 11:30:05 -04:00

38 lines
1.2 KiB
Cheetah

{{ define "latest-price" }}
<div id="container-comparer-table" class="comparer-container">
<table>
<thead>
<th> Institucion</th>
<th>Compra</th>
<th>Venta</th>
<th>Moneda</th>
<th> Aprox </th>
</thead>
<tbody>
{{ range . }}
{{ $idname := .Institution.Name | replace " " "-"}}
{{ $name := .Institution.Name | replace " dominicano" "" | replace "asociacion " "a "| replace " de ahorros y prestamos" ""| replace " cambio online" "" | replace " " "-" }}
<tr id="id-{{ $idname }}" class="comparer-row hidden">
<td><img class="compare-img img-{{ $idname }}" name="{{ $idname }}" src='/static/img/{{ $name }}.png' alt="bank logo" > </td>
<!-- <label>{{ .Institution.Name }}</label> -->
<td id="id-{{ $idname }}-compra" class="comparer compra">{{ .Compra | printf "%.2f" }}</td>
<td id="id-{{ $idname }}-venta" class="comparer venta">{{ .Venta | printf "%.2f" }}</td>
<td id="id-{{ $idname }}-cur" class="comparer currency"></td>
<td id="id-{{ $idname }}-res">0.00</td>
</tr>
{{ end }}
</tbody>
</table>
</div>
{{ end }}
{{ define "all-latest-price" }}
<!-- {{ range $idx, $obj := . }} -->
{{ template "latest-price" . }}
<!-- {{ end }} -->
{{ end }}