Commit graph

15643 commits

Author SHA1 Message Date
TLSM
1d705588d4 Remove obfuscated auto-shadowban on keyword. 2022-09-05 23:44:18 -05:00
TLSM
70c8a942b6 Remove games.
Unfortunately not totally dead code paths, and special case behavior
for them complicated commenting and sorting logic in a number of
places.
2022-09-05 23:44:18 -05:00
TLSM
3e8904757a Remove coins from popovers, disable coin routes.
The last places coins were visible to non-admins were in user popovers
and, potentially, via direct access of /@<username>/coins. These have
been removed.

Additionally, there are a number of routes which, despite being removed
from the UI, were still operative and usable. These are disabled
pending possible(?) future uses of coins.
2022-09-05 23:44:18 -05:00
TLSM
dbaf0a1bfd Remove unused polls code to reduce query volume.
Due to use of Submission.{choices, options, bet_options} in realbody,
generating submission_listings resulted in extremely high volume of
SELECT queries.

In local testing with 6 posts, one of which had a poll with 2 options,
the removal of these calls reduced quantity of queries on the homepage
from 84 to 22.

Given that it was previously decided to remove the polls feature after
a regression while adding comment filtering, the remaining dead code
paths for polls were also removed.
2022-09-05 23:44:18 -05:00
Julian Rota
cf9819ca5b Hide the reply section after submitting a response 2022-09-05 12:03:16 -05:00
TLSM
bb142eda53 Change feed title to use human-readable SITE_TITLE. 2022-09-05 00:44:13 -05:00
TLSM
ef65a3f341 Fix #246: new comment counts on desktop listings.
Logic to provide new comment count indicators on submission_listings
exists but seems to have been lost on desktop (though working on
mobile) during some frontpage design changes. We now add it back.
2022-09-05 00:44:13 -05:00
TLSM
f86bb38154 Fix #245: hide styling for controversial comments. 2022-09-05 00:44:13 -05:00
TLSM
2f8afbf4f8 Reorder header icons to prioritize notifications. 2022-09-05 00:44:13 -05:00
TLSM
129d644a3f Add active user counter logic; add to admin tools.
Ports in lightly modified logic from the upstream which tracks active
sessions to provide counters and listings to understand site traffic
in the admin panel.
2022-09-05 00:44:13 -05:00
TLSM
ecbd8179b9 Fix #238: remove "Get Them Help" button. 2022-09-05 00:44:13 -05:00
TLSM
2077ac4f83 Port in valid RSS feed creation from upstream. 2022-09-05 00:44:13 -05:00
TLSM
e12b0eea1a Remove treasure rewards for comments.
Given that coins are not visible in many contexts, the conspicuous
appearance of treasure chests (random coin rewards on 1% of comments)
seems out of place. This removes the logic which rewards treasure,
the visible display of treasure, and drops the column containing
treasure information which has already been awarded to at least one
comment on prod.
2022-09-04 19:12:30 -05:00
TLSM
cccb26cb3f Fix contrast: blockquotes, prev/next, new comments.
Style changes in three contexts, especially for contrast/visibility:
  - Highlighting for new comments is now _much_ lighter.
  - Blockquotes display similarly to reddit-style: slightly muted
    text with a grey bar to the left but no background otherwise.
  - Prev/Next pagination for listings now readable and distinct.

