Improve history plot with empty segments

This commit is contained in:
Edgar P. Burkhart 2023-12-30 10:10:53 +01:00
parent 55923e7709
commit ee4e6b7ceb
Signed by: edpibu
GPG Key ID: 9833D3C5A25BD227
3 changed files with 50 additions and 45 deletions

View File

@ -21,8 +21,9 @@
{% spaceless %} {% spaceless %}
{% for y in history.years reversed %} {% for y in history.years reversed %}
{% for date in y.d reversed %} {% for date in y.d reversed %}
{% ifchanged %}
{% if date %} {% if date %}
<tr> <tr {% if not date.month.month|divisibleby:"2" %}class="even"{% endif %}>
<td class="icon"> <td class="icon">
<span class="ri-{% if date.sum > 0 %}arrow-up-s-line green{% elif date.sum < 0 %}arrow-down-s-line red{% endif %}"></span> <span class="ri-{% if date.sum > 0 %}arrow-up-s-line green{% elif date.sum < 0 %}arrow-down-s-line red{% endif %}"></span>
</td> </td>
@ -67,6 +68,7 @@
<td colspan="6" class="empty"></td> <td colspan="6" class="empty"></td>
</tr> </tr>
{% endif %} {% endif %}
{% endifchanged %}
{% endfor %} {% endfor %}
{% endfor %} {% endfor %}
{% endspaceless %} {% endspaceless %}

View File

@ -66,6 +66,9 @@ table.full-width col.bar {
.plot tr.empty { .plot tr.empty {
height: 0.5rem; height: 0.5rem;
} }
.plot tr.even {
background: #eeeeff;
}
@media (width < 720px) { @media (width < 720px) {
.plot .bar { .plot .bar {

View File

@ -25,7 +25,7 @@ tr {
height: 2rem; height: 2rem;
line-height: 2rem; line-height: 2rem;
} }
tbody tr:nth-of-type(even) { .table tbody tr:nth-of-type(even) {
background: #eeeeff; background: #eeeeff;
} }
td, td,