Commit graph

418 commits

Author SHA1 Message Date
Ben Rog-Wilhelm
310c6c4424
Rig up chat to be suitable for a Doge election. (Hopefully.) (#692)
* Integrate chat from upstream

Substantially borrowed from upstream ref: 13a208ee88e55 (before they
started editing generated artefacts instead of source).

Integrated, including:
  - Remove previously removed features: emoji, hats, and name colors
  - Compensate for lack of unified root template
  - Add React build process to Dockerfile and `bootstrap/init.sh`
  - Preliminary integration of chat websocket workers

For testing, modify `supervisord.conf.dev` to put chat on port 80 and
the site service on some other port. Then visit: http://localhost/chat

Still to do:
  - Access control for specific small-groups (and admins probably):
    Set the values somewhere (site_settings.json? Redis?) and use for
    authorization in `chat_is_allowed`.
  - Proxying only /chat to the websocket workers
  - Chat persistance across restarts: either Redis devops or to DB

* Add nginx server to do appropriate redirection.

* Add necessary columns to User.

* Wire up chat permissions.

* Reload chat on source change.

* Add a better structure for slash commands and add/remove functionality.

* Stop putting up previews of slash commands.

* We require more whitespace.

* Strip DMs out entirely, I currently do not want to deal with them.

* Change "Users Online" to just "Users".

* Clean up a little more DM detritus.

* Save chat history in database.

* Remove unnecessary hefty query to the DB.

* Clean up optimistic messages.

* Initial implementation of notification icon.

* Update readme a little bit.

* Fix notification highlight (mostly).

* Remove chat version number that will never be updated.

* Fix: Errors on logged-out users.

* Add function to nuke the chat state.

* Update DB.

* Add a dedicated deployable docker image.

* Fix: init_build.sh execute bit not set.

* Whoops, screwed up the abort() call.

* Relax chat rate limiter.

* Remove a somewhat silly comment.

* Remove an unnecessary g.db.add().

---------

Co-authored-by: TLSM <duolsm@outlook.com>
2023-09-04 12:42:20 -05:00
justcool393
a3180fad2a
Make commenting the default (#646) 2023-07-24 06:07:17 -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
justcool393
77af24a5b1
remove holes (#492)
* remove holes

* don't import class that doesn't exist

* remove subs in template code

* remove subs_created

* fix sticky bug

* uh... i think this will fix it????

* fix stupid nearly ungrokkable nesting error

* ...

* ....

* ....

* *sigh*

* .............................i think i got it.

* Revert ".............................i think i got it."

This reverts commit 419a545875.

* Revert "*sigh*"

This reverts commit fcfc9d7995.

* Revert "...."

This reverts commit e200c8f6f0.

* Revert "...."

This reverts commit 681db8cb02.

* Revert "..."

This reverts commit c54372b9ff.

* Revert "fix stupid nearly ungrokkable nesting error"

This reverts commit e202fd774c.

* Revert "uh... i think this will fix it????"

This reverts commit e4d9366093.

* readd missing endif

* fix email templates.

* fix frontpage listing

* some minor fixes wrt saving

* fix some listing errors

* Remove more references to holes system

A couple of these came from the merge of #554. A few others were just
left in the templates and presumably hard to catch on the first
removal pass.

* remove unnecessary lazy

* Add migration

Tested. Very sensitive to order. I wound up borrowing the statement
order we used for deleting sub rows on upstream (manually, of course).

---------

Co-authored-by: TLSM <duolsm@outlook.com>
2023-04-01 00:13:30 -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
DinoInNameOnly
d62b6e8215 Improve search icon 2022-09-22 01:12:27 -05:00
Ben Rog-Wilhelm
41e5f38d19 Add the Support page. 2022-09-19 06:43:42 -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
Michael House
e097dc1e70 De-float navigation menu 2022-09-10 08:01:19 -05:00
TLSM
e0e4c79048 Add secondary navbar for orphaned pages.
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.
2022-09-06 12:40:20 -05:00
TLSM
2f8afbf4f8 Reorder header icons to prioritize notifications. 2022-09-05 00:44:13 -05: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
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
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
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
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
Julian Rota
81610b803a Support settings for integers and allow setting filter settings in UI 2022-07-09 06:33:41 -05:00
Michael House
1f6671ab55 Fixed desktop top menu bar icons 2022-06-05 17:14:29 -05:00
Michael House
e7c7fba0ad Fixed 404 on random user button and changed icons 2022-06-05 17:02:34 -05:00
Michael House
f3f2aa3935 Made a lot of small changes in the frontend 2022-06-04 07:48:26 -05:00
Michael House
058e50add7 Added new default text and default link thumbnails, color fixes for some buttons 2022-06-03 06:36:03 -05:00
Michael House
14633ac59c Added overriding styles for buttons and some new colors 2022-06-02 19:21:25 -05:00
Michael House
f7744334b6 Removed chat button 2022-05-27 05:19:29 -05:00
Julian Rota
10d8cf037d Remove all references to Marseybux, coins, and awards from UI only 2022-05-10 23:49:45 -04:00
Chris Drzewiecki
fd2630e0d1 Removed user listing and shop for non-admin users 2022-05-10 01:04:55 -06:00
iro84657
8c2ee6a57a Remove references to Android apps 2022-05-09 21:59:20 -04:00
iro84657
6a31b87c35 Remove links to rdrama.net and Aevann1/rDrama 2022-05-09 21:55:42 -04:00
Ben Rog-Wilhelm
1ee9c1bfa7
Convert text file line endings to LF. 2022-05-09 07:20:47 -05:00
iro84657
71743a3bfc Remove special cases based on SITE_NAME 2022-05-09 01:40:09 -04:00
Aevann1
8c77b36c33 sdf 2022-05-02 21:11:03 +02:00
Aevann1
d124c14a78 dfg 2022-05-02 21:10:49 +02:00
Aevann1
aa3d53f486 dfs 2022-05-02 03:06:20 +02:00
Aevann1
705af0d8fe sdf 2022-05-02 02:41:00 +02:00
Aevann1
495d6eb0b2 fsd 2022-05-02 02:02:31 +02:00
Aevann1
bd9ff67e74 sdf 2022-05-02 02:02:19 +02:00
Aevann1
f743de1666 jg 2022-05-02 01:51:47 +02:00
Aevann1
709a7fc4b5 sfd 2022-05-01 23:44:38 +02:00
Aevann1
314d0dd781 gdf 2022-04-29 15:36:33 +02:00
TLSM
060e19bfb0
Add dynamic journoid banner text. (#232)
The .srd header banner currently has fixed text. However, there have
been many gayops which have made the news. journoid_banner.html is a
dynamic template which selects a random one to present.

Also, stylesheets and markup for the banner have been unslurred.
2022-04-28 23:58:41 +02:00
Aevann1
a3170d2677 dsf 2022-04-28 03:38:17 +02:00
Aevann1
cb5fcd7a1d dsf 2022-04-28 02:45:49 +02:00
Aevann1
c8724bdae1 fds 2022-04-28 02:44:38 +02:00
Aevann1
259c2dd323 sfd' 2022-04-28 02:37:12 +02:00
Aevann1
a3832f4c5b fds 2022-04-28 02:04:01 +02:00
Aevann1
95a0130cc0 fds 2022-04-27 16:29:32 +02:00