Commit Graph

147 Commits

Author SHA1 Message Date
a1123aad2b Add padding to post_reply element
This adds a little space around the each reply on a post.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-29 22:24:48 -07:00
a4d920d33e Add reply highlighting and post reply list.
If a user hovers over a reply link to a post, it will highlight that
reply (if it exists). Also, all replies to a post (that are visible) are
added as another element to that post.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-29 22:21:02 -07:00
ede216789b Add reply highlighting
If a user hovers over a reply link, that reply is highlighted.
Obviously, this is only useful if the reply is on-screen.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-29 21:09:19 -07:00
b84ca6d84f Add Youtube embeds
This will embed a youtube video inline on the page. Hopefully it works!

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-29 19:59:10 -07:00
b7cc4c5681 Remove unneeded print
Accidentally left old debug code in there

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-24 12:35:29 -07:00
000efdaec6 Add ReplyBuilder.matches method to check if the current remaining string starts with the given prefix
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-23 18:14:01 -07:00
939227e1f0 Add ReplyBuilder tests
The ReplyBuilder does stuff like parsing >quotes, >>replies, and
[spoiler]spoiler tags[/spoiler]

We mostly want to track consistent behavior with this

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-23 18:12:45 -07:00
5164842289 Add blank=True for Post.user_token
This was preventing tests from passing and having a blanked-out user
token, which is OK

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-23 18:05:04 -07:00
c22eff1676 Add spoiler escape
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-20 01:26:41 -07:00
83e0a5b84e Add spoiler tags
Boards can have spoiler processors enabled on them now.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-20 01:18:06 -07:00
b299f4f548 Fix small posting bug
User name may not always be filled out and that causes errors if not
set

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-20 01:00:48 -07:00
d4cef8d552 Add board.hidden migration
whoops

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-20 00:45:02 -07:00
8c6c05b264 Add hidden boards
Hidden boards are excluded from the board listing.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-20 00:43:22 -07:00
d5cfe81978 Add TRIPCODE_SALT setting to settings example
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-20 00:29:34 -07:00
c53111ea60 Add user tripcodes
Users can separate their name and a password with ## to create the
illusion of consistent posting.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-20 00:28:02 -07:00
8f4b6d7aea Add navbar to home, news, and rules pages
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-19 22:34:58 -07:00
6b5632d483 Add home, news, and rules links to nav bar
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-19 22:34:26 -07:00
68d2d26b46 Move board navbar to be in the board and post view only
While it's a neat idea to put it on every page, it was also appearing on
*every page* - including stuff like "delete post" page and reply windows
and stuff.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-19 19:50:22 -07:00
7c73d1ff36 Remove debugging message from reports context processor
Whoops!

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-19 19:47:33 -07:00
60441aa5d9 Add initial navbar
This includes all boards, as well as report counts if the user is an
admin.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-19 19:45:36 -07:00
2fd9b17b37 Add news_snippet.html
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-19 19:08:15 -07:00
b2cb1536c1 Add recent news header to boards and posts
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-19 18:59:25 -07:00
d15816fdc4 Add reply to this thread link to the bottom of the post view
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-18 22:09:11 -07:00
1173cc16cb Add 25px margin to top and bottom of threads on the board
This should hopefully visually separate things a little better.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-18 19:38:04 -07:00
769ab10c59 Add client_max_body_size to nginx conf
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-18 19:17:42 -07:00
08b4fe0086 Fix post ordering in reply view
I think this was database-specific. Replies should now be ordered by
their ID.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-18 19:10:04 -07:00
0847ea310c Add some forwarding options to nginx and some log stuff to uwsgi
* nginx needs to add X-Forwarded-For and REMOTE_ADDR headers to get the
  IP address properly
* uwsgi now logs 400 errors and adds the REMOTE_ADDR to the log file

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-18 18:31:41 -07:00
77bc4bbfc9 Add db and static directories to .gitignore
* db directory in root usually holds production data and causes git to
  complain about not being able to read it
