Compare commits

..

No commits in common. "1b7cc543f003cdda796d944ad9fcf8bb9747329b" and "6ca8ca649376ed15b5b78be5a41f1e871719b806" have entirely different histories.

7 changed files with 73 additions and 116 deletions

View File

@ -1,14 +1,12 @@
table { table {
border-collapse: collapse; border-collapse: collapse;
}
table.full-width {
width: 100%; width: 100%;
} }
thead { thead {
background: var(--bg-01); background: var(--bg-01);
} }
table.full-width col {width: 8rem} col {width: 8rem}
table col.icon {width: 1ch} col.icon {width: 1ch}
tr { tr {
border: .1rem solid var(--gray); border: .1rem solid var(--gray);
height: 2rem; height: 2rem;

View File

@ -1,7 +1,7 @@
{% load main_extras %} {% load main_extras %}
{% load i18n %} {% load i18n %}
<div class="plot"> <div class="plot">
<table class="full-width"> <table>
<colgroup> <colgroup>
<col class="desc"> <col class="desc">
<col class="icon"> <col class="icon">

View File

@ -1,7 +1,7 @@
{% load main_extras %} {% load main_extras %}
{% load i18n %} {% load i18n %}
<div class="plot"> <div class="plot">
<table class="full-width"> <table>
<colgroup> <colgroup>
<col class="desc"> <col class="desc">
<col class="value"> <col class="value">

View File

@ -1,36 +0,0 @@
{% load main_extras %}
{% load i18n %}
<div id="invoices">
<table>
<colgroup>
<col class="desc" span="3">
</colgroup>
<thead>
<th>{% translate "Name" %}</th>
<th>{% translate "File" %}</th>
<th>{% translate "Delete" %}</th>
</thead>
<tbody>
{% for invoice in transaction.invoices %}
<tr>
<th scope="row" class="l">
<a href="{{ invoice.get_absolute_url }}">{{ invoice.name }}</a>
</th>
<td>
<a href="{{ invoice.file.url }}">{% translate "File" %}</a>
</td>
<td>
<a href="{{ invoice.get_delete_url }}">{% translate "Delete" %}
</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<td colspan="3">
<a href="{% url "invoice" transaction.pk %}">{% translate "New invoice" %}</a>
</td>
</tr>
</tfoot>
</table>
</div>

View File

@ -1,74 +1,56 @@
{% load main_extras %} {% load main_extras %}
{% load i18n %} {% load i18n %}
<div id="snapshots"> <div id="snapshots"
<table class="full-width"> class="table {% if account %}col2-4{% else %}col2-5{% endif %}">
<colgroup> <div class="header">
<col class="icon" span="2"> <strong class="diff center"><i class="fa fa-check"></i></strong>
<col class="date"> <strong class="attach center"><i class="fa fa-paperclip"></i></strong>
<strong class="date center">{% translate "Date" %}</strong>
{% if not account %} {% if not account %}
<col class="icon"> <strong class="account center">{% translate "Account" %}</strong>
<col class="desc">
{% endif %} {% endif %}
<col class="value" span="3"> <strong class="value center">{% translate "Value" %}</strong>
</colgroup> <strong class="diff center">{% translate "Difference" %}</strong>
<thead> <strong class="diff center">{% translate "Transactions" %}</strong>
<th>
<i class="fa fa-check"></i>
</th>
<th>
<i class="fa fa-paperclip"></i>
</th>
<th>{% translate "Date" %}</th>
{% if not account %}
<th colspan="2">{% translate "Account" %}</th>
{% endif %}
<th>{% translate "Value" %}</th>
<th>{% translate "Difference" %}</th>
<th>{% translate "Transactions" %}</th>
</thead>
<tbody>
{% for snap in snapshots %}
<tr>
<td class="c">
<i class="fa fa-{% if snap.sum == snap.diff %}check green{% else %}xmark red{% endif %}"></i>
</td>
<td class="c">
{% if snap.file %}
<a href="{{ snap.file.url }}">
<i class="fa fa-paperclip"></i>
</a>
{% endif %}
</td>
<th class="date" scope="row">
<a href="{% url "snapshot" pk=snap.id %}">{{ snap.date|date:"Y-m-d" }}</a>
</th>
{% if not account %}
<td class="r">
<i class="fa fa-{{ snap.account.icon }}"></i>
</td>
<td>
<a href="{% url "account" pk=snap.account.id %}">{{ snap.account }}</a>
</td>
<td class="value">{{ snap.value|value }}</td>
<td class="value">{{ snap.diff|pmvalue }}</td>
<td class="value">{{ snap.sum|pmvalue }}</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
</div> </div>
{% comment %}
<div id="snapshots" class="table {% if account %}col2-4{% else %}col2-5{% endif %}">
{% if new_snapshot_url %} {% if new_snapshot_url %}
<div class="full-line"> <div class="full-line">
<a href="{{ new_snapshot_url }}">{% translate "New statement" %}</a> <a href="{{ new_snapshot_url }}">{% translate "New statement" %}</a>
</div> </div>
{% endif %} {% endif %}
{% for snap in snapshots %}
<div class="snapshot">
<span class="valid center">
{% if snap.sum == snap.diff %}
<i class="fa fa-check green"></i>
{% else %}
<i class="fa fa-xmark red"></i>
{% endif %}
</span>
<span class="attach center">
{% if snap.file %}
<a href="{{ snap.file.url }}">
<i class="fa fa-paperclip"></i>
</a>
{% endif %}
</span>
<span class="date num center">
<a href="{% url 'snapshot' pk=snap.id %}">{{ snap.date|date:"Y-m-d" }}</a>
</span>
{% if not account %}
<span class="account text center">
<i class="fa fa-{{ snap.account.icon }}"></i>
<a href="{% url 'account' pk=snap.account.id %}">{{ snap.account }}</a>
</span>
{% endif %}
<span class="value num right">{{ snap.value|value }}</span>
<span class="diff num right">{{ snap.diff|pmvalue }}</span>
<span class="sum num right">{{ snap.sum|pmvalue }}</span>
</div>
{% endfor %}
{% if snapshots_url %} {% if snapshots_url %}
<div class="full-line"> <div class="full-line">
<a href="{{ snapshots_url }}">{% translate "View all statements" %}</a> <a href="{{ snapshots_url }}">{% translate "View all statements" %}</a>
</div> </div>
{% endif %} {% endif %}
</div> </div>
{% endcomment %}

View File

@ -1,21 +1,17 @@
{% load main_extras %} {% load main_extras %}
{% load i18n %} {% load i18n %}
<div id="transactions"> <div id="transactions">
<table class="full-width"> <table>
<colgroup> <colgroup>
<col class="icon"> <col class="icon c">
<col class="date"> <col class="date">
<col class="desc"> <col class="desc">
<col class="value"> <col class="value">
<col class="desc"> <col class="desc">
{% if not category %}
<col class="icon"> <col class="icon">
<col class="desc"> <col class="desc">
{% endif %}
{% if not account %}
<col class="icon"> <col class="icon">
<col class="desc"> <col class="desc">
{% endif %}
</colgroup> </colgroup>
<thead> <thead>
<th> <th>
@ -54,7 +50,7 @@
<i class="fa fa-{{ trans.category.icon }}"></i> <i class="fa fa-{{ trans.category.icon }}"></i>
</td> </td>
<td> <td>
<a href="{% url "category" pk=trans.category.id %}">{{ trans.category }}</a> <a href="{% url 'category' pk=trans.category.id %}">{{ trans.category }}</a>
</td> </td>
{% else %} {% else %}
<td class="c" colspan="2"></td> <td class="c" colspan="2"></td>
@ -66,7 +62,7 @@
<i class="fa fa-{{ trans.account.icon }}"></i> <i class="fa fa-{{ trans.account.icon }}"></i>
</td> </td>
<td> <td>
<a href="{% url "account" pk=trans.account.id %}">{{ trans.account }}</a> <a href="{% url 'account' pk=trans.account.id %}">{{ trans.account }}</a>
</td> </td>
{% endif %} {% endif %}
</tr> </tr>

View File

@ -22,6 +22,23 @@
{% endspaceless %} {% endspaceless %}
{% if not form.instance.adding %} {% if not form.instance.adding %}
<h2>{% translate "Invoices" %}</h2> <h2>{% translate "Invoices" %}</h2>
{% include "main/table/invoice.html" %} <div id="invoices" class="table col1-1-1">
<div class="header">
<strong class="attach center"><i class="fa fa-file"></i></strong>
<strong class="name">{% translate "Name" %}</strong>
<strong class="attach right"><i class="fa fa-trash-can"></i></strong>
</div>
{% for inv in transaction.invoices %}
<div class="invoice">
<a href="{{ inv.file.url }}" class="center"><i class="fa-regular fa-file"></i></a>
<a href="{{ inv.get_absolute_url }}">{{ inv.name }}</a>
<a href="{{ inv.get_delete_url }}" class="right">{% translate "Delete" %}</a>
</div>
{% endfor %}
<div class="invoice new">
<span class="center"><i class="fa fa-file-circle-plus"></i></span>
<a href="{% url "invoice" transaction.pk %}">{% translate "New invoice" %}</a>
</div>
</div>
{% endif %} {% endif %}
{% endblock %} {% endblock %}