Opened 14 years ago
Closed 13 years ago
#453 closed enhancement (fixed)
Enable/disable comments option
| Reported by: | Jeremy Pope | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | |
| Component: | programming | Keywords: | bitesized |
| Cc: | Parent Tickets: |
Description
There should be the option to disable the comments as desired. My instance is a single user instance (and is planned to stay a single user instance) and until federation hits, the 'Add comment' is misleading to visitors since they can't actually add a comment.
Change History (8)
comment:1 by , 14 years ago
comment:2 by , 14 years ago
| Owner: | set to |
|---|---|
| Status: | new → assigned |
comment:3 by , 14 years ago
Added an 'allow_comments' configuration option to config_spec.ini. Comments are not displayed if this option is not set to True. POSTing a comment will result in a message being displayed if allow_comments is set to False.
Changes are in this git branch: https://gitorious.org/~davethompson/mediagoblin/davethompsons-mediagoblin/commits/allowcomments
comment:4 by , 13 years ago
We completely missed out on this one.
Ideas:
- Show comments, if they exist, always. If it's in the db, show it. (Elrond's razor)
- Instead of HTTPFound, maybe use
return redirect(request, location=...). I think, we use that more often around in the code. - Maybe do a rebase. The branch is quite oldish now?
If you're ready, add a "review" keyword to this ticket. That raises the chance of getting it merged a lot.
comment:5 by , 13 years ago
Okay, so it took me awhile to find the time to hack on this again. But, here is the new branch!
I believe I have addressed all of Elrond's feedback. Let me know how it looks.
comment:6 by , 13 years ago
| Keywords: | review added |
|---|
comment:7 by , 13 years ago
| Keywords: | review removed |
|---|---|
| Owner: | removed |
| Status: | assigned → review |
comment:8 by , 13 years ago
| Resolution: | → fixed |
|---|---|
| Status: | review → closed |
Heya. Great branch, this works perfectly. Merged!

I explained how to do this on IRC, so here's a lazy copy-pasta :)
<paroneayea> so you want to do three things: <paroneayea> 1) add the new config option to config_spec.ini which gives configuration defaults and etc <paroneayea> 2) there's a special way templates are gotten for the media items that's different than normal, but they all inherit from mediagoblin/templates/mediagoblin/user_pages/media.html'''''' <paroneayea> so open that file, find the section that has the comments, and you can use if tags to toggle display of that stuff by looking at values in the app_config (see the rest of the file, there are other app_config bits accessed) <paroneayea> 3) if comments are really disabled, it should probably be true that we disable being *able* to post comments, so address that in the media_post_comment view [16:01] <paroneayea> davexunit: that's my recommendation! <paroneayea> and I'll add it to the ticket as well :)