google-code-export / sct-project

Automatically exported from code.google.com/p/sct-project
1 stars 1 forks source link

Allow admin and users to remove posts #182

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I've created a patch that allows user (post author) and Admin to remove
posts. In fact, posts are not removed but hidden: post.is_hidden=True.

Whole thing works this way:
'Delete' link is displayed near each post (by 'edit') while viewing Thread.
After clicking on it, confirmation page is displayed, if confirmed, post is
hidden.

Admin is always allowed to remove (hide) a post.
Post author is allowed to remove his post only if specific time has not
passed (new SPH_SETTING: board_hide_timeout similiar to
board_edit_timeout), and only if there are no newer posts in same thread
(to ensure that qutoations still have sense).

Also, I've fixed wrong permission check in annotate view (it checked for
allow_moving instead of allow_annotating) and generated new translation
files for en and pl languages.

Diff for post deleting (hiding) is attached together with compiled polish
translations file .mo

Original issue reported on code.google.com by pigle...@gmail.com on 10 Dec 2009 at 10:08

Attachments:

GoogleCodeExporter commented 9 years ago
thanks for the patch. i have committed it in rev. 1040

although there might be a small problem - when deleting the root post of a 
thread
which already has replies in it, it will create dead links (because the replies 
are
not deleted when you view the history of a users' post those replies would show 
up..)
- one possible solution would be to delete all posts in a thread when the root 
post
is "deleted" (err.. hidden) .. but for now i'll keep it the way it is.. i don't 
think
it is a major problem.

btw. if you like you can tell me your real name, email address and/or website 
so i
could include you into the AUTHORS file as well (you can send it to my email 
address
herbert.poul@gmail.com ) - thanks again for your patches :)

Original comment by herbert....@gmail.com on 13 Dec 2009 at 9:49

GoogleCodeExporter commented 9 years ago
Herbert, your'e right. I've created new issue with fix to mentioned problem.
http://code.google.com/p/sct-project/issues/detail?id=183

Original comment by pigle...@gmail.com on 13 Dec 2009 at 10:47