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>
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>
* BoardMixin adds a cached property that gets the current viewed board -
this assumes that there is a self.kwargs["url"] value available.
* can_modify now checks for some more permissions.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
* Boards can be locked from allowing posts - this is can be useful for
things like archived boards or locking down in the event of an
emergency
* Some validation checks for new posts are from the reply/thread form to
the Post model's clean() method
* Add some new tests, I've really been falling behind on those
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
I was surprised to see that the site is already pretty mobile-friendly.
The main issue was the quick reply, new thread, and report
windows - they were all hard-coded to be 500px, 500px, and 360px wide
respectively. Now, those hard-coded widths are the default but if the
viewport is thinner than that, the new window will size itself down with
some padding.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
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>
This prevents all stickied threads from having their own bump order. We
want stickies to all stay in the same order.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
can_modify needs to be present in order to load the modify.js script.
This wasn't present on the PostView and was on a couple of unnecessary
views.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
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>
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>
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>
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>
If a user had a permaban, there would be a comparison error between the
current time and the expiration time (none).
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
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>
The artist formerly known as CreatePostView is a little more generic now
and outsources its ban check to a new util method, is_banned.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
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>
* 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>
This is done in the admin view and opens a new iframed window. The ban
form is pretty barebones and doesn't have full functionality yet, but
that is coming.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
If a user had a ban previously, range-ban or single IP, which has since
expired, they will not be redirected to the "you are banned" page and
the active bans are deleted.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
Users can be banned by IP address now, either by singular IP or in an IP
range. If they are banned and attempt to post, they will be met with a
"you are banned until X date" screen.
There are a few loose threads with this, and IP bans may be obsolete if
I decide to go the accounts-required-for-posting route. But I think this
is a good start for 4chan style posting.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>