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.
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.
Moves behavior in api_comment that updates stateful counters and
generates notifications into a function which can also be called
if a filtered comment is approved. Fixes#272.
Incidentally, also fixes#278 by adding another filter to the post
subscribers query during general clean-up/refactoring.
Originally was going to move this function into the Comments model,
since assurances about state (even with side effects) should probably
be made there, but I couldn't find a sane way to untangle the imports.
Pending a more thorough comments rework, make comment listings denser:
- Reduce margin between comments from 28px to 3.5px.
- Reduce padding around comment text from 10px to 5px.
- Shrink comment-actions text size by 20% to maintain visual balance.
- Add some padding to frontpage list entries, because the size of
voting arrows was holding the size up. Should be about the same
as before action icons were shrinked.
Also wound up semi-unrelated fixing the comment nesting border-left
colors on TheMotte mobile, coffee, win98, dramblr, and midnight.
All changes tested most thoroughly on those themes.
Bug accidentally introduced with 70c8a942b6, when a removed clause
in Comment.collapse_for_user was treated as always True, rather than
as always False--which would've removed this entire line, as this
commit does now.
Original intent of the logic was for auto-collapsing game comments
like blackjack and slots that necessarily entailed somewhat spammy
commenting behavior.
Originally motivated by fixing #263 (add a mod list), the root cause
of which was that we had a number of orphaned pages, one being the
admins list.
In the upstream, we moved links to a number of infrequently-accessed
pages to a secondary nav in the sidebar. This commit implements a
similar approach to provide links to the admin list and modlog. To
make the nav less visually unbalanced, Random Post/User were also
moved out of the header.
To provide mobile support, this secondary nav is presented in the
hamburger menu. This also provides a place to link /rules, which
otherwise has no link on mobile (that I can readily find).
Finally, the original intent of providing a mod list motivates some
style changes to admins.html to get rid of visible truescore, make
names appear consistently with names elsewhere, and ensure links to
leaderboard aren't accidentally leaked.
Resolves root problem of non-admin users seeing comments they shouldn't
by JOINing on the appropriate fields and including them in the WHERE
clause of the query.
In the process, was also able to remove some unperformant queries
that used (potentially extremely long) lists passed to WHERE clauses in
lieu of proper JOINs.