Compare commits

..

No commits in common. "7a365212f5df167f8192c3fd2a88538f7014fa25" and "e4f70c67e32d0a57390e4e95f9dcb8826a878b52" have entirely different histories.

5 changed files with 4 additions and 54 deletions

View file

@ -1,3 +0,0 @@
.pagination .current {
font-feature-settings: "tnum", "ss01";
}

View file

@ -18,23 +18,19 @@
{% spaceless %}
<nav>
<a href="{% url 'index' %}"
class="home{% if request.resolver_match.url_name == 'index' %}cur{% endif %}">
class="home{% if request.resolver_match.url_name == "index" %} cur{% endif %}">
Nummi
</a>
<a href="{% url 'transactions' %}"
class="{% if request.resolver_match.url_name == 'transactions' %}cur{% endif %}">
Transactions
</a>
<a href="{% url 'transaction' %}"
class="{% if request.resolver_match.url_name == 'transaction' %}cur{% endif %}">
class="{% if request.resolver_match.url_name == "transaction" %} cur{% endif %}">
Add transaction
</a>
<a href="{% url 'category' %}"
class="{% if request.resolver_match.url_name == 'category' %}cur{% endif %}">
class="{% if request.resolver_match.url_name == "category" %} cur{% endif %}">
Add category
</a>
<a href="{% url 'snapshot' %}"
class="{% if request.resolver_match.url_name == 'snapshot' %}cur{% endif %}">
class="{% if request.resolver_match.url_name == "snapshot" %} cur{% endif %}">
Add snapshot
</a>
<a href="{% url 'logout' %}"

View file

@ -1,32 +0,0 @@
{% extends "main/base.html" %}
{% load static %}
{% load main_extras %}
{% block link %}
{{ block.super }}
<link rel="stylesheet" href="{% static 'main/css/table.css' %}" type="text/css" />
<link rel="stylesheet" href="{% static 'main/css/page.css' %}" type="text/css" />
{% endblock %}
{% block body %}
<h1>Transactions</h1>
{% transaction_table transactions %}
<div class="pagination">
<span class="step-links">
{% if page_obj.has_previous %}
<a href="?page=1"></a>
<a href="?page={{ page_obj.previous_page_number }}"></a>
{% endif %}
<span class="current">
{{ page_obj.number }}/{{ page_obj.paginator.num_pages }}
</span>
{% if page_obj.has_next %}
<a href="?page={{ page_obj.next_page_number }}"></a>
<a href="?page={{ page_obj.paginator.num_pages }}"></a>
{% endif %}
</span>
</div>
{% endblock %}

View file

@ -6,7 +6,6 @@ urlpatterns = [
path("", views.index, name="index"),
path("login", views.LoginView.as_view(), name="login"),
path("logout", views.LogoutView.as_view(), name="logout"),
path("transactions", views.TransactionListView.as_view(), name="transactions"),
path("transaction", views.transaction, name="transaction"),
path("transaction/<uuid>", views.transaction, name="transaction"),
path(

View file

@ -2,9 +2,6 @@ from django.shortcuts import render, get_object_or_404, redirect
from django.http import HttpResponse
from django.contrib.auth.decorators import login_required
from django.contrib.auth import views as auth_views
from django.contrib.auth.mixins import LoginRequiredMixin
from django.views.generic import ListView
from django.core.paginator import Paginator
from .models import (
Transaction,
@ -41,13 +38,6 @@ class LogoutView(auth_views.LogoutView):
next_page = "login"
class TransactionListView(LoginRequiredMixin, ListView):
paginate_by = 20
model = Transaction
template_name = "main/transactions.html"
context_object_name = "transactions"
@login_required
def transaction(request, uuid=None):
if uuid is None: