Commit graph

15804 commits

Author SHA1 Message Date
justcool393
f4d74a9071 Swap comment search to be the default 2023-07-22 23:19:27 -05:00
justcool393
a5a344f084
fix duplicate ~new~ indicators being sent (#642)
we also make the JS we're generating about 7% the size it was before.
2023-07-22 19:52:09 -05:00
justcool393
2541737833
remove extra divs (it seems we never needed them in the first place?) (#627) 2023-07-22 19:50:39 -05:00
justcool393
7e68277eb6
Don't show users post content from users they've blocked (#639) 2023-07-22 19:47:44 -05:00
sovejero
4ff52b5ac0 fix header dropdown menu sidescroll 2023-07-22 19:46:13 -05:00
justcool393
672745ee6c
combine 5 different post/comment filter state adjustment routes (#637) 2023-07-22 19:34:08 -05:00
Viet Than
2edaec6933
🏦 Database Change: convert commentflag's created_utc to created_timestampz (#615) 2023-07-20 23:48:19 -05:00
TLSM
c519a1a292 fix: filtered posts on frontpage listing
Desired behavior for new posts when FilterNewPosts setting is enabled
is that people with admin_level >= 2 and post authors should see their
post on the frontpage, while all other unprivileged users shouldn't.

The logic for this is already in `files.helpers.listing` but it was
overridden by a second filter condition which required `state_mod =
VISIBLE`.

`(state_mod = VISIBLE | author_id = v.id) & (state_mod = VISIBLE)`
simplifies in an unfortunate way. The latter condition was also not
conditional on admin_level. Simply removing it fixes the listing
for both post authors and privileged users.
2023-07-20 21:41:29 -05:00
justcool393
a2aa7353fc
fix the stats page (#630) 2023-07-20 20:19:22 -05:00
justcool393
c8964b272e use permissions constant instead of literal 2 2023-07-20 20:18:48 -05:00
justcool393
88c202ba3d style: tabify for consistency 2023-07-15 23:35:08 -05:00
justcool393
fde5840be4
reformat submission_banned.html template (#629)
it's kinda hard to give a good description but this fixes a bug where
the raw HTML of a post's content (not mediated by `realbody`) is being
sent to the `submission_banned.html` template. it also fixes the
formatting.
2023-07-15 23:34:18 -05:00
justcool393
1b590cefd7
remove unnecessary !important in unread rule...
thereby showing deleted/removed things again in context view
2023-07-13 16:57:23 -05:00
justcool393
8191d5a4cf
rename fullnames
Handle a couple places with `t3_` that persisted from code movement.
on master after time of branch.

Then, fix commenting, which used inaccurate fullname parsing logic.
2023-07-13 14:37:28 -05:00
justcool393
db1f578f26 simplify visibility states using the new visstates
because of #606, we now have a relatively decent way of representing
how post/comment state is in the database. we'll use this in our code
which is used to determine what is shown in the UI
2023-07-13 14:13:13 -05:00
sovejero
099d15b59b make switch button on settings visible for theme 2023-07-13 12:24:29 -05:00
sovejero
285cb2b50c add unsoported theme tag and missing div 2023-07-13 12:24:29 -05:00
rudyon
d3ea7b510e
removes a line that broke hard line brakes intentionally to fix Markdown implementation fails to produce hard line breaks properly #440 (#591) 2023-07-13 12:16:40 -05:00
justcool393
231c0f420f
Refactor auth forms (#624) 2023-07-13 11:50:26 -05:00
sovejero
a5807efb75
refactor: simplify email template and adjust theme #131 2023-07-13 11:48:25 -05:00
TLSM
6fde14a92c Use reddit-style notifs without context
The notifications schema is already set up for reddit-style
chronological notifications. We simply have to remove the logic that
builds the context and patch up a few places in the frontend that
were expecting full reply trees.

`Comment.header_msg` previously expected the user's own comment to
be top-level in comment replies. Logic is revised to expect the actual
reply.

`files.routes.front.notifications_main` now has reduced query volume
because we aren't expiring the session when marking notifications read.
This also allows us to remove the unused `comms` variable, which is a
makeshift "pattern" of storing duplicate database replies across a
commit so the templates don't requery (thus losing data attached to
the runtime object, like `c.unread` / `c.notif_utc`).

We move the `is_notification_page` flag to the route callers rather
than templates checking `request.path`.

Minor UI style: "Clear all notifications" -> "Mark All Read", since
this was a persistent point of user confusion upstream, with people
expecting their inbox to empty out. Also less margin between notifs
to be consistent with tighter comment display elsewhere and removed
need to separate groups of comments vs single comments.
2023-07-12 00:24:50 -05:00
TLSM
695e6b6dbd Split notification routes, hard wrap, sort order
Change the notifications subpages to be distinct route handlers with
actual paths rather than query parameters. They already were a massive
conditional chain with almost no common logic.

Hard wrap some of the more egregious query lines. Use less duplicated
code for shadowban exclusion.

Only major functionality change which is somewhat related to #476 is
to sort subtrees by Comment.id DESC. Otherwise, upstream is
substantially the same as TheMotte. Given that upstream didn't
experience #476, I think the issue may have been resolved by prior
changes to filtering / comment visibility & moderation.
2023-07-12 00:24:50 -05:00
TLSM
edafe22024 Remove unused reddit mentions notifications
In the distant past, the codebase would check pushshift for keyword
mentions and generate notifications to admins about them. I can't
find where we removed it, but I don't think it was ever operative.

Since these notifications don't get generated, we don't need a
notifications page for them.
2023-07-12 00:24:50 -05:00
sovejero
75950e9466 fix: change logo image to text 2023-07-11 21:46:43 -05:00
TLSM
fdc6fa4181 fix: username popover listener on comment reply
Fixes #612. Ports in an existing working fix from upstream with
the change to bs_trigger. Also a stylistic improvement on the
preceding line I noticed while porting it.

bs_trigger is what attaches the event listeners for the Boostrap
popovers. It wasn't being called on the new elements, so they get no
user card. It is now, so it does. Calling it on the comment form
element doesn't work here because, unlike in an earlier stage of the
codebase (which I think the fork occured during the transition of)
put replies into a dedicated element rather than replacing the reply
form.
2023-07-09 13:38:29 -05:00
Ben Rog-Wilhelm
ccf809406e Rejigger the Mod/Report state system. 2023-07-01 21:06:40 -05:00
Ben Rog-Wilhelm
31ebdd0213 Fix: Toggling comment removal breaks stuff. 2023-06-25 04:15:10 -05:00
Ben Rog-Wilhelm
2f0a3fc278 Terminology change: instead of "banning" comments or posts, remove them. 2023-06-23 22:32:11 -05:00
Ben Rog-Wilhelm
c610c60dc0 Fix: Datetime behavioral issues. 2023-06-23 21:30:19 -05:00
Ben Rog-Wilhelm
bd909f394d Convert to timezone-aware datetime and properly port over DB contents. 2023-06-23 21:30:19 -05:00
Ben Rog-Wilhelm
5271e7c943 Move 'deleted_utc' into 'state_user_deleted_utc' and change types. 2023-06-23 21:30:19 -05:00
justcool393
e03eef1a12 Add filter approve and filter remove actions to mobile 2023-06-20 05:54:23 -05:00
Ben Rog-Wilhelm
52bcb85950 Clean up remove/approveCommentDesktop2 functions into something a little more comprehensible. 2023-06-16 12:45:29 -05:00
Ben Rog-Wilhelm
9d088cf93c Add volunteer frequency histogram code. 2023-06-12 21:16:21 -05:00
Ben Rog-Wilhelm
f42974dcd7 Add pyenv token to make development a little easier. 2023-06-12 21:16:21 -05:00
Ben Rog-Wilhelm
e9ca6e3239 Filter out reports from permabanned users. 2023-06-03 18:41:48 -05:00
Ben Rog-Wilhelm
143eb36aaa
Bump Postgres version. 2023-05-13 16:35:10 -05:00
rudyon
063e8087a5
enhancment: Add ~new~ text to the header of new posts (#589) 2023-05-13 11:21:06 -05:00
rudyon
e6f5271181
Fix: Monospace line spacing issue.
Fixes #253.

i removed `overflow: auto` because it causes the codeblock to vertical scroll when the line height is decreased
2023-05-12 07:59:44 -05:00
Ben Rog-Wilhelm
ff1bdf9526 Update readme with a missing setup step. 2023-05-12 05:42:38 -05:00
Ben Rog-Wilhelm
c2eeb8b3e7
Fix: Issue where cron would end up in nested transaction blocks and unable to escape. (#586)
* Use sessionmaker instead of context block

Essentially there were two bugs:
1) The logging lines before explicit `Session.begin` caused the root
   "A transaction is already begun on this Session.", which is
   resolved by moving the logging within the explicit session block,
   as intended.
2) We were reusing a Session across cron runs. The architecture was
   intended to not do so, but we didn't have an actual sessionmaker
   available to cron. We probably ought to get rid of scoped_session
   elsewhere, but baby steps to resolve the immediate issue.

In testing, this works correctly with the fix to `db.begin`, and
tests with deliberately reintroducing the logging bug, the changes
to session creation prevent the every-15sec stack trace spam.

---------

Almost-entirely-authored-by: TLSM <duolsm@outlook.com>
2023-05-01 04:25:05 -05:00
Ben Rog-Wilhelm
94309ed257 Move tabulate import into local functions. 2023-04-30 02:14:55 -05:00
Ben Rog-Wilhelm
9d264dcf3a Implement mod-viewable janitor-generated badness stats. 2023-04-30 02:08:07 -05:00
Ben Rog-Wilhelm
8933f77bf5 Bring poetry changes up to date. 2023-04-25 06:40:32 -05:00
Ben Rog-Wilhelm
6fbcad7088 Proper support for Poetry's dev dependencies. 2023-04-25 06:40:32 -05:00
Ben Rog-Wilhelm
4552b817f5 Cron logging improvements. 2023-04-24 17:24:34 -05:00
Ben Rog-Wilhelm
d57dc96078 Fix: Minor typo in cron documentation. 2023-04-24 17:24:26 -05:00
Ben Rog-Wilhelm
639e85e4e7 Improved Python init format. 2023-04-22 05:11:36 -05:00
Ben Rog-Wilhelm
7ea3c81967 Add a cron_setup task to initialize code-defined cron tasks. 2023-04-22 05:11:36 -05:00
Ben Rog-Wilhelm
b4fecddf7b Add more Cron diagnostic logging. 2023-04-22 05:11:36 -05:00