Move new and more links to tables

This commit is contained in:
Edgar P. Burkhart 2024-01-03 14:25:25 +01:00
parent e44e3a51f0
commit 9927cbbab4
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
3 changed files with 41 additions and 25 deletions

View file

@ -5,9 +5,6 @@ form {
table { table {
border-collapse: collapse; border-collapse: collapse;
&.more tbody:last-child tr:last-child {
border-bottom: 1px dashed var(--gray);
}
&.full-width { &.full-width {
width: 100%; width: 100%;
@ -18,7 +15,7 @@ table {
col.icon { col.icon {
width: 1ch; width: 1ch;
} }
thead { thead tr:not(.new) {
background: var(--bg-01); background: var(--bg-01);
} }
tr { tr {
@ -29,6 +26,13 @@ table {
tbody &:where(:nth-of-type(even)) { tbody &:where(:nth-of-type(even)) {
background: #eeeeff; background: #eeeeff;
} }
tfoot &.more,
thead &.new {
text-align: center;
}
tfoot &.more {
border-style: dashed;
}
} }
td, td,
th { th {

View file

@ -1,10 +1,5 @@
{% load main_extras %} {% load main_extras %}
{% load i18n %} {% load i18n %}
{% if new_statement_url %}
<p>
<a href="{{ new_statement_url }}">{% translate "Create statement" %}</a>
</p>
{% endif %}
<div id="statements" class="table"> <div id="statements" class="table">
<table class="full-width {% if statements_url %}more{% endif %}"> <table class="full-width {% if statements_url %}more{% endif %}">
<colgroup> <colgroup>
@ -28,6 +23,13 @@
<th>{% translate "Difference" %}</th> <th>{% translate "Difference" %}</th>
<th>{% translate "Transactions" %}</th> <th>{% translate "Transactions" %}</th>
</tr> </tr>
{% if new_statement_url %}
<tr class="new">
<td colspan="{% if account %}6{% else %}8{% endif %}">
<a href="{{ new_statement_url }}">{% translate "Create statement" %}</a>
</td>
</tr>
{% endif %}
</thead> </thead>
<tbody> <tbody>
{% for snap in statements %} {% for snap in statements %}
@ -61,10 +63,14 @@
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
{% if statements_url %}
<tfoot>
<tr class="more">
<td colspan="{% if account %}6{% else %}8{% endif %}">
<a href="{{ statements_url }}">{% translate "View all statements" %}</a>
</td>
</tr>
</tfoot>
{% endif %}
</table> </table>
</div> </div>
{% if statements_url %}
<p>
<a href="{{ statements_url }}">{% translate "View all statements" %}</a>
</p>
{% endif %}

View file

@ -1,12 +1,7 @@
{% load main_extras %} {% load main_extras %}
{% load i18n %} {% load i18n %}
{% if new_transaction_url %}
<p>
<a href="{{ new_transaction_url }}">{% translate "Create transaction" %}</a>
</p>
{% endif %}
<div id="transactions" class="table"> <div id="transactions" class="table">
<table class="full-width {% if transactions_url %}more{% endif %}"> <table class="full-width">
<colgroup> <colgroup>
<col class="icon"> <col class="icon">
<col class="date"> <col class="date">
@ -36,6 +31,13 @@
<th colspan="2">{% translate "Account" %}</th> <th colspan="2">{% translate "Account" %}</th>
{% endif %} {% endif %}
</tr> </tr>
{% if new_transaction_url %}
<tr class="new">
<td colspan="{% if category and account %}5{% elif category or account %}7{% else %}9{% endif %}">
<a href="{{ new_transaction_url }}">{% translate "Create transaction" %}</a>
</td>
</tr>
{% endif %}
</thead> </thead>
<tbody> <tbody>
{% for trans in transactions %} {% for trans in transactions %}
@ -77,10 +79,14 @@
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
{% if transactions_url %}
<tfoot>
<tr class="more">
<td colspan="{% if category and account %}5{% elif category or account %}7{% else %}9{% endif %}">
<a href="{{ transactions_url }}">{% translate "View all transactions" %}</a>
</td>
</tr>
</tfoot>
{% endif %}
</table> </table>
</div> </div>
{% if transactions_url %}
<p>
<a href="{{ transactions_url }}">{% translate "View all transactions" %}</a>
</p>
{% endif %}