Compare commits
No commits in common. "7a365212f5df167f8192c3fd2a88538f7014fa25" and "e4f70c67e32d0a57390e4e95f9dcb8826a878b52" have entirely different histories.
7a365212f5
...
e4f70c67e3
5 changed files with 4 additions and 54 deletions
|
@ -1,3 +0,0 @@
|
||||||
.pagination .current {
|
|
||||||
font-feature-settings: "tnum", "ss01";
|
|
||||||
}
|
|
|
@ -18,23 +18,19 @@
|
||||||
{% spaceless %}
|
{% spaceless %}
|
||||||
<nav>
|
<nav>
|
||||||
<a href="{% url 'index' %}"
|
<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
|
Nummi
|
||||||
</a>
|
</a>
|
||||||
<a href="{% url 'transactions' %}"
|
|
||||||
class="{% if request.resolver_match.url_name == 'transactions' %}cur{% endif %}">
|
|
||||||
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 %}">
|
||||||
Add transaction
|
Add 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 %}">
|
||||||
Add category
|
Add 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 %}">
|
||||||
Add snapshot
|
Add snapshot
|
||||||
</a>
|
</a>
|
||||||
<a href="{% url 'logout' %}"
|
<a href="{% url 'logout' %}"
|
||||||
|
|
|
@ -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 %}
|
|
|
@ -6,7 +6,6 @@ urlpatterns = [
|
||||||
path("", views.index, name="index"),
|
path("", views.index, name="index"),
|
||||||
path("login", views.LoginView.as_view(), name="login"),
|
path("login", views.LoginView.as_view(), name="login"),
|
||||||
path("logout", views.LogoutView.as_view(), name="logout"),
|
path("logout", views.LogoutView.as_view(), name="logout"),
|
||||||
path("transactions", views.TransactionListView.as_view(), name="transactions"),
|
|
||||||
path("transaction", views.transaction, name="transaction"),
|
path("transaction", views.transaction, name="transaction"),
|
||||||
path("transaction/<uuid>", views.transaction, name="transaction"),
|
path("transaction/<uuid>", views.transaction, name="transaction"),
|
||||||
path(
|
path(
|
||||||
|
|
|
@ -2,9 +2,6 @@ from django.shortcuts import render, get_object_or_404, redirect
|
||||||
from django.http import HttpResponse
|
from django.http import HttpResponse
|
||||||
from django.contrib.auth.decorators import login_required
|
from django.contrib.auth.decorators import login_required
|
||||||
from django.contrib.auth import views as auth_views
|
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 (
|
from .models import (
|
||||||
Transaction,
|
Transaction,
|
||||||
|
@ -41,13 +38,6 @@ class LogoutView(auth_views.LogoutView):
|
||||||
next_page = "login"
|
next_page = "login"
|
||||||
|
|
||||||
|
|
||||||
class TransactionListView(LoginRequiredMixin, ListView):
|
|
||||||
paginate_by = 20
|
|
||||||
model = Transaction
|
|
||||||
template_name = "main/transactions.html"
|
|
||||||
context_object_name = "transactions"
|
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
def transaction(request, uuid=None):
|
def transaction(request, uuid=None):
|
||||||
if uuid is None:
|
if uuid is None:
|
||||||
|
|
Loading…
Reference in a new issue