Commit graph

13719 commits

Author SHA1 Message Date
TLSM
010c56a35e Implement #380: remove signatures feature. 2022-11-09 20:37:04 -06:00
TLSM
c85cd469a1 Move post/comment ID boilerplate inside getters.
Borrows code from the upstream which has been working in production
reliably for ~months. Also, most of it was literally copy-pasted,
and the casted ID values aren't used later in the route functions.
2022-11-09 20:37:04 -06:00
TLSM
1018cf3412 Fix #261: only show lineal parents in contexts. 2022-11-06 03:13:10 -06:00
TLSM
72995ef3f1 Fix #352: don't collapse comments when ?context.
While checking for the key in the Request object is highly inelegant,
it is consistent with how we determine elsewhere if rendered comments
are being shown as a context.
2022-11-06 03:13:10 -06:00
TLSM
9e2ceb28b0 Fix four routes with auth_desired misimplemented.
PR #374 removed `@auth_required` from a number of routes and changed
those which used their `v` parameters to `v=None` and removed the `v`
parameter from those which didn't internally use it. 1841134b47

PR #392 re-added `@auth_desired` to those routes to ensure the
templates rendered with awareness of the current logged-in user
(matters for search, header bar, etc). 9f042c1aeb

However, 500 errors occurred on /random_post, /random_user, /id/<uid>,
and /u/<username>. Those were the four which had their `v` parameter
removed entirely. This has been re-added, which fixes the bug.

The way to understand auth_required vs auth_desired is that they are
nearly identical, with the sole difference than auth_required
checks if v is None and aborts with 401 if so. This means that
auth_desired routes must handle the v=None case. They are the same in
that they always try to give a `v` kwarg to the decorated function,
which was the root cause of those four routes erroring.

Recommended style: the vast majority of routes which return a rendered
template should be auth_desired, because the top-level templates often
draw extensively from `v` state even when the route handler does not.
When a route is either auth_desired or auth_required, it should have a
`v` parameter, which we typically give as the first positional
parameter.
2022-11-06 03:11:59 -06:00
justcool393
7970b17574 caching: fix CSRF
this removes the ability to do a GET to dump the internal cache but i've added a button to the admin panel that makes it so you can do it
2022-11-02 23:51:33 -05:00
Ben Rog-Wilhelm
387f5e4f62 Fix: Bug introduced with comment security fix 2022-11-02 01:38:43 -05:00
justcool393
7ff138f6f1 modlog: fix 500 when clicking on an action and then clicking on an admin, if that admin doesn't have any admin actions of that specific type 2022-10-30 20:19:09 -05:00
justcool393
0d4662588e
fix bug that could put comments in wrong submissions
this could let users bypass exiles or other checks

