Commit graph

15398 commits

Author SHA1 Message Date
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
TLSM
f1983da8d4
Fix long domains overflowing post-meta (#182).
In submissions and submission_listings, long domains would overflow
the container and generally break everything. Fixed in the template
by truncating the outputted text length and in the frontend by
enforcing a maximum width on the element.
2022-08-17 01:52:38 -04:00
TLSM
345ef7b5e7
Change distinguish color to red (#181). 2022-08-17 01:43:23 -04:00
TLSM
4cfd1d5a5b
Fix 2FA modal not displaying in UI (#178). (#180)
Fixes issue #178. Root cause was attempting to document.getElementById
of both modal and toggle input before both were loaded into the DOM.
In the upstream, Cloudflare's Rocket Loader is used, which papers over
many cases of inattention to loading order.
2022-08-16 22:38:19 -05:00
painejohn
defe23ea16
Update comment reply css + clear preview as well (#158)
This basically extends the CSS changes from
https://github.com/themotte/rDrama/pull/150 to also cover comment
_replies_ and then updates the JS from
https://github.com/themotte/rDrama/pull/153 to also reset the comment
reply preview div back to default after posting the comment reply.
2022-08-10 06:04:54 -05:00
Michael House
b5b1f79394
Merge pull request #155 from zorbathut/pr_deussy
Remove culture-warrish instances of `ussy` and `igger`.
2022-08-07 11:11:32 -05:00
Ben Rog-Wilhelm
ade79962b5 Include another section that somehow got lost 2022-08-07 10:19:26 -05:00
Michael House
8570b92d3d
Merge pull request #156 from zorbathut/pr_examplecull
Remove obsolete formatting help.
2022-08-07 08:02:19 -05:00
Michael House
8f4393f56d
Merge pull request #157 from zorbathut/pr_demarquee
Remove marquee support from the formatting, because, uh, no.
2022-08-07 08:01:29 -05:00
Ben Rog-Wilhelm
da19c8cb11 Remove marquee support from the formatting, because, uh, no. 2022-08-07 02:28:35 -05:00
Ben Rog-Wilhelm
d377889a13 Remove obsolete formatting help. 2022-08-07 02:26:59 -05:00
Ben Rog-Wilhelm
d844b6c340 Remove culture-warrish instances of ussy and igger. 2022-08-07 02:09:05 -05:00
painejohn
cbcc2aac6f
139: Disabled multimedia embedding
This change disables multimedia embedding:

- In comments and comments replies.
- In new submissions.
- In comment & submission preview

And it's all toggle-able via an envvar, except for the JS bits,
but I linked those to the github issue, so should be easy to find
in the future.

The way it works is:

- removes markdown image/video syntax,
  eg. `![](https://example.org/someimage.jpg)` into ``
- changes link text into anchors, eg.
  `https://example.org/someimage.jpg` into
  `[https://example.org/someimage.jpg](https://example.org/someimage.jpg)`
- removes html img/video/audio tags, eg.
  `<img href="https://example.org/someimage.jpg" />` into ``
- when embedding gifs via the giphy modal in "new submission", it will
  insert only an anchor to the gif
- when attaching an image, it will upload the image, then add only an
  anchor to the post/comment body

I tested this manually, but not sure if I got all the test cases. What I
checked was:

- create comment w/ image/video/audio media using markdown -> success
- create comment reply w/ image/video/audio media using markdown ->
  success
- create comment w/ link to img/imgur/youtube/audio -> success
- create comment w/ attachment -> success
- create comment reply w/ attachment -> success
- create comment w/ img/video tag -> success
- create comment reply w/ image/video tag -> success
- create post submission w/ image/video/media using markdown -> success
- create post submission w/ link to img/imgur/youtube/audio -> success
- create post submission w/ attachment -> success
- create post submission w/ giphy gif -> success

Also, updated the formatting page.

Co-authored-by: Ben Rog-Wilhelm <zorba-github@pavlovian.net>
2022-08-07 01:30:47 -05:00
painejohn
8463a9ebbe
135 - Posting a comment clears out comment textarea & preview 2022-08-07 01:17:46 -05:00
painejohn
4e8fef2ef0 115: Add cap on number of mentions
This caps the number of mentions in a submission or comment to
MENTION_LIMIT, which is set to 100 by default. When limit is exceeded,
returns a helpful message to the user.
2022-08-07 00:54:47 -05:00
Michael House
416294b112
Merge pull request #148 from zorbathut/pr_sitename
Split SITE_NAME into computer-readable SITE_ID and human-readable SITE_TITLE.
2022-08-01 15:55:14 -05:00
Michael House
10b5823721
Merge branch 'frost' into pr_sitename 2022-08-01 15:21:56 -05:00
Michael House
2def49ccbd
Merge pull request #147 from zorbathut/pr_welcome
Update welcome message.
2022-08-01 15:14:29 -05:00
painejohn
19385b249f 141 - Comment preview is obviously a preview
This PR reworks the comment preview to include a border and initial
message identifying it as "Comment preview". It also bumps all the
TheMotte.css versions from 56 to 57.
2022-08-01 14:39:03 -05:00
Ben Rog-Wilhelm
800ae8d2dc Split SITE_NAME into computer-readable SITE_ID and human-readable SITE_TITLE. 2022-07-31 18:53:18 -05:00
Ben Rog-Wilhelm
8c818adbd2 Update welcome message. 2022-07-31 18:21:12 -05:00
Julian Rota
850d175563 Fix editing posts 2022-07-31 17:22:43 -05:00
Julian Rota
96563c6d35 Add check for user existing 2022-07-31 16:58:01 -05:00
JulianRota
64a8582adc
Merge pull request #142 from zorbathut/pr_sidebar
Update sidebar.
2022-07-29 15:57:03 -04:00
Ben Rog-Wilhelm
7393013f60 Fix ACX link. 2022-07-29 14:32:27 -05:00
Ben Rog-Wilhelm
7b4a4f21d0 Update sidebar. 2022-07-29 14:30:06 -05:00
Ben Rog-Wilhelm
01f5e2362d Revert site name change because it breaks stuff; will change it some other way 2022-07-29 10:08:24 -05:00
Ben Rog-Wilhelm
2948d66a81 Remove the site name from the OpenGraph description. 2022-07-29 10:02:29 -05:00
Ben Rog-Wilhelm
309564cb3d Update site name and description. 2022-07-29 10:00:59 -05:00
JulianRota
cc85b28288
Merge pull request #123 from zorbathut/pr_linearvote
Make downvotes actually reduce user karma.
2022-07-29 10:17:18 -04:00
painejohn
0e165e17c0 Fixes #110 "Signout doesn't always work"
I tried reproducing the issues from #110 but without luck. The
workflow looks a little like this:

- User changes their avatar.
    - This triggers a POST request to the profile endpoint.
- User clicks "Log out" from the dropdown menu"
    - This triggers the post_toast function in js that makes a POST to
      /logout, which clears the user's session. Then, on receipt of the
      response, the js calls `location.reload`, which replays the
      browser's last action, which in our case is the earlier POST
      request to the profile endpoint. This is why the browser asks
      whether it's OK to resubmit the data _again_. Agreeing resubmits
      the first POST request.
    - After `location.reload`, since the user is no longer logged in,
      they either get a 405 (from the profile edit page) or a 500 (from
      the profile overview page).

This PR then changes the `/logout` endpoint from POST to GET, then
updates the header template to change the "Log out" anchor to simply
link to "/logout" instead of calling any js.

Reasoning behind it:
- logout doesn't modify server-side resources, so it's safe to make it a
  GET request.
- Making it a GET prevents the browser from ever displaying the "data
  resubmit" warning window.
- The "/logout" endpoint can now simply redirect to the homepage.
2022-07-29 06:47:19 -05:00
JulianRota
f495981a5e
Merge pull request #122 from zorbathut/pr_fixvote
Fix voting.
2022-07-26 23:19:33 -04:00
JulianRota
7c86c88c68
Merge pull request #121 from zorbathut/pr_hidevotes
Hide vote details from non-admins.
2022-07-26 23:16:08 -04:00
Ben Rog-Wilhelm
2595ed7fc0 Remove dead references to DEFAULT_IMAGE. 2022-07-26 03:35:55 -05:00
JulianRota
56df7482ac
Merge pull request #125 from zorbathut/pr_defortune
Remove the #fortune feature.
2022-07-24 17:36:47 -04:00
Ben Rog-Wilhelm
5023ca8ada Fix: Upvoted/Downvoted link visibility was based on the viewee, not the viewer. 2022-07-24 06:01:16 -05:00
Ben Rog-Wilhelm
e28a486da9 Update annoying magic numbers. 2022-07-24 05:52:31 -05:00
Ben Rog-Wilhelm
42412ed40b Redesign the comment/post voting code and properly support standard votes. 2022-07-24 04:37:44 -05:00
Ben Rog-Wilhelm
6aedb62cd9
Replace formatting examples with less, uh, culturally specific examples. 2022-07-23 12:38:47 -05:00
Ben Rog-Wilhelm
f789252794 Remove the #fortune feature. 2022-07-23 06:00:38 -05:00
Ben Rog-Wilhelm
17d550f00e Make downvotes actually reduce user karma. 2022-07-23 05:52:54 -05:00
Ben Rog-Wilhelm
0082434458 Fix voting. 2022-07-23 04:41:47 -05:00
Ben Rog-Wilhelm
19e9c1a20e Hide vote details from non-admins.
It is intentional that the links show up on admin level 2 but aren't usable until admin level 3; I don't know what I want right now and I want to encourage admins to pester me about it.
2022-07-23 03:04:43 -05:00
Julian Rota
81610b803a Support settings for integers and allow setting filter settings in UI 2022-07-09 06:33:41 -05:00
Julian Rota
bd5fd8fb21 Switch over comment reporting to use the new system 2022-07-09 06:33:41 -05:00
Julian Rota
a0488f2b23 UI to allow update of comment filter status 2022-07-09 06:33:41 -05:00