Commit Graph

65 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
6ff64a3299 Rename {post_create,post_modify,reply_create}_view.html
This drops the _view suffix of each of these, makes it more consistent
and less of a chore to type.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-13 13:16:57 -07:00
f131c58d1b Add post hiding
This allows users to hide posts that they may find unsavory. On threads
themselves in the board view, this adds a minus/plus button that will
toggle back and forth if hidden. This also adds a post menu item that
will toggle a post being hidden.

This also changes the post snippet layout a little bit. This caused
minor issues with the other menu items, but it should be fixed in this
set of changes too.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-13 12:03:09 -07:00
089913c8fe Center some text on the board and post detail views
The board name and the "create new thread/reply" links are now centered.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-12 22:39:24 -07:00
925c17675f Add inline image expansion
Clicking an image will expand it.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-12 22:26:51 -07:00
0d6b6ca5b5 Add image hover
If a user hovers over an image with their mouse, it will load the image
and display it in the corner.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-12 22:02:51 -07:00
b646509f75 Update post information to come before the image info in a post
The post number, username, subject, etc all come before the an image (if
there is one) now, rather than sorta wedged afterwards. This seems to be
working.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-12 21:17:19 -07:00
3f1615f058 Add post count, image count, and unique posters to post detail
Just like 4chan has!!!!!!!

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-12 21:12:16 -07:00
5df21ccb95 Add poster name saving via cookie
When a user makes a new post with a name set, it will get saved via a
cookie to the user's client and it will automatically get set the next
time a user makes a post.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-12 20:28:21 -07:00
a3ebf75e83 Add thread locking and permissions
Mods can lock threads from replying now. Yay!

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-07-08 21:55:25 -07:00
b791cf6a6b Update various windows that open to have their height automatically set
Some windows have a variable height based on the user's permissions
(e.g. having a capcode option). This sets the window height to the
minimum requiremed height based on the document loaded in.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-06-30 20:37:19 -07:00
76f641a935 Remove some more old winbox references
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-06-30 19:31:37 -07:00
376066e55f Remove old winbox reference
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-06-30 19:31:18 -07:00
61b9e2a277 Merge report_window.js into post.js
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-06-30 18:44:58 -07:00
638d8cd349 Add bumplock to post modify form, and add set_bump permission
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-06-30 18:42:16 -07:00
0ac383ce6c Update PostModifyForm to use permissions to create its fields
Fields are only displayed via the PostModifyForm if the user has
specific permissions to do things, like set stickies.

Also, add PostModifySuccessView that will close the modify window when
the process is complete.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-06-30 18:16:08 -07:00
6f99472f16 Add post modify view
This allows moderators to modify posts (add sticky, etc).

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-06-30 16:21:36 -07:00
6c11d210e8 Add floating window for new threads
New threads get a floating window just like new replies have. This only
pops up on the board detail view.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-06-28 23:55:44 -07:00
6ad2a72b86 Remove old winbox JS include from base.html
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-06-28 22:48:58 -07:00
66f6093f9b Remove old reply form code
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-06-28 22:14:42 -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
d931f52f01 Move off WinBox to JSFrame
WinBox is nice, but it has this annoying bug that I don't feel like
figuring out how to fix. JSFrame seems to work much better, although
centering the window seems to be a chore. I'll figure it out soon
enough.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-06-26 20:52:47 -07:00
fb61239147 Add JSFrame implementation for report window
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-06-25 21:05:31 -07:00
4e60569cdc Fix blocktranslate issue in post_snippet.html
Can't use template filters, so this is fixed.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-06-25 20:51:56 -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
412045e015 Convert templates to use translate instead of localize
Not sure what the difference is but most things tend to use translate.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-06-24 15:56:36 -07:00
e30012d6d0 Remove old openBanWindow function
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-06-23 23:01:26 -07:00
024f0c1290 Move openBanWindow to its own separate file
It is now shared between the admin view and the inline view.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-06-23 22:58:31 -07:00
647aedfc67 Add in-line ban capabilities
Anyone with the ability to create bans can now do so via the drop down
menu on all posts.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-06-23 22:27:26 -07:00
1e61522f7a Delete posts after a ban is created for them
After a user is banned for a post, that post now gets deleted. There's
no way to turn this off yet.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-06-23 21:49:04 -07:00
a5510d9552 Add board selection to ban creation and post ID to ban model
* Board selection is allowed for when you want to make a global ban
* Post ID is added to ban model for referencing later

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-06-23 18:57:23 -07:00
b64559aba9 Add report record admin and template search
When creating a ban, you can type in to do a search, this is useful for
quickly banning users.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-06-23 18:16:00 -07:00