Billnotes note-page interaction: hover glow, click-lock, DON/DOFF; note titles + card-ref styling — TDD
- note-page.js: click-lock (_lockedItem + notes-locked body class); DON auto-DOFFs prev donned; _setGreeting updates navbar; _donnedItem exposed for test API - NotePageSpec.js: 18 Jasmine specs covering lock/unlock, DON/DOFF state, auto-DOFF, greeting update, initial load; flushPromises helper for chained fetch .then() - _note.scss: DON/DOFF opacity:0 by default; hover + locked + donned states show them; body:not(.notes-locked) hover suppression - views.py: Super-Schizo/Super-Nomad card titles; recognition_title field (display_title) separate from card title; mark_safe descriptions w. card-ref spans - my_notes.html: |safe on description; recognition_title for Recognitions block - _navbar.html: id_greeting_prefix/id_greeting_name spans for JS greeting update - _base.scss: global .card-ref rule (--terUser, font-weight 600, !important) Code architected by Disco DeDisco <discodedisco@outlook.com> Git commit message Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -116,13 +116,13 @@ _NOTE_META = {
|
||||
"swatch_label": None,
|
||||
},
|
||||
"super-schizo": {
|
||||
"title": "Schizoid Man",
|
||||
"title": "Super-Schizo",
|
||||
"description": mark_safe('Admin access granted to <span class="card-ref">I. The Schizo</span> as Significator'),
|
||||
"palette_options": [],
|
||||
"swatch_label": "I",
|
||||
},
|
||||
"super-nomad": {
|
||||
"title": "Stranger",
|
||||
"title": "Super-Nomad",
|
||||
"description": mark_safe('Admin access granted to <span class="card-ref">0. The Nomad</span> as Significator'),
|
||||
"palette_options": [],
|
||||
"swatch_label": "0",
|
||||
@@ -156,13 +156,14 @@ def my_notes(request):
|
||||
active_title = request.user.active_title
|
||||
note_items = [
|
||||
{
|
||||
"obj": n,
|
||||
"title": _NOTE_META.get(n.slug, {}).get("title", n.slug),
|
||||
"description": _NOTE_META.get(n.slug, {}).get("description", ""),
|
||||
"palette_options": _NOTE_META.get(n.slug, {}).get("palette_options", []),
|
||||
"swatch_label": _NOTE_META.get(n.slug, {}).get("swatch_label"),
|
||||
"palette_label": _PALETTE_LABELS.get(n.palette, "") if n.palette else "",
|
||||
"is_equipped": active_title is not None and active_title.pk == n.pk,
|
||||
"obj": n,
|
||||
"title": _NOTE_META.get(n.slug, {}).get("title", n.slug),
|
||||
"recognition_title": n.display_title,
|
||||
"description": _NOTE_META.get(n.slug, {}).get("description", ""),
|
||||
"palette_options": _NOTE_META.get(n.slug, {}).get("palette_options", []),
|
||||
"swatch_label": _NOTE_META.get(n.slug, {}).get("swatch_label"),
|
||||
"palette_label": _PALETTE_LABELS.get(n.palette, "") if n.palette else "",
|
||||
"is_equipped": active_title is not None and active_title.pk == n.pk,
|
||||
}
|
||||
for n in qs
|
||||
]
|
||||
@@ -183,8 +184,7 @@ def don_title(request, slug):
|
||||
if request.method == "POST":
|
||||
request.user.active_title = note
|
||||
request.user.save(update_fields=["active_title"])
|
||||
title = _NOTE_META.get(slug, {}).get("title", slug.capitalize())
|
||||
return JsonResponse({"title": title})
|
||||
return JsonResponse({"title": note.display_title, "greeting": note.display_greeting})
|
||||
|
||||
|
||||
@login_required(login_url="/")
|
||||
@@ -192,7 +192,7 @@ def doff_title(request, slug):
|
||||
if request.method == "POST":
|
||||
request.user.active_title = None
|
||||
request.user.save(update_fields=["active_title"])
|
||||
return JsonResponse({"ok": True})
|
||||
return JsonResponse({"ok": True, "greeting": "Welcome,", "title": "Earthman"})
|
||||
|
||||
|
||||
@login_required(login_url="/")
|
||||
|
||||
Reference in New Issue
Block a user