Compare commits

...

2 Commits

Author SHA1 Message Date
Edgar P. Burkhart 0e5b8ea85d
Use :is css pseudo-class 2023-12-30 10:24:24 +01:00
Edgar P. Burkhart 715822e48f
Remove unused spaceless tags 2023-12-30 10:18:17 +01:00
3 changed files with 74 additions and 84 deletions

View File

@ -18,60 +18,58 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% 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 %}
{% ifchanged %} {% if date %}
{% if date %} <tr {% if not date.month.month|divisibleby:"2" %}class="even"{% endif %}>
<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> <th class="date" scope="row">
<th class="date" scope="row"> {% if date.has_transactions %}
{% if date.has_transactions %} {% if account %}
{% if account %} <a href="{% url "account_transaction_month" account=account.pk year=date.month.year month=date.month.month %}">{{ date.month|date:"Y-m" }}</a>
<a href="{% url "account_transaction_month" account=account.pk year=date.month.year month=date.month.month %}">{{ date.month|date:"Y-m" }}</a> {% elif category %}
{% elif category %} <a href="{% url "category_transaction_month" category=category.pk year=date.month.year month=date.month.month %}">{{ date.month|date:"Y-m" }}</a>
<a href="{% url "category_transaction_month" category=category.pk year=date.month.year month=date.month.month %}">{{ date.month|date:"Y-m" }}</a>
{% else %}
<a href="{% url "transaction_month" year=date.month.year month=date.month.month %}">{{ date.month|date:"Y-m" }}</a>
{% endif %}
{% else %} {% else %}
{{ date.month|date:"Y-m" }} <a href="{% url "transaction_month" year=date.month.year month=date.month.month %}">{{ date.month|date:"Y-m" }}</a>
{% endif %} {% endif %}
</th> {% else %}
<td class="value">{{ date.sum_m|pmrvalue }}</td> {{ date.month|date:"Y-m" }}
<td class="bar m"> {% endif %}
{% if date.sum_m %} </th>
<div style="width: {% widthratio date.sum_m history.max -100 %}%"></div> <td class="value">{{ date.sum_m|pmrvalue }}</td>
{% endif %} <td class="bar m">
{% if date.sum < 0 %} {% if date.sum_m %}
<div class="tot" style="width:{% widthratio date.sum history.max -100 %}%"> <div style="width: {% widthratio date.sum_m history.max -100 %}%"></div>
<span>{{ date.sum|pmrvalue }}</span> {% endif %}
</div> {% if date.sum < 0 %}
{% endif %} <div class="tot" style="width:{% widthratio date.sum history.max -100 %}%">
</td> <span>{{ date.sum|pmrvalue }}</span>
<td class="bar p"> </div>
{% if date.sum_p %} {% endif %}
<div style="width: {% widthratio date.sum_p history.max 100 %}%"></div> </td>
{% endif %} <td class="bar p">
{% if date.sum > 0 %} {% if date.sum_p %}
<div class="tot" style="width:{% widthratio date.sum history.max 100 %}%"> <div style="width: {% widthratio date.sum_p history.max 100 %}%"></div>
<span>{{ date.sum|pmrvalue }}</span> {% endif %}
</div> {% if date.sum > 0 %}
{% endif %} <div class="tot" style="width:{% widthratio date.sum history.max 100 %}%">
</td> <span>{{ date.sum|pmrvalue }}</span>
<td class="value">{{ date.sum_p|pmrvalue }}</td> </div>
</tr> {% endif %}
{% else %} </td>
<tr class="empty"> <td class="value">{{ date.sum_p|pmrvalue }}</td>
<td colspan="6" class="empty"></td> </tr>
</tr> {% else %}
{% endif %} <tr class="empty">
{% endifchanged %} <td colspan="6" class="empty"></td>
{% endfor %} </tr>
{% endif %}
{% endifchanged %}
{% endfor %} {% endfor %}
{% endspaceless %} {% endfor %}
</tbody> </tbody>
</table> </table>
</div> </div>
@ -95,28 +93,26 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% spaceless %} {% for year in history.years reversed %}
{% for year in history.years reversed %} <tr>
<tr> <th>{{ year.y }}</th>
<th>{{ year.y }}</th> {% for m in year.d %}
{% for m in year.d %} {% if forloop.parentloop.last and forloop.first %}
{% if forloop.parentloop.last and forloop.first %} {% for _ in history.offset.0 %}<td></td>{% endfor %}
{% for _ in history.offset.0 %}<td></td>{% endfor %} {% endif %}
{% endif %} {% if m %}
{% if m %} <td class="{% if m.sum > 0 %}p{% else %}m{% endif %}"
<td class="{% if m.sum > 0 %}p{% else %}m{% endif %}" style="opacity: calc( sin( abs({% widthratio m.sum history.years_max 100 %}) / 400 * 1turn ) )">
style="opacity: calc( sin( abs({% widthratio m.sum history.years_max 100 %}) / 400 * 1turn ) )"> </td>
</td> {% else %}
{% else %} <td></td>
<td></td> {% endif %}
{% endif %} {% if forloop.parentloop.first and forloop.last %}
{% if forloop.parentloop.first and forloop.last %} {% for _ in history.offset.1 %}<td></td>{% endfor %}
{% for _ in history.offset.1 %}<td></td>{% endfor %} {% endif %}
{% endif %} {% endfor %}
{% endfor %} </tr>
</tr> {% endfor %}
{% endfor %}
{% endspaceless %}
</tbody> </tbody>
</table> </table>
</div> </div>

View File

@ -9,9 +9,7 @@ form > table > tbody > tr > th {
background: var(--bg-01); background: var(--bg-01);
background-clip: padding-box; background-clip: padding-box;
} }
form tbody input, form tbody :is(input, select, textarea) {
form tbody select,
form tbody textarea {
font: inherit; font: inherit;
border: none; border: none;
background: transparent; background: transparent;

View File

@ -61,8 +61,7 @@ a {
text-decoration: none; text-decoration: none;
display: inline-block; display: inline-block;
} }
a:hover, a:is(:hover, :focus) {
a:focus {
text-decoration: underline; text-decoration: underline;
} }
@ -109,8 +108,7 @@ nav ul {
nav .skip-link { nav .skip-link {
font-weight: 300; font-weight: 300;
} }
nav .skip-link:active, nav .skip-link:is(:active, :focus) {
nav .skip-link:focus {
font-weight: 500; font-weight: 500;
} }
nav a { nav a {
@ -124,8 +122,7 @@ nav a.cur::after {
position: absolute; position: absolute;
right: 0; right: 0;
} }
nav > :first-child, :is(nav, main) > :first-child {
main > :first-child {
margin-top: 0; margin-top: 0;
} }
footer { footer {
@ -146,8 +143,7 @@ footer {
font-weight: 650; font-weight: 650;
text-decoration: underline dotted; text-decoration: underline dotted;
} }
.pagination a.cur:hover, .pagination a.cur:is(:hover, :focus) {
.pagination a.cur:focus {
text-decoration: underline; text-decoration: underline;
} }