* add feather asset from opensymbols
([url](https://www.opensymbols.org/symbols/language-craft/feather-b135df39?id=44015))
* update routes/login.py to use new feather.webp emoji
* update seed-db.sql to add feather emoji
Co-authored-by: Motte Lurk <mottelurk@proton.me>
Co-authored-by: Ben Rog-Wilhelm <zorba@pavlovian.net>
I created a new theme, "TheMotte" in /assests/css. Someone with any design
skill at all should try improving this. Currently it is a copy of light.css
__main__.py defines the experience for a user without an account. I removed the
check for an OS environment variable, and defaulted to the new theme.
/classes/user.py defines the default for a new account. I removed the check for an OS
environment variable, and defaulted to the new theme.
/routes/settings.py has a list of the themes that checks them for... something.
I added the new one here, just in case.
/templates/settings_profile.html has a hardcoded list that controls which
themes appear in the user settings page. Added the new theme here, so you can
select it.
Implements feature request to know how many of each badge exists and
to have a 'rarity', a la Steam or PSN badges, relative to number of
non-lurker users.
Because Postgres `COUNT()`s are notoriously costly, /badges has been
memoized for 1hr to avoid a DOS target.
Fixes minor UI bug when removing self-upvote on a comment. Previous
behavior, starting from a new comment:
- Initial state: score 1 from self-upvote, upvote button shows
highlighted as `color: var(--primary)`.
- Click on upvote button to remove self-upvote → button
unhighlights, score displays as 0.
- [reload page]
- Score displays as 0, but button is highlighted.
- Click on upvote button → button unhighlights, score displays
as -1. [If you reload the page now, state is score 0 &
highlighted; no change in serverside votes.]
- Click on upvote again → button highlights, score displays as 0.
- [reload page]
- Score displays as 1, button is highlighted.
Direct cause is `templates/comments.html @ L115-117`. I checked
`api_comment`, though, and it adds a vote on new comments, and that
state change propagates to the template's parameters before it renders,
so I believe the only time this triggers is specifically when a user
has removed their self-upvote. Bug is fixed when testing with L115-117
removed. Is there some other edge case it was meant to solve?
Secondary bugfix: Removing a self-upvote _costs_ you a coin & a
truescore point. I think this is one of the few ways to get negative
dramacoin. I chose to fix it by having self-votes and self-unvotes not
change coins/truecoins. The alternative of having new comments & posts
give the user +1 coin/truecoin would modify site behavior, and you'd
retroactively owe some powerusers thousands of DC & truescore.