post.html attribution palette: usernames render w. @-prefix (bare emails left as-is); .post-attribution spans wrap username+title combos for the --quaUser colour key — line author col, self/shared header lines, Note.grant_if_new prose
- new lyric_extras.at_handle filter: '@{username}' if user.username, else truncate_email(user.email). Companion to display_name (which has no @-prefix). Used by post.html line author col + self/shared self lines.
- post.html updates: line author span renders {{ line.author|at_handle }}; .post-shared-recipients chips render {{ r|at_handle }} + .post-attribution; .post-shared-self wraps "{handle} the {title}" in <span class="post-attribution">. The 'just me' / '& me' prose stays plain (only the handle+title combo is coloured).
- Note.grant_if_new prose wraps both the @-handle (or bare email fallback) AND the title in <span class="post-attribution">. Standard format wraps the combo "{handle} the {title}" together; admin format wraps each independently since the prose splits them ("recognizes @disco for ... customary title of Schizoid Man"). Existing Lines unchanged — going-forward styling only.
- SCSS: .post-attribution { color: rgba(var(--quaUser), 1); } scoped at .post-page so it lights up in both .post-header descendants and #id_post_table descendants. .post-line-author also switches from opacity-based dim to the same --quaUser key (drops opacity 0.75 since the colour change reads as the de-emphasis on its own).
- 852 ITs still green — line.text inclusions ("Stargazer", "alice@test.io" etc.) still substring-match through the wrapping spans.
Code architected by Disco DeDisco <discodedisco@outlook.com>
Git commit message Co-Authored-By:
Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -293,21 +293,31 @@ class Note(models.Model):
|
||||
post.title = NOTE_UNLOCK_POST_TITLE
|
||||
post.save(update_fields=["title"])
|
||||
|
||||
username = user.username or user.email
|
||||
# Bare-email fallback when user.username is None (no `@` prefix —
|
||||
# the address already carries one). When username is set, use the
|
||||
# `@handle` form. Both wrapped in .post-attribution so the CSS
|
||||
# palette key (--quaUser) lights up the username + title combo.
|
||||
handle = f"@{user.username}" if user.username else user.email
|
||||
note_anchor = (
|
||||
f'<a class="note-ref" href="/billboard/my-notes/">'
|
||||
f'{note.display_name}</a>'
|
||||
)
|
||||
attr_handle = f'<span class="post-attribution">{handle}</span>'
|
||||
attr_title = f'<span class="post-attribution">{note.display_title}</span>'
|
||||
if slug in _ADMIN_NOTE_SLUGS:
|
||||
line_text = (
|
||||
f"The administration recognizes {username} for {note_anchor}, "
|
||||
f"which comes with the customary title of {note.display_title}. "
|
||||
f"The administration recognizes {attr_handle} for {note_anchor}, "
|
||||
f"which comes with the customary title of {attr_title}. "
|
||||
"This does not entail any additional benefits."
|
||||
)
|
||||
else:
|
||||
attr_combo = (
|
||||
f'<span class="post-attribution">{handle} '
|
||||
f'the {note.display_title}</span>'
|
||||
)
|
||||
line_text = (
|
||||
f"Look!—new Note unlocked. {note_anchor} "
|
||||
f"recognizes {username} the {note.display_title}."
|
||||
f"recognizes {attr_combo}."
|
||||
)
|
||||
|
||||
# Lazy get-or-create: TransactionTestCase flushes the migration-seeded
|
||||
|
||||
Reference in New Issue
Block a user