Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dismissible GlobalMessage #411

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Conversation

metenn
Copy link
Contributor

@metenn metenn commented Oct 21, 2024

GlobalMessage should be dismissible. This aims to fix that.

  • It won't sync between two devices for a client, the alternative requires tracking of every dismissed message for every single account, which requires more server work. For something like this - a message you see once in a blue moon - I think that's a bit overkill.
  • The script is inlined in global-message.html to avoid layout shifts (or commonly "flashes") from the page loading well before the script.
  • in global-message.html, the context variable global_message is also now passed through |safe to allow for more customizable messages via HTML. This isn't necessarily an XSS attack vector, as GlobalMessage is only changeable if user.is_superuser = True, and superusers already have full access to many other system components.

@metenn metenn requested a review from MasloMaslane as a code owner October 21, 2024 17:27
@metenn metenn marked this pull request as draft October 21, 2024 20:14
@metenn metenn marked this pull request as ready for review October 21, 2024 21:24
@metenn metenn marked this pull request as draft October 25, 2024 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant