Compare commits
No commits in common. "218a6aca6f340fe4baf24486a0f7b0d7bf81b6f7" and "b0716a65b72838e8d7f56318727a4af93a68364b" have entirely different histories.
218a6aca6f
...
b0716a65b7
15 changed files with 74 additions and 151 deletions
Binary file not shown.
|
@ -7,7 +7,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: \n"
|
"Project-Id-Version: \n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2024-01-04 16:04+0100\n"
|
"POT-Creation-Date: 2024-01-02 15:52+0100\n"
|
||||||
"PO-Revision-Date: 2023-04-22 15:17+0200\n"
|
"PO-Revision-Date: 2023-04-22 15:17+0200\n"
|
||||||
"Last-Translator: Edgar P. Burkhart <traduction@edgarpierre.fr>\n"
|
"Last-Translator: Edgar P. Burkhart <traduction@edgarpierre.fr>\n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
|
@ -37,22 +37,6 @@ msgstr "Défaut"
|
||||||
msgid "Accounts"
|
msgid "Accounts"
|
||||||
msgstr "Comptes"
|
msgstr "Comptes"
|
||||||
|
|
||||||
#: .\account\templates\account\account_detail.html:15
|
|
||||||
msgid "Edit account"
|
|
||||||
msgstr "Modifier le compte"
|
|
||||||
|
|
||||||
#: .\account\templates\account\account_detail.html:17
|
|
||||||
msgid "Statements"
|
|
||||||
msgstr "Relevés"
|
|
||||||
|
|
||||||
#: .\account\templates\account\account_detail.html:21
|
|
||||||
msgid "Transactions"
|
|
||||||
msgstr "Transactions"
|
|
||||||
|
|
||||||
#: .\account\templates\account\account_detail.html:26
|
|
||||||
msgid "History"
|
|
||||||
msgstr "Historique"
|
|
||||||
|
|
||||||
#: .\account\templates\account\account_form.html:5
|
#: .\account\templates\account\account_form.html:5
|
||||||
msgid "Create account"
|
msgid "Create account"
|
||||||
msgstr "Créer un compte"
|
msgstr "Créer un compte"
|
||||||
|
@ -60,3 +44,15 @@ msgstr "Créer un compte"
|
||||||
#: .\account\templates\account\account_form.html:8
|
#: .\account\templates\account\account_form.html:8
|
||||||
msgid "New account"
|
msgid "New account"
|
||||||
msgstr "Nouveau compte"
|
msgstr "Nouveau compte"
|
||||||
|
|
||||||
|
#: .\account\templates\account\account_form.html:14
|
||||||
|
msgid "Statements"
|
||||||
|
msgstr "Relevés"
|
||||||
|
|
||||||
|
#: .\account\templates\account\account_form.html:18
|
||||||
|
msgid "Transactions"
|
||||||
|
msgstr "Transactions"
|
||||||
|
|
||||||
|
#: .\account\templates\account\account_form.html:23
|
||||||
|
msgid "History"
|
||||||
|
msgstr "Historique"
|
||||||
|
|
|
@ -1,30 +0,0 @@
|
||||||
{% extends "main/base.html" %}
|
|
||||||
{% load main_extras %}
|
|
||||||
{% load i18n %}
|
|
||||||
{% block title %}{{ object }} – {{ block.super }}{% endblock %}
|
|
||||||
{% block link %}
|
|
||||||
{{ block.super }}
|
|
||||||
{% css "main/css/form.css" %}
|
|
||||||
{% css "main/css/table.css" %}
|
|
||||||
{% css "main/css/plot.css" %}
|
|
||||||
{% endblock %}
|
|
||||||
{% block body %}
|
|
||||||
<h2>{{ object.icon|remix }}{{ object }}</h2>
|
|
||||||
<p>
|
|
||||||
<a href="{% url "edit_account" object.pk %}">{% translate "Edit account" %}</a>
|
|
||||||
</p>
|
|
||||||
<section>
|
|
||||||
<h3>{% translate "Statements" %}</h3>
|
|
||||||
{% include "statement/statement_table.html" %}
|
|
||||||
</section>
|
|
||||||
<section>
|
|
||||||
<h3>{% translate "Transactions" %}</h3>
|
|
||||||
{% include "transaction/transaction_table.html" %}
|
|
||||||
</section>
|
|
||||||
{% if history %}
|
|
||||||
<section>
|
|
||||||
<h3>{% translate "History" %}</h3>
|
|
||||||
{% include "history/plot.html" %}
|
|
||||||
</section>
|
|
||||||
{% endif %}
|
|
||||||
{% endblock %}
|
|
|
@ -8,3 +8,21 @@
|
||||||
{% translate "New account" %}
|
{% translate "New account" %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block h2 %}{{ form.instance.icon|remix }}{{ form.instance }}{% endblock %}
|
{% block h2 %}{{ form.instance.icon|remix }}{{ form.instance }}{% endblock %}
|
||||||
|
{% block tables %}
|
||||||
|
{% if not form.instance|adding %}
|
||||||
|
<section>
|
||||||
|
<h3>{% translate "Statements" %}</h3>
|
||||||
|
{% include "statement/statement_table.html" %}
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<h3>{% translate "Transactions" %}</h3>
|
||||||
|
{% include "transaction/transaction_table.html" %}
|
||||||
|
</section>
|
||||||
|
{% if history %}
|
||||||
|
<section>
|
||||||
|
<h3>{% translate "History" %}</h3>
|
||||||
|
{% include "history/plot.html" %}
|
||||||
|
</section>
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
{% endblock %}
|
||||||
|
|
|
@ -6,8 +6,7 @@ from . import views
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path("new", views.AccountCreateView.as_view(), name="new_account"),
|
path("new", views.AccountCreateView.as_view(), name="new_account"),
|
||||||
path("<account>", views.AccountDetailView.as_view(), name="account"),
|
path("<account>", views.AccountUpdateView.as_view(), name="account"),
|
||||||
path("<account>/edit", views.AccountUpdateView.as_view(), name="edit_account"),
|
|
||||||
path(
|
path(
|
||||||
"<account>/transactions",
|
"<account>/transactions",
|
||||||
views.AccountTListView.as_view(),
|
views.AccountTListView.as_view(),
|
||||||
|
|
|
@ -1,12 +1,7 @@
|
||||||
from django.shortcuts import get_object_or_404
|
from django.shortcuts import get_object_or_404
|
||||||
from django.urls import reverse_lazy
|
from django.urls import reverse_lazy
|
||||||
from history.utils import history
|
from history.utils import history
|
||||||
from main.views import (
|
from main.views import NummiCreateView, NummiDeleteView, NummiUpdateView
|
||||||
NummiCreateView,
|
|
||||||
NummiDeleteView,
|
|
||||||
NummiDetailView,
|
|
||||||
NummiUpdateView,
|
|
||||||
)
|
|
||||||
from statement.views import StatementListView
|
from statement.views import StatementListView
|
||||||
from transaction.views import TransactionListView
|
from transaction.views import TransactionListView
|
||||||
|
|
||||||
|
@ -55,36 +50,6 @@ class AccountDeleteView(NummiDeleteView):
|
||||||
pk_url_kwarg = "account"
|
pk_url_kwarg = "account"
|
||||||
|
|
||||||
|
|
||||||
class AccountDetailView(NummiDetailView):
|
|
||||||
model = Account
|
|
||||||
pk_url_kwarg = "account"
|
|
||||||
|
|
||||||
def get_context_data(self, **kwargs):
|
|
||||||
_max = 8
|
|
||||||
data = super().get_context_data(**kwargs)
|
|
||||||
account = data.get("object")
|
|
||||||
|
|
||||||
_transactions = account.transaction_set.all()
|
|
||||||
if _transactions.count() > _max:
|
|
||||||
data["transactions_url"] = reverse_lazy(
|
|
||||||
"account_transactions", args=(account.pk,)
|
|
||||||
)
|
|
||||||
_statements = account.statement_set.all()
|
|
||||||
if _statements.count() > _max:
|
|
||||||
data["statements_url"] = reverse_lazy(
|
|
||||||
"account_statements", args=(account.pk,)
|
|
||||||
)
|
|
||||||
|
|
||||||
return data | {
|
|
||||||
"transactions": _transactions[:8],
|
|
||||||
"new_statement_url": reverse_lazy(
|
|
||||||
"new_statement", kwargs={"account": account.pk}
|
|
||||||
),
|
|
||||||
"statements": _statements[:8],
|
|
||||||
"history": history(account.transaction_set),
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
class AccountMixin:
|
class AccountMixin:
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
self.account = get_object_or_404(
|
self.account = get_object_or_404(
|
||||||
|
|
|
@ -70,7 +70,7 @@
|
||||||
{% 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: {% calendar_opacity m.sum history.max.sum %}"
|
style="background-color: color-mix(in hsl, currentcolor {% calendar_opacity m.sum history.max.sum %}, white)"
|
||||||
title="{{ m.sum|pmrvalue }}">{% up_down_icon m.sum %}</td>
|
title="{{ m.sum|pmrvalue }}">{% up_down_icon m.sum %}</td>
|
||||||
{% else %}
|
{% else %}
|
||||||
<td></td>
|
<td></td>
|
||||||
|
|
|
@ -30,11 +30,11 @@ def empty_calendar_cells_end(n):
|
||||||
@register.simple_tag
|
@register.simple_tag
|
||||||
def up_down_icon(val):
|
def up_down_icon(val):
|
||||||
if val > 0:
|
if val > 0:
|
||||||
return remix("arrow-up-s", "green")
|
return remix("arrow-up-s", "green w")
|
||||||
elif val < 0:
|
elif val < 0:
|
||||||
return remix("arrow-down-s", "red")
|
return remix("arrow-down-s", "red w")
|
||||||
|
|
||||||
return remix("equal", "white")
|
return ""
|
||||||
|
|
||||||
|
|
||||||
@register.simple_tag
|
@register.simple_tag
|
||||||
|
|
Binary file not shown.
|
@ -7,7 +7,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: \n"
|
"Project-Id-Version: \n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2024-01-04 16:04+0100\n"
|
"POT-Creation-Date: 2024-01-03 15:51+0100\n"
|
||||||
"PO-Revision-Date: 2023-04-23 08:03+0200\n"
|
"PO-Revision-Date: 2023-04-23 08:03+0200\n"
|
||||||
"Last-Translator: Edgar P. Burkhart <traduction@edgarpierre.fr>\n"
|
"Last-Translator: Edgar P. Burkhart <traduction@edgarpierre.fr>\n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
|
@ -37,21 +37,37 @@ msgstr "Relevés"
|
||||||
msgid "Transactions"
|
msgid "Transactions"
|
||||||
msgstr "Transactions"
|
msgstr "Transactions"
|
||||||
|
|
||||||
#: .\main\templates\main\base.html:51 .\main\templates\main\list.html:10
|
#: .\main\templates\main\base.html:51 .\main\templates\main\index.html:39
|
||||||
|
msgid "Create account"
|
||||||
|
msgstr "Créer un compte"
|
||||||
|
|
||||||
|
#: .\main\templates\main\base.html:56
|
||||||
|
msgid "Create statement"
|
||||||
|
msgstr "Créer un relevé"
|
||||||
|
|
||||||
|
#: .\main\templates\main\base.html:61
|
||||||
|
msgid "Create category"
|
||||||
|
msgstr "Créer une catégorie"
|
||||||
|
|
||||||
|
#: .\main\templates\main\base.html:66
|
||||||
|
msgid "Create transaction"
|
||||||
|
msgstr "Créer une transaction"
|
||||||
|
|
||||||
|
#: .\main\templates\main\base.html:71 .\main\templates\main\list.html:10
|
||||||
#: .\main\templates\main\list.html:34
|
#: .\main\templates\main\list.html:34
|
||||||
msgid "Search"
|
msgid "Search"
|
||||||
msgstr "Rechercher"
|
msgstr "Rechercher"
|
||||||
|
|
||||||
#: .\main\templates\main\base.html:54
|
#: .\main\templates\main\base.html:74
|
||||||
msgid "Log out"
|
msgid "Log out"
|
||||||
msgstr "Se déconnecter"
|
msgstr "Se déconnecter"
|
||||||
|
|
||||||
#: .\main\templates\main\base.html:59 .\main\templates\main\form\login.html:6
|
#: .\main\templates\main\base.html:79 .\main\templates\main\form\login.html:6
|
||||||
#: .\main\templates\main\login.html:11
|
#: .\main\templates\main\login.html:11
|
||||||
msgid "Log in"
|
msgid "Log in"
|
||||||
msgstr "Se connecter"
|
msgstr "Se connecter"
|
||||||
|
|
||||||
#: .\main\templates\main\base.html:65
|
#: .\main\templates\main\base.html:85
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "Logged in as <strong>%(user)s</strong>"
|
msgid "Logged in as <strong>%(user)s</strong>"
|
||||||
msgstr "Connecté en tant que <strong>%(user)s</strong>"
|
msgstr "Connecté en tant que <strong>%(user)s</strong>"
|
||||||
|
@ -101,39 +117,22 @@ msgstr "Compte"
|
||||||
msgid "Balance"
|
msgid "Balance"
|
||||||
msgstr "Solde"
|
msgstr "Solde"
|
||||||
|
|
||||||
#: .\main\templates\main\index.html:19 .\main\templates\main\index.html:30
|
#: .\main\templates\main\index.html:32
|
||||||
msgid "Edit"
|
|
||||||
msgstr "Modifier"
|
|
||||||
|
|
||||||
#: .\main\templates\main\index.html:34
|
|
||||||
msgid "No account"
|
msgid "No account"
|
||||||
msgstr "Aucun compte"
|
msgstr "Aucun compte"
|
||||||
|
|
||||||
#: .\main\templates\main\index.html:41
|
#: .\main\templates\main\index.html:47
|
||||||
msgid "Create account"
|
|
||||||
msgstr "Créer un compte"
|
|
||||||
|
|
||||||
#: .\main\templates\main\index.html:48
|
|
||||||
msgid "Categories"
|
msgid "Categories"
|
||||||
msgstr "Catégories"
|
msgstr "Catégories"
|
||||||
|
|
||||||
#: .\main\templates\main\index.html:54
|
#: .\main\templates\main\index.html:53
|
||||||
msgid "Create category"
|
msgid "No category"
|
||||||
msgstr "Créer une catégorie"
|
msgstr "Aucune catégorie"
|
||||||
|
|
||||||
#: .\main\templates\main\index.html:61
|
#: .\main\templates\main\index.html:62
|
||||||
msgid "History"
|
msgid "History"
|
||||||
msgstr "Historique"
|
msgstr "Historique"
|
||||||
|
|
||||||
#: .\main\views.py:69
|
#: .\main\views.py:68
|
||||||
msgid "was created successfully"
|
msgid "was created successfully"
|
||||||
msgstr "a été créé avec succès"
|
msgstr "a été créé avec succès"
|
||||||
|
|
||||||
#~ msgid "Create statement"
|
|
||||||
#~ msgstr "Créer un relevé"
|
|
||||||
|
|
||||||
#~ msgid "Create transaction"
|
|
||||||
#~ msgstr "Créer une transaction"
|
|
||||||
|
|
||||||
#~ msgid "No category"
|
|
||||||
#~ msgstr "Aucune catégorie"
|
|
||||||
|
|
|
@ -9,7 +9,6 @@ form {
|
||||||
> table > tbody > tr > th {
|
> table > tbody > tr > th {
|
||||||
background: var(--bg-01);
|
background: var(--bg-01);
|
||||||
background-clip: padding-box;
|
background-clip: padding-box;
|
||||||
border-right: 1px solid var(--gray);
|
|
||||||
}
|
}
|
||||||
tbody :is(input, select, textarea) {
|
tbody :is(input, select, textarea) {
|
||||||
font: inherit;
|
font: inherit;
|
||||||
|
|
|
@ -232,27 +232,18 @@ footer {
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
|
|
||||||
&.green,
|
&.green,
|
||||||
&.red,
|
&.red {
|
||||||
&.white {
|
color: white;
|
||||||
&.green {
|
&.green {
|
||||||
background: var(--green);
|
background: var(--green);
|
||||||
color: var(--bg);
|
|
||||||
}
|
}
|
||||||
&.red {
|
&.red {
|
||||||
background: var(--red);
|
background: var(--red);
|
||||||
color: var(--bg);
|
|
||||||
}
|
|
||||||
&.white {
|
|
||||||
background: var(--bg-01);
|
|
||||||
}
|
}
|
||||||
border-radius: var(--radius);
|
border-radius: var(--radius);
|
||||||
height: 1.5em;
|
height: 1.5rem;
|
||||||
width: 1.5em;
|
width: 1.5rem;
|
||||||
line-height: 1.5em;
|
line-height: 1.5rem;
|
||||||
}
|
|
||||||
|
|
||||||
h2 & {
|
|
||||||
margin-right: 0.5em;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -101,16 +101,11 @@ table.full-width col.bar {
|
||||||
|
|
||||||
td {
|
td {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
background-color: color-mix(
|
|
||||||
in hsl,
|
|
||||||
var(--td-bg, var(--bg)) var(--opacity),
|
|
||||||
var(--bg)
|
|
||||||
);
|
|
||||||
&.p {
|
&.p {
|
||||||
--td-bg: var(--green);
|
color: var(--green);
|
||||||
}
|
}
|
||||||
&.m {
|
&.m {
|
||||||
--td-bg: var(--red);
|
color: var(--red);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="2">{% translate "Account" %}</th>
|
<th colspan="2">{% translate "Account" %}</th>
|
||||||
<th>{% translate "Balance" %}</th>
|
<th>{% translate "Balance" %}</th>
|
||||||
<th>{% translate "Edit" %}</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
@ -27,19 +26,16 @@
|
||||||
<a href="{{ acc.get_absolute_url }}">{{ acc }}</a>
|
<a href="{{ acc.get_absolute_url }}">{{ acc }}</a>
|
||||||
</th>
|
</th>
|
||||||
<td class="value">{{ acc.statement_set.first.value|value }}</td>
|
<td class="value">{{ acc.statement_set.first.value|value }}</td>
|
||||||
<td>
|
|
||||||
<a href="{% url "edit_account" acc.pk %}">{% translate "Edit" %}</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
{% empty %}
|
{% empty %}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="empty" colspan="4">{% translate "No account" %}</td>
|
<td class="empty" colspan="3">{% translate "No account" %}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
<tfoot>
|
<tfoot>
|
||||||
<tr class="new">
|
<tr class="new">
|
||||||
<td colspan="4">
|
<td colspan="3">
|
||||||
<a href="{% url "new_account" %}">{% translate "Create account" %}</a>
|
<a href="{% url "new_account" %}">{% translate "Create account" %}</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -9,7 +9,6 @@ from django.utils.translation import gettext as _
|
||||||
from django.views.generic import (
|
from django.views.generic import (
|
||||||
CreateView,
|
CreateView,
|
||||||
DeleteView,
|
DeleteView,
|
||||||
DetailView,
|
|
||||||
ListView,
|
ListView,
|
||||||
TemplateView,
|
TemplateView,
|
||||||
UpdateView,
|
UpdateView,
|
||||||
|
@ -77,10 +76,6 @@ class NummiUpdateView(UserMixin, UpdateView):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class NummiDetailView(UserMixin, DetailView):
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
class NummiDeleteView(UserMixin, DeleteView):
|
class NummiDeleteView(UserMixin, DeleteView):
|
||||||
template_name = "main/confirm_delete.html"
|
template_name = "main/confirm_delete.html"
|
||||||
success_url = reverse_lazy("index")
|
success_url = reverse_lazy("index")
|
||||||
|
|
Loading…
Reference in a new issue