Move profile and settings into the new unified dashboard, showing user info in one place

This commit is contained in:
badblocks 2025-03-31 22:20:59 -07:00
parent 2d826734a0
commit 7edefe23c3
37 changed files with 726 additions and 500 deletions

View file

@ -1,4 +1,4 @@
# Generated by Django 5.1.2 on 2025-03-29 21:23
# Generated by Django 5.1.2 on 2025-03-31 22:48
import django.db.models.deletion
from django.db import migrations, models

View file

@ -1,11 +0,0 @@
from django import template
register = template.Library()
@register.inclusion_tag("templatetags/pagination_controls.html", takes_context=True)
def render_pagination(context, page_obj):
"""
Renders pagination controls given a page_obj.
The controls use values like page_obj.number, page_obj.has_previous, etc.
"""
return {"page_obj": page_obj}

View file

@ -148,13 +148,13 @@ class CardListView(ReusablePaginationMixin, ListView):
# For non-grouped mode, transform the built-in paginator page
if "page_obj" in context:
page = context["page_obj"]
# Create a unified pagination context dict
# Create a unified pagination context dict with updated keys
custom_page_obj = {
"number": page.number,
"has_previous": page.has_previous(),
"has_next": page.has_next(),
"previous_page": page.previous_page_number() if page.has_previous() else 1,
"next_page": page.next_page_number() if page.has_next() else page.paginator.num_pages,
"previous_page_number": page.previous_page_number() if page.has_previous() else 1,
"next_page_number": page.next_page_number() if page.has_next() else page.paginator.num_pages,
"paginator": {"num_pages": page.paginator.num_pages},
}
context["page_obj"] = custom_page_obj