jinja more like i can't think of anything witty
Co-authored-by: justcool393 <justcool393@gmail.com>
Reviewed-on: rDrama/rDrama#31
Co-authored-by: justcool393 <justcool393@noreply.fsdfsd.net>
Co-committed-by: justcool393 <justcool393@noreply.fsdfsd.net>
The need for sidebars to have access to macros.random_image means
all templates that include header.html (most templates) need to have
access to `macros`, because header.html includes sidebar_{SITE_NAME}.
Because of how sparse helpers was, we instead unify the two and
replace it since I know we had helpers in every top-level template.
* move Base definition to files.classes.__init__.py
* fix ImportError
* move userpage listing to users.py
* don't import the app from classes
* consts: set default values to avoid crashes
consts: warn if the secret key is the default config value
* card view: sneed (user db schema)
* cloudflare: use DEFAULT_CONFIG_VALUE
* const: set default values
* decouple media.py from __main__
* pass database to avoid imports
* import cleanup and import request not in const, but in the requests mega import
* move asset_submissions site check to __init__
* asset submissions feature flag
* flag
* g.is_tor
* don't import request where it's not needed
* i think this is fine
* mail: move to own routes and helper
* wrappers
* required wrappers move
* unfuck wrappers a bit
* move snappy quotes and marseys to stateful consts
* marsify
* :pepodrool:
* fix missing import
* import cache
* ...and settings.py
* and static.py
* static needs cache
* route
* lmao all of the jinja shit was in feeds.py amazing
* classes should only import what they need from flask
* import Response
* hdjbjdhbhjf
* ...
* dfdfdfdf
* make get a non-required import
* isort imports (mostly)
* but actually
* configs
* reload config on import
* fgfgfgfg
* config
* config
* initialize snappy and test
* cookie of doom debug
* edfjnkf
* xikscdfd
* debug config
* set session cookie domain, i think this fixes the can't login bug
* sdfbgnhvfdsghbnjfbdvvfghnn
* hrsfxgf
* dump the entire config on a request
* kyskyskyskyskyskyskyskyskys
* duifhdskfjdfd
* dfdfdfdfdfdfdfdfdfdfdfdf
* dfdfdfdf
* imoprt all of the consts beacuse fuck it
* ðŸ˜
* dfdfdfdfdfdfsdasdf
* print the entire session
* rffdfdfjkfksj
* fgbhffh
* not the secret keys
* minor bug fixes
* be helpful in the warning
* gfgfgfg
* move warning lower
* isort main imports (i hope this doesn't fuck something up)
* test
* session cookie domain redux
* dfdfdfd
* try only importing Flask
* formkeys fix
* y
* :pepodrool:
* route helper
* remove before flight
* dfdfdfdfdf
* isort classes
* isort helpers
* move check_for_alts to routehelpers and also sort imports and get rid of unused ones
* that previous commit but actkally
* readd the cache in a dozen places they were implicitly imported
* use g.is_tor instead of request.headers. bla bla bla
* upgrade streamers to their own route file
* get rid of unused imports in __main__
* fgfgf
* don't pull in the entire ORM where we don't need it
* features
* explicit imports for the get helper
* explicit imports for the get helper redux
* testing allroutes
* remove unused import
* decouple flask from classes
* syntax fix also remember these have side fx for some reason (why?)
* move side effects out of the class
* posts
* testing on devrama
* settings
* reloading
* settingssdsdsds
* streamer features
* site settings
* testing settings on devrama
* import
* fix modlog
* remove debug stuff
* revert commit 67275b21ab6e2f2520819e84d10bfc1c746a15b6
* archiveorg to _archiveorg
* skhudkfkjfd
* fix cron for PCM
* fix bugs that snekky wants me to
* Fix call to realbody passing db, standardize kwarg
* test
* import check_for_alts from the right place
* cloudflare
* testing on devrama
* fix cron i think
* shadow properly
* tasks
* Remove print which will surely be annoying in prod.
* v and create new session
* use files.classes
* make errors import little and fix rare 500 in /allow_nsfw
* Revert "use files.classes"
This reverts commit 98c10b876cf86ce058b7fb955cf1ec0bfb9996c6.
* pass v to media functions rather than using g
* fix
* dfdfdfdfd
* cleanup, py type checking is dumb so don't use it where it causes issues
* Fix some merge bugs, add DEFAULT_RATELIMIT to main.
* Fix imports on sqlalchemy expressions.
* `from random import random` is an error.
* Fix replies db param.
* errors: fix missing import
* fix rare 500: only send to GIFT_NOTIF_ID if it exists, and send them the right text
* Fix signup formkey.
* fix 2 500s
* propagate db to submissions
* fix replies
* dfdfdfdf
* Fix verifiedcolor.
* is_manual
* can't use getters outside of an app context
* don't attempt to do gumroad on sites where it's not enabled
* don't attempt to do gumraod on sites's where it's unnecessary
* Revert "don't attempt to do gumroad on sites where it's not enabled"
This reverts commit 6f8a6331878655492dfaf1907b27f8be513c14d3.
* fix 500
* validate media type
Co-authored-by: TLSM <duolsm@outlook.com>
* remove /logged_out/ routes
* update sitemap, remove users route, and update header
* cloudflare cookie
* only mess with the cookie whenever we desire auth
* sitemap: (small) improvements
sitemap: fix little bug i introduced
sitemap: fix login redirects for /id/ routes
* sitemap: remove duplicate entry
* contact is auth desired
* imports: don't import what we don't need and bind late to the db
* praying to god this works
* keep yourself safe
* oh i actually need to commit and push lol
* import Sub
* t
* refix cache purger
* Add new /casino route and template
* Consolidate lottery into casino and add initial template for slots
* Change /lottery route to /casino and replace icon with usd symbol and change sitewide const to reflect change
* Hook up new slots method to casino
* Enable Marseybux spending in casino slots
* Add UI for playing blackjack in casino
* First connection of blackjack UI to backend
* Add protective clause thanks to help from carpathianflorist.
* Create new Casino_Game relation and persist inside of blackjack
* Connect new slots behavior to Casino_Game table
* Create UI action management logic
* Add blackjack game status checker which adds persistence for blackjack
* Gonna handle this better, hold on
* Reorganize blackjack helper methods
* Reorganize casino.js to account for new changes
* Connect up to frontend
* Little changes ya know
* Display a message when winning in Blackjack
* Fix some issues with double down and insure
* Revert "remove owoify-py from requirements"
This reverts commit 4454648ea2.
* A little casino styling change
* Reorganize into a casino block
* Smallenize the card'
* Remove references to old game data on comments
* Add sql migration file
* Remove logic to drop old columns
* Fix two forgotten conflicts
Getting the basic hats frontend changes into master so my branch stops
diverging from the templates. Migrates the existing cakeday partyhat
functionality to the new system also.
Establishes a (hopefully) static interface for PFP hat display:
- Hat image assets are 100px w x 130px h and anchored to the bottom-
left corner of pfps.
- User.hat_active provides either empty string or the internal
string identifier for active user hat.
- User.hat_tooltip provides mouseover text. Likely only to be used
for cakeday hats on one's cakeday.
Additionally, per discussion with Carp, PFPs in comments and posts
increased from 25px diameter to 30px.
In anticipation of adding about a dozen more features flags to support
work for LGB, PIN_ENABLED and PROCOINS_ENABLED have been moved to the
FEATURES dict in const.py. More generally looking to create a unified
interface for logically-related constants, perhaps to support e.g.
later moving these settings from hardcoded constants to data.
Commit began by changing the duplicated SITE_NAME conditional in the
header to use a `has_logo` param, much like the recent `has_sidebar`.
From there, a need to include site-specific assets in assetcache was
revealed, adding the `asset_siteimg(...)` macro. This was applied
quite broadly, though not comprehensively.
The header dropdown menu's horizontal positioning depends on the
width of the user pfp/username/currency region to not overflow off
the right side of the page. Therefore, we enforce a minimum width.
There is presumably some way to fix this by right-aligning the right
side of the dropdown menu to the right side of the dropdown header.
I didn't want to risk it given the strange interplay of all of the
Bootstrap styling and the media queries. Also, it does visually
look better to be left-aligned.
Kitchen sink commit of semi-related things:
- `#profile--bio a` tags didn't properly wrap on mobile with some
browsers. Changing overflow-wrap may fix this.
- Userpage markup for mobile tried to place profile_bio inside a
<p> tag. Nesting paragraphs is invalid HTML. It has been made a
<div> to match desktop and even nearby sections on mobile.
- Fedi icon in mobile dropdown had the wrong classes, which broke
consistent styling with its neighbors.
- fa-square-share-nodes improperly wound up with the fa-share-nodes
character code when committed.
Previously, notification bell linking & color logic was interspersed
between templates and the user model. It doesn't _really_ belong in
the user model, but it's been moved out of the templates to there to
at least centralize it. This was also used as an opportunity to make
the modactions inbox color the bell appropriately.
Previously, the three instances of 'Report[s]' and one instance of
'Coin[s]' in the UI templates were always pluralized, even when they
referred to a singular instance. This has been corrected by creating
a `plural` helper macro.
Additionally, this was used as impetus to create `utils/helpers.html`
to eventually move more recurring template logic into macros.
Some users have complained about performance with the backdrop-filter
on .modal-backdrop.show. Partially as a kludge to avoid adding another
toggle, the 'animations' user setting now also disables the backdrop
filter. In practice, this may turn into a more general setting to
remove performance-intensive UI effects.
3106823511 added a chat icon to the navbar on mobile. I forgot that
the bottom navbar on mobile already had one. It has therefore been
removed, thus totally alleviating issues with wrapping when a user
is both an admin and has a high notification count.
Users now have a toggleable can_gamble setting which disables their
ability to use all chance-based gains on the site: viz. slots,
blackjack, the lottery, and treasure chests.
This only applies on invocation of commands that start gambling
games, so it should cause no bugs when toggled with e.g. active
blackjack games.
This was added for the benefit of users with actual problems with
gambling, be they past addiction or religious conviction. All future
gambling features are humbly requested to respect it.
After the recent addition of the Lottershe, some narrow phone screens
caused the header to wrap to two lines. Prompted by this, a more
general rework of the header nav icons was initiated.
Notably: random user, random post, all comments has been moved to
sidebar on all sites, and a .sidebar-link CSS class was created to
support it. Additionally, on rDrama, links for Badges and Marseys
were added, since I believe these are presently inaccessible from
the UI. Further, a Modlog link was added to be more accessible.
Additionally, the icons in the header were rearranged on desktop and
mobile to better fit relative priority.
* fuck u bootstrap
* cleanup
* Improve CSS
* Vote and reply animations
* Fixse
* Fix bugs and add scroll to top thing
* Update themes and sidebar and stuff and such
* Fix mobile arrows
* soy blur
* Fix dramlr or dramalr or tumblr or whatever its called
Assetcache macro improvement: to support assets in folders which are
dynamically referenced by e.g. ID or name, the `asset` macro now
accepts an optional second parameter to be included in the path but
not to be used for versioning the class of assets.
To support recent commits, assetcache now applies for:
- images/badges/*.webp
- js/: award_modal.js, bootstrap.js, header.js