Update layout

Modified navbar content
Moved categories up on homepage
Load all snapshots on homepage
Load 64 transactions per page
This commit is contained in:
Edgar P. Burkhart 2022-12-21 09:18:47 +01:00
parent b090902648
commit 495c64fcdc
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
6 changed files with 29 additions and 47 deletions

View file

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: 0.0.1\n" "Project-Id-Version: 0.0.1\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-12-20 15:28+0100\n" "POT-Creation-Date: 2022-12-21 09:08+0100\n"
"PO-Revision-Date: 2022-05-30 19:00+0200\n" "PO-Revision-Date: 2022-05-30 19:00+0200\n"
"Last-Translator: edpibu <git@edgarpierre.fr>\n" "Last-Translator: edpibu <git@edgarpierre.fr>\n"
"Language-Team: edpibu <git@edgarpierre.fr>\n" "Language-Team: edpibu <git@edgarpierre.fr>\n"
@ -17,7 +17,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: .\models.py:12 .\models.py:22 .\models.py:56 #: .\models.py:12 .\models.py:22 .\models.py:56 .\templates\main\base.html:35
#: .\templates\main\tag\transaction_table.html:10 #: .\templates\main\tag\transaction_table.html:10
msgid "Category" msgid "Category"
msgstr "Catégorie" msgstr "Catégorie"
@ -35,12 +35,12 @@ msgstr "Icône"
msgid "Budget" msgid "Budget"
msgstr "Budget" msgstr "Budget"
#: .\models.py:23 .\templates\main\index.html:57 #: .\models.py:23 .\templates\main\index.html:19
#: .\templates\main\snapshot.html:33 #: .\templates\main\snapshot.html:33
msgid "Categories" msgid "Categories"
msgstr "Catégories" msgstr "Catégories"
#: .\models.py:37 .\models.py:64 #: .\models.py:37 .\models.py:64 .\templates\main\base.html:30
msgid "Transaction" msgid "Transaction"
msgstr "Transaction" msgstr "Transaction"
@ -48,12 +48,12 @@ msgstr "Transaction"
msgid "Description" msgid "Description"
msgstr "Description" msgstr "Description"
#: .\models.py:41 .\models.py:122 .\templates\main\index.html:23 #: .\models.py:41 .\models.py:122 .\templates\main\index.html:32
#: .\templates\main\tag\transaction_table.html:8 #: .\templates\main\tag\transaction_table.html:8
msgid "Value" msgid "Value"
msgstr "Valeur" msgstr "Valeur"
#: .\models.py:43 .\models.py:120 .\templates\main\index.html:22 #: .\models.py:43 .\models.py:120 .\templates\main\index.html:31
#: .\templates\main\tag\transaction_table.html:6 #: .\templates\main\tag\transaction_table.html:6
msgid "Date" msgid "Date"
msgstr "Date" msgstr "Date"
@ -70,10 +70,9 @@ msgstr "Commerçant"
msgid "Payment" msgid "Payment"
msgstr "Paiement" msgstr "Paiement"
#: .\models.py:65 .\templates\main\base.html:30 #: .\models.py:65 .\templates\main\category.html:24
#: .\templates\main\category.html:22 .\templates\main\index.html:14 #: .\templates\main\index.html:14 .\templates\main\index.html:34
#: .\templates\main\index.html:25 .\templates\main\snapshot.html:87 #: .\templates\main\snapshot.html:87 .\templates\main\transactions.html:13
#: .\templates\main\transactions.html:13
msgid "Transactions" msgid "Transactions"
msgstr "Transactions" msgstr "Transactions"
@ -89,31 +88,19 @@ msgstr "Fichier"
msgid "Invoices" msgid "Invoices"
msgstr "Factures" msgstr "Factures"
#: .\models.py:230 #: .\models.py:230 .\templates\main\base.html:40
msgid "Snapshot" msgid "Snapshot"
msgstr "Relevé" msgstr "Relevé"
#: .\models.py:231 .\templates\main\index.html:19 #: .\models.py:231 .\templates\main\index.html:28
msgid "Snapshots" msgid "Snapshots"
msgstr "Relevés" msgstr "Relevés"
#: .\templates\main\base.html:35 #: .\templates\main\index.html:33
msgid "New transaction"
msgstr "Nouvelle transaction"
#: .\templates\main\base.html:40
msgid "New category"
msgstr "Nouvelle catégorie"
#: .\templates\main\base.html:45
msgid "New snapshot"
msgstr "Nouveau relevé"
#: .\templates\main\index.html:24
msgid "Difference" msgid "Difference"
msgstr "Différence" msgstr "Différence"
#: .\templates\main\index.html:26 #: .\templates\main\index.html:35
msgid "Valid" msgid "Valid"
msgstr "Valide" msgstr "Valide"