see also: Aevann1/rDrama@d61eda8
2022-10-30 20:17:35 -05:00
Inire
08a98429e0 Change hidden score placeholder from ? to empty string 2022-10-28 03:55:07 -05:00
Inire
0991dc7ed2 Fix a bug where voting shows NaN when voting on a post or comment with a '?' score 2022-10-28 03:01:18 -05:00
Ben Rog-Wilhelm
4197aded0e
Support non-logged-in admin contacts. (#377) 2022-10-27 22:16:42 -05:00
electricwhisk
9f042c1aeb
Stay logged in on certain routes (#392)
This commit adds the @auth_desired decorator to
routes that previous had the @auth_required decorator,
but had it removed in #374. This should cause
the user to remain logged in on these routes.
2022-10-27 22:16:22 -05:00
FatherInire
b46ada9f72
Fix some deprecations and factor out a helper function (#387) 2022-10-27 22:15:48 -05:00
Inire
4bdfe28a35 remove .pyc files 2022-10-27 21:54:07 -05:00
Inire
e4cf2f7b52 Support The Motte 2022-10-27 21:54:07 -05:00
Inire
bb34723a81 Support -> Support Us 2022-10-27 21:54:07 -05:00
Inire
4e2047624b Hide votes for posts and comments under 24 hours old 2022-10-27 21:50:08 -05:00
Ben Rog-Wilhelm
120e299f46 Update CSP to allow Google Analytics. 2022-10-19 06:29:02 -05:00
Ben Rog-Wilhelm
f04c79799e Try copypasting the Google tag again 2022-10-19 05:43:13 -05:00
Ben Rog-Wilhelm
877b572c66 Add Google Analytics (hopefully correctly) 2022-10-15 11:33:28 -05:00
DinoInNameOnly
d354b0713d Allow search and other pages for logged out users 2022-10-14 06:26:08 -05:00
DinoInNameOnly
f36a0b88e2 Add RSS Link 2022-10-07 13:56:23 -05:00
DinoInNameOnly
67a83ba0a8 Allow viewing the popup card 2022-10-07 13:53:37 -05:00
Ben Rog-Wilhelm
e6de172dea Add max-width for posts and comment blocks. 2022-09-27 18:43:48 -05:00
Ben Rog-Wilhelm
bf116115e2 Fix: Reporting comments is broken. 2022-09-27 18:43:20 -05:00
Ben Rog-Wilhelm
9939a382a3 Adjust starting color for colored comment bars 2022-09-26 03:32:51 -05:00
Julian Rota
563f3df7c5 Refactor reasons into a shared template 2022-09-26 03:07:48 -05:00
Julian Rota
0e5bf61d73 Add reasons to report screens 2022-09-26 03:07:48 -05:00
Ben Rog-Wilhelm
8cd6548620 Change bar coloring period to 8 and adjust colors. 2022-09-26 03:06:57 -05:00
Michael House
0bfbf17e45 Implemented collapse bar colorization on the server side 2022-09-23 22:11:55 -05:00
DinoInNameOnly
d62b6e8215 Improve search icon 2022-09-22 01:12:27 -05:00
DinoInNameOnly
39a56b52ea Make entire format buttons clickable 2022-09-22 01:11:03 -05:00
christopher morris
37396d42b5 remove email from admins contact form 2022-09-22 01:09:16 -05:00
Galen Huntington
0889d71647 Fix "view more comments" when not sorting by new. 2022-09-22 00:58:52 -05:00
Ben Rog-Wilhelm
41e5f38d19 Add the Support page. 2022-09-19 06:43:42 -05:00
faul_sname
65a68c214c [themotte/rDrama#336] Remove CSS that breaks nested lists in comments 2022-09-17 05:12:25 -05:00
Ben Rog-Wilhelm
a38bc0cb65 Change comment collapse icons to be dark-on-light for improved readability. 2022-09-16 01:07:42 -05:00
Ben Rog-Wilhelm
2aa8a4bc10 Reintroduce the new post guidelines. 2022-09-16 00:59:04 -05:00
Michael House
0a3222bff0 Changed cursor to pointer when mousing over collapse bar 2022-09-15 04:30:13 -05:00
painejohn
99d67e95dc 143: Fix ordered list rendering
The `linefeeds_regex` doubles every newline character. However, when
that happens, it turns tight numbered lists into loose numbered lists.

Context: https://stackoverflow.com/a/43505265

Going with solution proposed by @TLSM since the forum already has
production traffic.
2022-09-13 20:14:50 -05:00
Julian Rota
c16cf799ed Change Android background color from pink to white 2022-09-13 19:45:37 -05:00
Michael House
c4b5fe2913 Added filter for logged out users 2022-09-13 09:43:27 -05:00
TLSM
716f078e81 Fix 'hot' sort intermediate value out-of-bounds.
Fixes #321. Due to the extremely large quantity of comments on a
typical Motte post, 'hot' sorting logic underflowed an intermediate
value. Roughly:

  |(-1 000 000) * (103 [votes] + 1 + 2723 [comments] / 1)| > 2^31

We resolve this by reducing the coefficient from 1e6 to 1e5, which
reduces precision of intermediate calculations somewhat, and by
dividing #comments by 10 rather than 1, which better matches Motte
user behavior regardless: Users comment much more often than vote.
This buys us two orders of magnitude more headroom before out-of-
bounds. Shouldn't be an issue until the CW thread reaches ~200k
comments.
2022-09-12 12:16:54 -05:00
TLSM
ccabc8b881 Change default RSS sort to 'new'. 2022-09-12 12:16:54 -05:00
Ben Rog-Wilhelm
d8462a4a32 Reduce favicon size. 2022-09-12 06:11:24 -05:00
Ben Rog-Wilhelm
a083b4618b Fix: Logo aspect ratio broken. 2022-09-12 06:11:24 -05:00
TLSM
cc70c9e20f Remove conflicting widths set for #logo. 2022-09-12 06:06:43 -05:00
Ben Rog-Wilhelm
c5ed98bad9 Explicitly set width and height for every graphical element. 2022-09-12 00:54:22 -05:00
Ben Rog-Wilhelm
2d31f0e9b5
Switch main site font over to Verdana. 2022-09-11 23:18:29 -05:00