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

View File

@ -1,10 +1,5 @@
{% load main_extras %}
{% load i18n %}
{% if new_statement_url %}
<p>
<a href="{{ new_statement_url }}">{% translate "Create statement" %}</a>
</p>
{% endif %}
<div id="statements" class="table">
<table class="full-width {% if statements_url %}more{% endif %}">
<colgroup>
@ -28,6 +23,13 @@
<th>{% translate "Difference" %}</th>
<th>{% translate "Transactions" %}</th>
</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>
<tbody>
{% for snap in statements %}
@ -61,10 +63,14 @@
</tr>
{% endfor %}
</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>
</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 i18n %}
{% if new_transaction_url %}
<p>
<a href="{{ new_transaction_url }}">{% translate "Create transaction" %}</a>
</p>
{% endif %}
<div id="transactions" class="table">
<table class="full-width {% if transactions_url %}more{% endif %}">
<table class="full-width">
<colgroup>
<col class="icon">
<col class="date">
@ -36,6 +31,13 @@
<th colspan="2">{% translate "Account" %}</th>
{% endif %}
</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>
<tbody>
{% for trans in transactions %}
@ -77,10 +79,14 @@
</tr>
{% endfor %}
</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>
</div>
{% if transactions_url %}
<p>
<a href="{{ transactions_url }}">{% translate "View all transactions" %}</a>
</p>
{% endif %}