View file

@ -24,25 +24,20 @@
accesskey="h"> accesskey="h">
<img src="{% static 'main/svg/logo.svg' %}" alt="" />Nummi <img src="{% static 'main/svg/logo.svg' %}" alt="" />Nummi
</a> </a>
<a href="{% url 'transactions' %}"
class="{% if request.resolver_match.url_name == 'transactions' %}cur{% endif %}"
accesskey="t">
{% translate "Transactions" %}
</a>
<a href="{% url 'transaction' %}" <a href="{% url 'transaction' %}"
class="{% if request.resolver_match.url_name == 'transaction' %}cur{% endif %}" class="{% if request.resolver_match.url_name == 'transaction' %}cur{% endif %}"
accesskey="n"> accesskey="n">
{% translate "New transaction" %} {% translate "Transaction" %}
</a> </a>
<a href="{% url 'category' %}" <a href="{% url 'category' %}"
class="{% if request.resolver_match.url_name == 'category' %}cur{% endif %}" class="{% if request.resolver_match.url_name == 'category' %}cur{% endif %}"
accesskey="c"> accesskey="c">
{% translate "New category" %} {% translate "Category" %}
</a> </a>
<a href="{% url 'snapshot' %}" <a href="{% url 'snapshot' %}"
class="{% if request.resolver_match.url_name == 'snapshot' %}cur{% endif %}" class="{% if request.resolver_match.url_name == 'snapshot' %}cur{% endif %}"
accesskey="s"> accesskey="s">
{% translate "New snapshot" %} {% translate "Snapshot" %}
</a> </a>
<a href="{% url 'logout' %}" <a href="{% url 'logout' %}"
class="logout" class="logout"

View file

@ -18,9 +18,9 @@
{% form_buttons category %} {% form_buttons category %}
</form> </form>
{% if transactions %}
<img src="{% url "plot-category" category.id %}" alt="Graph representing value over time" /> <img src="{% url "plot-category" category.id %}" alt="Graph representing value over time" />
{% if transactions %}
<h2>{% translate "Transactions" %}</h2> <h2>{% translate "Transactions" %}</h2>
{% transaction_table transactions %} {% transaction_table transactions %}
{% endif %} {% endif %}

View file

@ -11,10 +11,19 @@
{% block body %} {% block body %}
{% if transactions %} {% if transactions %}
<h2>{% translate "Transactions" %}</h2> <h2>{% translate "Transactions" %} <a href="{% url "transactions" %}"><i class="fa fa-magnifying-glass-plus"></i></a></h2>
{% transaction_table transactions %} {% transaction_table transactions %}
{% endif %} {% endif %}
{% if categories %}
<h2>{% translate "Categories" %}</h2>
<div id="categories">
{% for cat in categories %}
<a href="{% url 'category' cat.id %}"><i class="fa fa-{{ cat.icon }}"></i>{{ cat }}</a>
{% endfor %}
</div>
{% endif %}
{% if snapshots %} {% if snapshots %}
<h2>{% translate "Snapshots" %}</h2> <h2>{% translate "Snapshots" %}</h2>
<div id="snapshots" class="table col5"> <div id="snapshots" class="table col5">
@ -53,13 +62,4 @@
</div> </div>
{% endif %} {% endif %}
{% if categories %}
<h2>{% translate "Categories" %}</h2>
<div id="categories">
{% for cat in categories %}
<a href="{% url 'category' cat.id %}"><i class="fa fa-{{ cat.icon }}"></i>{{ cat }}</a>
{% endfor %}
</div>
{% endif %}
{% endblock %} {% endblock %}

View file

@ -23,7 +23,7 @@ from .models import (
def index(request): def index(request):
_transactions = Transaction.objects.all()[:10] _transactions = Transaction.objects.all()[:10]
_categories = Category.objects.all() _categories = Category.objects.all()
_snapshots = Snapshot.objects.all()[:5] _snapshots = Snapshot.objects.all()
context = { context = {
"transactions": _transactions, "transactions": _transactions,
@ -43,7 +43,7 @@ class LogoutView(auth_views.LogoutView):
class TransactionListView(LoginRequiredMixin, ListView): class TransactionListView(LoginRequiredMixin, ListView):
paginate_by = 20 paginate_by = 64
model = Transaction model = Transaction
template_name = "main/transactions.html" template_name = "main/transactions.html"
context_object_name = "transactions" context_object_name = "transactions"