Skip to content

Commit

Permalink
💄 Update tooltips to work better with new added info
Browse files Browse the repository at this point in the history
  • Loading branch information
jh0ker committed Oct 30, 2024
1 parent 2c2aca4 commit d9c7732
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 34 deletions.
33 changes: 15 additions & 18 deletions ddj_cloud/scrapers/talsperren/tooltips/map.html
Original file line number Diff line number Diff line change
@@ -1,30 +1,27 @@
<big>
<div style="margin-bottom: 10px">
<div style="margin-bottom: 6px">
<div style="background: #f2f2f2; width: 180px; height: 22px; display: flex; align-items: center">
<div style="display:flex; background: {{ fill_percent >= 100 ? "#e30614" : fill_percent >= 90 ? "#0048a2" : fill_percent >= 75 ? "#529ddc" : fill_percent >= 50 ? "#77dbf9" : fill_percent >= 25 ? "#fcc757" : "#e30614" }}; align-items:center; height:100%; width: {{fill_percent}}%">
<span style='color: {{ fill_percent >= 90 ? "white" : fill_percent >= 75 ? "white" : fill_percent >= 50 ? "black" : fill_percent >= 25 ? "black" : "white" }}; font-weight: bold; margin: 0px 5px; margin-left: {{ fill_percent >= 25 ? "5px" : "30px" }}'> {{ FORMAT(fill_percent, '0.0')}}%{{ fill_percent >= 100 ? " &#8594; TS läuft über" : ""}}</span>
</div>
</div>
</div>
</big>

<big>{{ FORMAT(fill_percent, "0.0%") }}</big> ({{ FORMAT(content_mio_m3, "0.00") }} von {{ FORMAT(capacity_mio_m3, "0.00") }} Mio. m³)
<div style="margin-bottom:1px">({{ FORMAT(content_mio_m3, "0.00") }} von {{ FORMAT(capacity_mio_m3, "0.00") }} Mio. m³)</div>
<hr />
<p style="margin-block: 5px;">
<b>Verband:</b>
{{ federation_name == 'Wasserverband Eifel-Rur' ? CONCAT("<span style='white-space:nowrap;'>", 'Wasserverband Eifel-Rur',"</span>") : federation_name }}
</p>
<p style="margin-block: 5px;">
<b>Hauptaufgabe:</b>
{{ main_purpose }}
</p>
<p style="margin-block: 5px;">
<b>Messzeit:</b>
<span style="white-space: nowrap;">{{ FORMAT(ts_measured, "DD.MM.YY, H.mm") }}</span>
</p>
<hr />
<table>
<tr>
<td><b>Verband:</b></td>
<td>{{ federation_name }}</td>
</tr>
<tr>
<td><b>Hauptaufgabe:</b></td>
<td>{{ main_purpose }}</td>
</tr>
<tr>
<td><b>Messzeitpunkt:</b></td>
<td>{{ FORMAT(ts_measured, "DD.MM.YYYY HH:mm") }}</td>
</tr>
</table>

<big>Letzte 7 Tage</big>
<div
style="
Expand Down
30 changes: 14 additions & 16 deletions ddj_cloud/scrapers/talsperren/tooltips/map_no_graphs.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,25 @@
<big>
<div style="margin-bottom: 6px">
<div style="background: #f2f2f2; width: 100%; height: 22px; display: flex; align-items: center">
<div style="display:flex; background: {{ fill_percent >= 100 ? "#e30614" : fill_percent >= 90 ? "#0048a2" : fill_percent >= 75 ? "#529ddc" : fill_percent >= 50 ? "#77dbf9" : fill_percent >= 25 ? "#fcc757" : "#e30614" }}; align-items:center; height:100%; width: {{fill_percent}}%">
<div style="display: flex; background: {{ fill_percent >= 100 ? "#e30614" : fill_percent >= 90 ? "#0048a2" : fill_percent >= 75 ? "#529ddc" : fill_percent >= 50 ? "#77dbf9" : fill_percent >= 25 ? "#fcc757" : "#e30614" }}; align-items:center; height:100%; width: {{fill_percent}}%">
<span style='color: {{ fill_percent >= 90 ? "white" : fill_percent >= 75 ? "white" : fill_percent >= 50 ? "black" : fill_percent >= 25 ? "black" : "white" }}; font-weight: bold; margin: 0px 5px; margin-left: {{ fill_percent >= 25 ? "5px" : "30px" }}'> {{ FORMAT(fill_percent, '0.0')}}%{{ fill_percent >= 100 ? " &#8594; TS läuft über" : ""}}</span>
</div>
</div>
</div>
</big>
<div style=margin-bottom:1px'>({{ FORMAT(content_mio_m3, "0.00") }} von {{ FORMAT(capacity_mio_m3, "0.00") }} Mio. m³)</div>
<div style="margin-bottom:1px">({{ FORMAT(content_mio_m3, "0.00") }} von {{ FORMAT(capacity_mio_m3, "0.00") }} Mio. m³)</div>
</div>
<hr>
<table style= "min-width: 100%;">
<tr>
<td><b>Verband:</b></td>
<td> {{ federation_name == 'Wasserverband Eifel-Rur' ? CONCAT("<span style='white-space:nowrap;'>", 'Wasserverband Eifel-Rur',"</span>") : federation_name }} </td>
</tr>
<tr>
<td><b>Hauptaufgabe:</b></td>
<td>{{ main_purpose }}</td>
</tr>
<tr>
<td><b>Messzeit:</b></td>
<td style="white-space: nowrap;">{{ FORMAT(ts_measured, "DD.MM.YY, H.mm") }}</td>
</tr>
</table>
<p style="margin-block: 5px;">
<b>Verband:</b>
{{ federation_name == 'Wasserverband Eifel-Rur' ? CONCAT("<span style='white-space:nowrap;'>", 'Wasserverband Eifel-Rur',"</span>") : federation_name }}
</p>
<p style="margin-block: 5px;">
<b>Hauptaufgabe:</b>
{{ main_purpose }}
</p>
<p style="margin-top: 5px; margin-bottom: 0px;">
<b>Messzeit:</b>
<span style="white-space: nowrap;">{{ FORMAT(ts_measured, "DD.MM.YY, H.mm") }}</span>
</p>
</div>

0 comments on commit d9c7732

Please sign in to comment.