From c5ac2d83c7e9e6571f295424221e724a9279b592 Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Sun, 22 May 2022 18:07:04 +0200 Subject: [PATCH] Update form theme --- nummi/main/static/main/css/form.css | 26 +++++++++++++++++----- nummi/main/templates/main/category.html | 1 + nummi/main/templates/main/snapshot.html | 2 +- nummi/main/templates/main/transaction.html | 8 +++---- nummi/main/urls.py | 1 + nummi/main/views.py | 7 ++++++ 6 files changed, 34 insertions(+), 11 deletions(-) diff --git a/nummi/main/static/main/css/form.css b/nummi/main/static/main/css/form.css index 4b33e4a..412d942 100644 --- a/nummi/main/static/main/css/form.css +++ b/nummi/main/static/main/css/form.css @@ -3,17 +3,27 @@ form { grid-template-columns: auto 1fr; grid-gap: var(--gap); margin: var(--gap) 0; + line-height: 2rem; +} + +form input, +form select, +form textarea { + padding: 0 var(--gap); } form > label, form > input[type="text"], form > input[type="number"], -form > select, -form > textarea { +form > select { font-size: inherit; line-height: inherit; font-family: inherit; } +form > textarea { + font-size: inherit; + font-family: inherit; +} form > input[type="text"], form > input[type="number"], form > textarea { @@ -25,22 +35,26 @@ form > .buttons { grid-column: 1 / -1; text-align: right; } -form > .buttons input { - padding: .5em 1em; - margin-left: 1em; +form > .buttons input, +form select, +form input[type="file"] { font-size: inherit; line-height: inherit; font-family: inherit; border: 0; - background: var(--bg); + background: var(--bg-01); cursor: pointer; border-radius: 2px; } +form > .buttons input { + margin-left: var(--gap); +} form > .buttons input:hover { text-decoration: underline; } form > .buttons input[type="submit"] { background: var(--green); + color: var(--text-inv); } form > .buttons input[type="reset"] { color: var(--red); diff --git a/nummi/main/templates/main/category.html b/nummi/main/templates/main/category.html index c193c60..851ae6c 100644 --- a/nummi/main/templates/main/category.html +++ b/nummi/main/templates/main/category.html @@ -19,6 +19,7 @@ {{ field }} {% endfor %}
+
diff --git a/nummi/main/templates/main/snapshot.html b/nummi/main/templates/main/snapshot.html index 6abb631..7621383 100644 --- a/nummi/main/templates/main/snapshot.html +++ b/nummi/main/templates/main/snapshot.html @@ -29,7 +29,7 @@ {{ field }} {% endfor %}
- +
diff --git a/nummi/main/templates/main/transaction.html b/nummi/main/templates/main/transaction.html index 1acb8ac..24dfde0 100644 --- a/nummi/main/templates/main/transaction.html +++ b/nummi/main/templates/main/transaction.html @@ -18,9 +18,9 @@ {{ field }} {% endfor %}
- - - + + +
{% endspaceless %} @@ -46,6 +46,6 @@ {{ field }} {% endfor %} -
+
{% endblock %} diff --git a/nummi/main/urls.py b/nummi/main/urls.py index 6ea01f7..fc2eb94 100644 --- a/nummi/main/urls.py +++ b/nummi/main/urls.py @@ -23,6 +23,7 @@ urlpatterns = [ path("category", views.category, name="category"), path("category/", views.category, name="category"), path("category//update", views.update_category, name="update_category"), + path("category//del", views.del_category, name="del_category"), path("snapshot", views.snapshot, name="snapshot"), path("snapshot/", views.snapshot, name="snapshot"), path("snapshot/update/", views.update_snapshot, name="update_snapshot"), diff --git a/nummi/main/views.py b/nummi/main/views.py index adcd5b9..9c11ea6 100644 --- a/nummi/main/views.py +++ b/nummi/main/views.py @@ -133,6 +133,13 @@ def update_category(request, uuid): return redirect(category, uuid=uuid) +@login_required +def del_category(request, uuid): + _category = get_object_or_404(Category, id=uuid) + _category.delete() + return redirect(index) + + @login_required def snapshot(request, date=None): if date is None: