Opened 12 years ago

Closed 11 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 Christopher Allan Webber, 12 years ago

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 :)

comment:2 by David Thompson, 12 years ago

Owner: set to David Thompson
Status: newassigned

comment:3 by David Thompson, 12 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 Elrond, 11 years ago

We completely missed out on this one.

Ideas:

  1. Show comments, if they exist, always. If it's in the db, show it. (Elrond's razor)
  2. Instead of HTTPFound, maybe use return redirect(request, location=...). I think, we use that more often around in the code.
  3. 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 David Thompson, 11 years ago

Okay, so it took me awhile to find the time to hack on this again. But, here is the new branch!

https://gitorious.org/~davethompson/mediagoblin/davethompsons-mediagoblin/commits/453_disable_comments

I believe I have addressed all of Elrond's feedback. Let me know how it looks.

comment:6 by David Thompson, 11 years ago

Keywords: review added

comment:7 by Christopher Allan Webber, 11 years ago

Keywords: review removed
Owner: David Thompson removed
Status: assignedreview

comment:8 by Christopher Allan Webber, 11 years ago

Resolution: fixed
Status: reviewclosed

Heya. Great branch, this works perfectly. Merged!

Note: See TracTickets for help on using tickets.