new FT test_theme for theme switcher functionality; theme-switcher content added to home.html, several dashboard views & urls, all appropriate ITs & UTs; lyric user model saves theme (migrations run); django-compressor and django-libsass libraries added to dependencies

This commit is contained in:
Disco DeDisco
2026-03-02 13:57:03 -05:00
parent 143e81fc41
commit e142e5d4d7
14 changed files with 624 additions and 3 deletions

View File

@@ -7,6 +7,9 @@ from .models import Item, List
from apps.lyric.models import User
UNLOCKED_THEMES = frozenset(["theme-default"])
def home_page(request):
return render(request, "apps/dashboard/home.html", {"form": ItemForm()})
@@ -59,3 +62,13 @@ def share_list(request, list_id):
pass
messages.success(request, "An invite has been sent if that address is registered.")
return redirect(our_list)
def set_theme(request):
if not request.user.is_authenticated:
return redirect("home")
if request.method == "POST":
theme = request.POST.get("theme", "")
if theme in UNLOCKED_THEMES:
request.user.theme = theme
request.user.save(update_fields=["theme"])
return redirect("home")