* static directory in root holds the collected static files which are
  regenerated/collected at build time

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-18 17:06:12 -07:00
c4f910c6a8 Add files necessary for production deployment
* Dockerfile, docker-compose template
* nginx config
* uwsgi config
* wait-for-postgres script
* requirements.txt
* Some other stuff

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-18 17:04:37 -07:00
cde051653d Add STATIC_ROOT for static files on the filesystem
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-17 20:15:56 -07:00
258b8b955b Rename settings.py -> settings.example.py
When a new deployment is created, or when new settings are added, we
want to avoid overwriting settings that may already be present. So we
use the settings.example.py file for default settings and settings.py
for deployment settings instead.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-17 19:55:43 -07:00
08acfa327c Add initial migrations
I was putting this off during initial development so that experiments
and toying around with models would not be saved in the history,
especially if rebuilding the entire database was required. Now that the
models are in a more stable place, we can start tracking migrations.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-17 19:50:47 -07:00
412ae8f632 Add "boards" context processor
This adds the "boards" context data to all pages, so they can render the
boards nav page.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-17 19:49:17 -07:00
a5ba36e049 Add HTML minification
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-17 19:31:59 -07:00
0bc7a043ea Add new rule
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-17 18:55:02 -07:00
89849cf034 Add site title to all pages
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-17 18:53:56 -07:00
1da0e87c54 Add site name config, settings context processor, and site branding to every page
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-17 18:17:31 -07:00
4709f5567e Add home and rules pages
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-17 18:16:30 -07:00
b40b65bef6 Add restricted.css for future styles that are accessible by admin-only
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-17 17:49:12 -07:00
bd970943de Add user IP and token to posts in-line for staff
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-17 17:48:12 -07:00
0b0c0fe603 Update wipe to check user token as well as user IP
Wiping is done via a single user post. It will search for all posts by
that IP address *or* user token and delete them.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-17 17:02:51 -07:00
1856adaf3b Add user post wiping
If a user has spammed a lot of posts and made a mess of the board, this
will allow us to delete all posts by the offending user from the same
IP.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-17 16:59:23 -07:00
8ea95a927c Move modify.js + ban.js => restricted.js
Further in on restricted JS to simplify things. Rather than breaking out
all Javascript stuff into their own granular files, this just includes
all admin actions together in the same file.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-17 15:56:44 -07:00
1a2ac653d7 Fix /banned/ page redirect error
The URL routing for /banned/ was going to the board controller because it
would match /banned/ as a board URL rather than its verbatim value. This
is fixed by moving the board route match to the bottom of the URL
routing list.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-17 15:47:46 -07:00
794db714de Remove can_modify context variable, use is_staff instead
For both ban and modify actions, we trust staff users to not abuse
otherwise-secret scripts and links. We don't supply "can_modify" context
variable anymore and just use user.is_staff instead. The same goes for
ban links and scripts.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-17 15:32:10 -07:00
e686c3b235 Add ActionSuccessView
ActionSuccessView is a a generic view that indicates that something was
successful, e.g. deleting a post or banning a user. This hopefully
reduces the amount of boilerplate code used for creating success pages
since most of them can derive from this generic view.

The report and delete success views are updated to use this directly.

The ban and modify success views are updated to derive from this class,
with special permissions required.

The post success view is updated to derive from this class, using a
different template.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-17 15:08:33 -07:00
bfd3dedb09 Better positioning of ban window
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-14 00:08:56 -07:00
996e75dc2a Add news posts
You know. For basic information.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-13 23:01:51 -07:00
a4f00e6242 Add user post deletion
Users can delete their posts as long as they don't clear their cookies,
and as long as server-side user sessions are persistent.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-13 21:28:07 -07:00
96e8b7752f Yet more unnecessary field removal
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-13 15:44:52 -07:00