update data

This commit is contained in:
Arne Baeumler 2021-02-07 18:22:50 +01:00
parent 0067dfd268
commit c50b54182b

View File

@ -5,6 +5,9 @@
body { body {
font-family: Helvetica,Arial; font-family: Helvetica,Arial;
} }
table {
width: 100vw;
}
th { th {
text-align: left; text-align: left;
font-weight: bold; font-weight: bold;
@ -15,12 +18,12 @@
padding: 0em 1em; padding: 0em 1em;
border-bottom: 1px solid #808080; border-bottom: 1px solid #808080;
} }
.gain { .green {
font-weight: bold; font-weight: bold;
color: #f0f0f0; color: #303030;
background-color: #269900; background-color: #adebad;
} }
.loss { .red {
font-weight: bold; font-weight: bold;
color: #f0f0f0; color: #f0f0f0;
background-color: #cc0000; background-color: #cc0000;
@ -34,25 +37,29 @@
[% totalProfit = 0 %] [% totalProfit = 0 %]
[% FOREACH c IN DATA %] [% FOREACH c IN DATA %]
[% gain = f2(c.CURRENT_PRICE / c.LAST_WEEK_PRICE * 100 - 100) %] [% gain = f2(c.CURRENT_PRICE / c.LAST_WEEK_PRICE * 100 - 100) %]
[% cur_value = f2(c.CURRENT_PRICE * c.COIN) %]
[% cur_profit_value = f2((c.CURRENT_PRICE * c.COIN) - c.PRICE) %]
[% cur_profit_perc = f2(cur_profit_value / c.PRICE * 100) %]
<tr> <tr>
<th><img alt="[% c.NAME %]" src="data:image/png;base64,[% c.IMAGE %]"></th> <th><img alt="[% c.NAME %]" src="data:image/png;base64,[% c.IMAGE %]"></th>
<td> <td>
<table style="width: 100%"> <table style="width: 100%">
<tr><th>W&auml;hrung</th><td>[% c.NAME %] ([% c.CURRENCY %])</td></tr> <tr><th>W&auml;hrung</th><td>[% c.NAME %] ([% c.CURRENCY %])</td></tr>
<tr><th>Kaufdatum</th><td>[% c.DATE %]</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>Kaufwert</th><td>[% f2(c.PRICE) %] Euro | [% c.COIN %] [% c.CURRENCY %]</td></tr>
<tr><th>Kaufkurs</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 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 Wert</th><td>[% cur_value %] Euro</td></tr>
<tr><th>aktueller Profit</th><td><b>[% f2((c.CURRENT_PRICE * c.COIN) - c.PRICE) %] Euro</b></td></tr> <tr><th>aktueller Profit</th><td><b>[% cur_profit_value %] Euro ([% cur_profit_perc %]%)</b></td></tr>
[% IF gain > 0 %] [% IF gain > 0 %]
<tr class="gain"><td>7 Tage Gewinn</td><td>+[% gain %] %</td></tr> <tr class="green"><td>7 Tage Gewinn</td><td>+[% gain %]%</td></tr>
[% ELSE %] [% ELSE %]
<tr class="loss"><td>7 Tage Verlust</td><td>[% gain %] %</td></tr> <tr class="red"><td>7 Tage Verlust</td><td>[% gain %]%</td></tr>
[% END %] [% END %]
</table> </table>
</td> </td>
</tr> </tr>
[% totalProfit = totalProfit + f2((c.CURRENT_PRICE * c.COIN) - c.PRICE) %] [% totalProfit = totalProfit + cur_profit_value %]
[% END %] [% END %]
</table> </table>
<h2>Gewinn (gesamt) ca. [% totalProfit %] Euro</h2> <h2>Gewinn (gesamt) ca. [% totalProfit %] Euro</h2>