rename: Note→Post/Line (dashboard); Recognition→Note (drama); new-post/my-posts to billboard

- dashboard: Note→Post, Item→Line across models, forms, views, API, urls & tests
- new-post (9×3) & my-posts (3×3) applets migrate from dashboard→billboard context; billboard view passes form & recent_posts
- drama: Recognition→Note, related_name notes; billboard URL /recognition/→/my-notes/, set-palette at /note/<slug>/set-palette
- recognition.js→note.js (module Note, data.note key); recognition-page.js→note-page.js; .recog-*→.note-*
- _recognition.scss→_note.scss; BillNotes page header; applet slug billboard-recognition→billboard-notes (My Notes)
- NoteSpec.js replaces RecognitionSpec.js; test_recognition.py→test_applet_my_notes.py
- 4 migrations applied: dashboard 0004, applets 0011+0012, drama 0005; 683 ITs green

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Disco DeDisco
2026-04-22 22:32:34 -04:00
parent 6d9d3d4f54
commit 473e6bc45a
54 changed files with 1373 additions and 1283 deletions

View File

@@ -1,32 +1,32 @@
from django import forms
from django.core.exceptions import ValidationError
from .models import Item
from .models import Line
DUPLICATE_ITEM_ERROR = "You've already logged this to your note"
EMPTY_ITEM_ERROR = "You can't have an empty note item"
DUPLICATE_LINE_ERROR = "You've already logged this to your post"
EMPTY_LINE_ERROR = "You can't have an empty post line"
class ItemForm(forms.Form):
class LineForm(forms.Form):
text = forms.CharField(
error_messages = {"required": EMPTY_ITEM_ERROR},
error_messages = {"required": EMPTY_LINE_ERROR},
required=True,
)
def save(self, for_note):
return Item.objects.create(
note=for_note,
def save(self, for_post):
return Line.objects.create(
post=for_post,
text=self.cleaned_data["text"],
)
class ExistingNoteItemForm(ItemForm):
def __init__(self, for_note, *args, **kwargs):
class ExistingPostLineForm(LineForm):
def __init__(self, for_post, *args, **kwargs):
super().__init__(*args, **kwargs)
self._for_note = for_note
self._for_post = for_post
def clean_text(self):
text = self.cleaned_data["text"]
if self._for_note.item_set.filter(text=text).exists():
raise forms.ValidationError(DUPLICATE_ITEM_ERROR)
if self._for_post.lines.filter(text=text).exists():
raise forms.ValidationError(DUPLICATE_LINE_ERROR)
return text
def save(self):
return super().save(for_note=self._for_note)
return super().save(for_post=self._for_post)