mrtg/tmpl/cryptoReport.tmpl
2021-02-06 20:16:06 +01:00

61 lines
1.7 KiB
Cheetah

[% USE f2 = format('%.2f') %]
<html>
<head>
<style>
body {
font-family: Helvetica,Arial;
}
th {
text-align: left;
font-weight: bold;
border-bottom: 1px solid #808080;
}
td {
text-align: right;
padding: 0em 1em;
border-bottom: 1px solid #808080;
}
.gain {
font-weight: bold;
color: #f0f0f0;
background-color: #269900;
}
.loss {
font-weight: bold;
color: #f0f0f0;
background-color: #cc0000;
}
</style>
</head>
<body>
<h1>Report vom [% GENERATED %]</h1>
<h4><a href="https://mrtg.br0tkasten.de/cryptoPortfolio.html">Aktueller Report</a></h4>
<table>
[% totalProfit = 0 %]
[% FOREACH c IN DATA %]
[% gain = f2(c.CURRENT_PRICE / c.LAST_WEEK_PRICE * 100 - 100) %]
<tr>
<th><img alt="[% c.NAME %]" src="data:image/png;base64,[% c.IMAGE %]"></th>
<td>
<table style="width: 100%">
<tr><th>W&auml;hrung</th><td>[% c.NAME %] ([% c.CURRENCY %])</td></tr>
<tr><th>Kaufdatum</th><td>[% c.DATE %]</td></tr>
<tr><th>Kaufpreis</th><td>[% f2(c.BUYRATE) %] Euro/[% c.CURRENCY %]</td></tr>
<tr><th>aktueller Kurs</th><td>[% f2(c.CURRENT_PRICE) %] Euro/[% c.CURRENCY %]</td></tr>
<tr><th>aktueller Wert</th><td>[% f2(c.CURRENT_PRICE * c.COIN) %] Euro</td></tr>
<tr><th>aktueller Profit</th><td><b>[% f2((c.CURRENT_PRICE * c.COIN) - c.PRICE) %] Euro</b></td></tr>
[% IF gain > 0 %]
<tr class="gain"><td>7 Tage Gewinn</td><td>+[% gain %] %</td></tr>
[% ELSE %]
<tr class="loss"><td>7 Tage Verlust</td><td>[% gain %] %</td></tr>
[% END %]
</table>
</td>
</tr>
[% totalProfit = totalProfit + f2((c.CURRENT_PRICE * c.COIN) - c.PRICE) %]
[% END %]
</table>
<h2>Gewinn (gesamt) ca. [% totalProfit %] Euro</h2>
</body>
</html>