Only applied to TheMotte.css, since it seems the one with complaints.
2022-09-04 19:12:30 -05:00
TLSM
b31e1874dd Fix #230: present pinned posts first in all sorts. 2022-09-04 19:11:42 -05:00
TLSM
fd3fd7e04e Fix Limiter not using remote address as key. 2022-09-04 19:11:24 -05:00
JulianRota
9657adbebf
Merge pull request #227 from TLSM/rework-assets
Rework assets to use automatic cachebusting (#127).
2022-09-01 00:28:39 -04:00
JulianRota
f1dada6c12
Merge pull request #226 from TLSM/pr-221
Clarify permabanned forbidden messages. (Fixes #221)
2022-08-31 23:50:20 -04:00
TLSM
a35697e55e
Replace nearly all ?v= cachebusts with assetcache.
Using the new assetcache module, we replace (almost) all instances
of `?v=` cachebusting query parameters in Python and in Jinja templates.
The primary exceptions were: user site backgrounds, and some
infrequently changed graphics referenced literally from .js files.
2022-08-30 17:02:46 -04:00
TLSM
6f3b995455
assetcache: add interface for non-Jinja consumers.
Rather than generating the URL in helpers/jinja2.py, we move the logic
to helpers/assetcache.py because there are consumers of asset URLs
in Python code (for better or for worse).
2022-08-30 16:23:09 -04:00
TLSM
fcb51c09d3
Implement assetcache module with asset hashing.
Provides a module `assetcache` to support automatic cachebusting of
static web assets, rather than the current approach of incrementing
a version number.

On module load, it walks the file/assets/ dir, computes a CRC32 of
each asset, and provides those hashes via `assetcache_get(path)` at
runtime. The primary consumer of hashes at present is the new `asset`
filter for Jinja2, which accepts a relative asset path and returns the
full path, with cache busting, suitable for final use in the template.

Ex: `{{ 'css/main.css' | asset }}`
2022-08-30 16:00:24 -04:00
TLSM
c00533dc6e
Remove unused copyrighted assets. 2022-08-30 14:59:23 -04:00
TLSM
b2773cbb40
Clarify permabanned forbidden messages.
Fixes #221. Provides custom message behavior for the user DM route
and slightly refactors the `@is_not_permabanned` wrapper to not be
deliberately misleading to users.
2022-08-30 13:35:02 -04:00
TLSM
e1244e9496 Fix flask-limiter having null limit_key.
Recently, unrelated changes led to enabling logging for flask-limiter
accidentally, at which point it was discovered that it wasn't actually
limiting requests due to Limiter.key_func = get_CF not being proper
for either prod (not behind Cloudflare) or localhost (likewise).

We instead use the remote_addr attached directly to the request using
the existing flask-limiter function to do so.

Detailed troubleshooting at:
https://github.com/themotte/rDrama/issues/222#issuecomment-1229489062
2022-08-30 06:37:56 -05:00
Julian Rota
27d48226de Remove lack of comment count increment if comment is a reply to self 2022-08-29 14:16:49 -05:00
Julian Rota
288183012e Fix misspelling of "culture ware" 2022-08-29 14:16:18 -05:00
Ben Rog-Wilhelm
de4d923b32 Fix some mod log errors and make it more durable to future changes. 2022-08-27 11:23:12 -05:00
Ben Rog-Wilhelm
74a21234b5
Make the Comments indicator into a link. 2022-08-27 06:33:05 -05:00
TLSM
de29d63a55 Improve tooltip legibility on TheMotte theme. 2022-08-27 06:15:38 -05:00
TLSM
0b332e31bf Fix timestamp tooltips not appearing.
Another JS load order bug, previously fixed upstream. bs_trigger() in
header.js must be run after DOM content is loaded to properly set the
events for tooltips to appear on hover. This commit uses standard
document ready event boilerplate to ensure this happens, regardless
of script load order.
2022-08-27 06:15:38 -05:00
JulianRota
d9044cca39
Merge pull request #211 from zorbathut/pr_visuals
Rejigger theme pretty heavily.
2022-08-22 23:41:46 -04:00
Ben Rog-Wilhelm
210d4d3bc1 Bump cachebusters 2022-08-22 22:14:21 -05:00
Ben Rog-Wilhelm
280e7275a6 Rejigger theme pretty heavily. I apologize for this change not being neatly split apart in any way. 2022-08-22 22:02:39 -05:00
Julian Rota
f4a8b78d56 Fix an error with trying to sanitize really ugly HTML 2022-08-22 09:55:14 -05:00
Julian Rota
2d03dd1984 Remove remaining gumroad stuff 2022-08-22 09:54:35 -05:00
JulianRota
b94ca993da
Merge pull request #205 from zorbathut/pr_signal
Improve signal timeout behavior (from upstream 548030fcf)
2022-08-21 16:20:30 -04:00
JulianRota
8fb730f847
Merge pull request #208 from jgbyrne/leaderboard
Only show /leaderboard link in settings2 menu to admins.
2022-08-21 13:04:11 -04:00
JulianRota
8338bcb640
Merge pull request #207 from jgbyrne/frost
Userpage template: Short circuiting non-null checks for viewing user `v`
2022-08-21 12:58:47 -04:00
JulianRota
1c49c04fb8
Merge pull request #200 from zorbathut/pr_closebox
Add close icon to the install-app popup.
2022-08-21 12:54:58 -04:00
Jack Byrne
2adf38a377 Only show /leaderboard link in settings2 menu to admins, also a more polite 403 message, also more readable HTML 2022-08-21 01:44:56 +01:00
Jack Byrne
866c47c914 Userpage template: Short circuiting non-null checks for viewing user v 2022-08-21 01:14:11 +01:00
Ben Rog-Wilhelm
be0cebe67a Improve signal timeout behavior (from upstream 548030fcf) 2022-08-20 03:56:26 -05:00
Ben Rog-Wilhelm
13da98bd08 Add close icon to the install-app popup. 2022-08-19 04:53:02 -05:00
Jack Byrne
6b53867ae1 Post validation: better length validation for post submissions 2022-08-19 04:19:41 -05:00
Julian Rota
f2d657811f Fix the other report button for posts on the comments page 2022-08-19 03:18:35 -05:00
Julian Rota
21c99261e6 Remove polls from help page HTML 2022-08-19 03:16:46 -05:00
TLSM
d005bd6237 Fix desktop header dropdown menu clipping off page.
The width of the account menu dropdown header is determined by the
length of one's username. Users with short names cause the dropdown
menu to partially clip off the right side of the page, which is
unsightly and impedes usage thereof. This commit enforces a minimum
width to prevent that.

Alternate approaches such as right-aligning the dropdown proved
unwieldy with CSS when fixing this same bug on the upstream.
2022-08-17 14:03:11 -05:00
TLSM
965a4dc157 Fix improper calls to Comment.replies.
In four contexts, Comment.replies(.) was not updated to reflect the
interface changes with comment filtering. This directly caused #170
and #172 (which was a stack trace from the former).
  - Updating notifications for DMs (routes/users.py L690)
  - Updating notifications for modmail (routes/users.py L729)
  - morecomments for logged out users (routes/posts.py L421)
  - JSON for API access (classes/comment.py L347)

All four contexts seem to behave correctly after the change. However,
strictly speaking the JSON generation will not include a user's own
filtered or removed comments, though this is hard to remedy without
passing the user object `v` to json_core. Propagating that through the
codebase seems a worse option than leaving it as is.
2022-08-17 14:01:31 -05:00
Ben Rog-Wilhelm
d4dd495b31
Merge pull request #183 from TLSM/issue-181-182
Fix #181, #182.
2022-08-17 13:59:45 -05:00
TLSM
a95f47339d
Cachebust main.css. 2022-08-17 01:55:44 -04:00