Commit Graph

17 Commits

Author SHA1 Message Date
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
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
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
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
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
83533b5fb4 Add post and image deletion
This one was kind of a doozy. This also adds a custom 403 error page and
fixes some permission denied behavior that I was having issues with for
a while.

This is also set up in a way that hopefully will allow me to easily
implement user post deletion.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-13 15:19:20 -07:00
ab749359fa Add admin capcodes
Sometimes, it is necessary for an admin or other moderator to reveal
themselves. Capcodes allow them to do so by appending a special colored
portion at the end of their name on a post.

This adds object-level permissions, so if you have a moderator who
shouldn't be able to use the "admin" capcode, you can give them
permission only to the "moderator" capcode.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-06-28 21:37:45 -07:00
29dff20db9 Add django-guardian for object-level permissions
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-06-26 21:30:45 -07:00
e596d59e82 Trying out JSFrame for windows
Winbox has this annoying bug where you can't move the window below the
calculated area of the document, so you can't drag it over blank space.
JSFrame fixes this and does basically what we want as well. This has
been implemented for post replies and I am going to implement it for
reports and ban creation too.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-06-25 20:42:10 -07:00
36f73a2d31 Add configurable report and ban window timeouts.
On the success page for bans and reports, the window can now be
configured to close after N seconds if desired.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-06-24 16:21:41 -07:00
61e852da60 Allow SAMEORIGIN for X-Frame-Options
This was causing issues for iframes used by the Winbox library, it's
now fixed.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-06-10 18:38:05 -07:00
6e2c29ae29 Add hcaptcha support and .env file
hcaptcha can be turned on in settings.py with parameters in the .env
file

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-05-07 14:51:26 -07:00
fe8ea04d18 Add support for i18n and l10n
The majority of the words on the site are user-generated, but I've tried
to surround everything else with localization calls. I don't know
another language so this will have to do until someone decides to
translate it lol

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-05-07 14:19:06 -07:00
6ed47f9957 Add max image upload size limit
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-05-04 21:14:00 -07:00
e6c60ff93c Add image upload support
Images can be uploaded, thumbnails are created, they're displayed within
the threads themselves. Just like four chans!

There is not an upload size limit set yet. Gotta get on that next.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-05-04 19:45:36 -07:00
126db039e2 Initial commit
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-05-03 18:02:04 -07:00