Contents
MoinComments
Description
This is a collection of macros that enable blog like user comments on page by page basis. I'm developing this macros here.
The following macros are defined:
<<AddComment>> - This macro will display a comment input form;
<<ApproveComments>> - This macro should be placed on the page defined in the configuration variable comment_approval_page. The comments are temporally stored on this page. The macro will refuse to work on other pages, this allows to use the MoinMoin acl to control the access to this page and thus the moderation;
<<Comments([PAGE])>> - This will display the comments available in PAGE or if PAGE is absent, on the current page;
<<CommentsAdmin>> - this is an optional macro, it will display how many comments are waiting for moderation - only to the wiki administrators;
To install all you have to do is copy the py files under macro to your macro directory.
Configuration
You may define on your wiki configuration the following options:
Option |
Description |
comment_moderate |
(Default: True) If enabled the comments will be copied to a moderation queue and have to be accepted/rejected by a moderator |
comment_moderators |
(Default: None) Mail new comment notification to a list of comma separated email addresses, use None to disable (available in svn r35) |
comment_subscribed_notify |
(Default: False) If true the users that subscribe the page where the comment was posted will be notified. |
comment_passpartout_group |
(Default: PasspartoutGroup) MoinMoin user group. The users defined on this group will not be moderated or have captchas shown. |
comment_approval_page |
(Default: CommentsApproval) This is the page name where the moderation queue is shown. Please note that the 'ApproveComments' macro must be present somewhere on this page. Also, this page is not auto-created, you have to create it at set the appropriate ACLs on it. |
comment_store_addr |
(Default: False) If enabled the commenter IP address will be saved in the comment file. |
comment_cmt_per_page |
(Default: 50) Number of comments to show per page. After this number pagination controls will be shown. |
comment_recaptcha |
(Default: False) If enabled the user will have to fill out a captcha (of the reCAPTCHA variety). Naturally if you want to use a reCAPTCHA you must also provide the following configuration options. |
comment_recaptcha_public_key |
(Default: None) String with the reCAPTCHA public key |
comment_recaptcha_private_key |
(Default: None) String with the reCAPTCHA private key |
comment_recaptcha_use_ssl |
(Default: False) Make the reCAPTCHA requests using ssl |
This options should be defined on the wiki configuration file. None of this options is mandatory.
Download & Release Notes
Download |
Release Version |
Moin Version |
Release Notes |
0.1 |
1.8 |
- |
|
0.2 |
1.9 |
- |
Usage
On the pages where you want to have comments you must include:
<<AddComment>>
This will display a standard dialog to enter blog like comments.
To display the comments use:
<<Comments()>>
This will display the comments on the current page.
If you choose to have moderated comments you have to create the page where the moderation will take place. By default this page is: CommentsApproval on that page you must have the ApproveComments macro somewhere.
Wishlist
Feel free to add features you want to see implemented on these macros. Note that I can't promise that all features will be implemented!
Make the form and the comment display user configurable by using a configuration option (just like the page_header1 option, for example); r60
If the user is logged on the name field on the create comment form is preloaded with the user's name. The user can change this name. r36
If the user is logged in force the comment name field to be the same has user name;
Addition: force the comment name field to be the alias name, but save user name in comment file
Allow comments only if the user has write permission; r53
Allow comments only if the user is logged in; r50
- Threaded comments;
Recognize a given group that will not be moderated or to whom a reCAPTCHA isn't shown. r38
This is done. The default group is the PasspartoutGroup group.
Notify the page subscribers when a new comment is added or approved; r39
- Interface to administer approved comments:
- delete comments;
- have a hide/unhide flag in the comment data;
- anonymise a comment
A new macro (or option) to list all approved comments, either sorted by date, or grouped by page (in which case, display only last N) -- PascalBauermeister 2010-09-18 17:22:29
- Comments display:
In the emitted html table, emit some class attribute, so that CSS entry can decorate it (e.g. add borders to separate copmments) -- PascalBauermeister 2010-09-19 06:30:20
On r58 we no longer use a table, I think it's easier to style this way. Maybe I should add also a div to enclose the entire comment (header + post). -- HelderGuerreiro 2010-11-07 22:53:53
Copyright
Copyright © José Lopes, HelderGuerreiro
License
GPL
Bugs
In comments.css is a bug, that supresses the cell boarders of a table with border-style: none !important;.
Instead of of one .comments_form th, td { it must be two blocks with .comments_form th { and .comments_form td {.
-- RudolfReuter 2012-03-09 14:43:42
Discussion
I gave a try. Great work, I must say! Here is my feedback:
- This is a great approach to let people who don't know wikies leave comments.
File macro/Comments.py, svn revision 31, line 128:
max_pages = ( number_messages / cmt_per_page + (1 if number_messages % cmt_per_page else 0 ))
made my Python complain. I changed it to
if number_messages % cmt_per_page: offset = 1 else: offset = 0 max_pages = ( number_messages / cmt_per_page + offset )
I did an @import of your supplied CSS into mine, but it completely messed it up. I should take time to investigate a bit more.
- A clickable link (with some javascript behind) to show/hide the Add Comment box would be nice, because it takes a lot of space. Hidden by default.
- All labels of the Add Comment box should be configurable.
- The comments should be displayed in a much more compact way.
- When a new comment awaits approval, an e-mail should be sent to a user specified in the config.
- When a new comment is accepted, an e-mail should be sent to all users subscribed to the page.
If you plan to implement (some of) the above, but lack time, please just ask me for help. -- -- PascalBauermeister 2009-09-26 20:06:36
- Glad this is useful to you!
- About point 2, the conditional expressions are only available since Python 2.5 I think. I'll change that.
About the CSS it's being used on an ongoing project. It does some nasty things, better not use it at all. If you have a suitable CSS to MoinMoin 's default theme I'll take it!
About point 4,5 and 6 I think we could make the form and the comment display user configurable by using a configuration option (just like the page_header1 option, for example). What do you think?
- About 7, 8 I think they are good ideas.
- If you're willing to implement some of this I don't mind at all.
- I have also a few ideas that I want to implement, my only worry is that these macros become too bloated, so I'm pondering whether to implement them or not:
- Do not ask for the user name if the current user is logged on the system;
- Have a group of users that aren't moderated and/or to whom a reCAPTCHA isn't shown;
-- HelderGuerreiro 2009-09-26 19:07:18
update - implemented the mail notification in svn r35!
-- HelderGuerreiro 2009-09-26 21:43:18
- Thanks for your prompt answer!
- CSS: I might do one more or less quickly, and I'll send it to you
- 4,5,6: excellent idea in wikiconfig.py! I suggest formatting strings allowing to define wiki text containing keywords
- Your other ideas are cool (and I also agree that hard decisions have to be made to become not too bloated)
Concerning me implementing some parts, it's up to you to ask me if you need me. If not, no problem (I'm quite busy anyway )
-- PascalBauermeister 2009-09-30 17:45:11
- Hi Helder. I tested r35...
- for me, name not pre-filled when the user is logged... Maybe it is because of how I use the macro (see below)
I integrated the comments list and entry to *every* page, by /IntegratingIntoTheTheme
See http://ten.homelinux.net/productivity for an integration example.
-- PascalBauermeister 2009-10-06 05:56:53
- Hi! sorry for the late reply, I've been a bit busy lately. Replying in order:
- That feature wasn't implemented yet. Now it is...
- It's very slick the way you've integrated the comments into the theme!
- I've added a 'wishlist' section to this page to summarize this discussion
-- HelderGuerreiro 2009-10-11 17:21:12
- Hi! sorry for the late reply, I've been a bit busy lately. Replying in order:
- Hi, I tried this macro at 1.9.1, but wiki responded below messages:
<<AddComment: Execute Fail ['AllContext' object has no attribute 'request_method'] (see also the log)>>
- Is it not compatible with 1.9.1? -- numoone
- I've ported the macros to 1.9.x, tested with 1.9.2 but not very thoroughly. Any feedback is welcomed!
-- HelderGuerreiro 2010-04-03 00:27:47
<<AddComment: Ausführung fehlgeschlagen ['AllContext' object has no attribute 'request_method'] (siehe auch die Log-Datei)>>
- with 1.9.3. Any idea?
- I've tested with 1.9.5, no problems.
Have you created the !CommentsApproval page? Make sure you're using version 0.2 or else the latest svn version.
Get the error traceback from the logs and send it to me.
-- HelderGuerreiro 2012-09-28 14:38:03
- Thanks for your prompt answer!
Hello José, thank you for that very useful macro. I found a new application: Contact Email. That avoids spam (no need for a captcha), and you can moderate the text too.
In the file wikiconfig.py you add 2 parameters:
comment_moderate = False comment_subscribed_notify = True By the way, it would be nice to update the file INSTALL with the new parameters.
Then you title your macro AddComment with Contact Email and subscribe the page. Text to insert into the page:
=== Contact Email === <<AddComment>>
When the user clicks on Send comment, the subscriber of the page will get the comment message as an Email.
Beware, when you test that function, you have to log out before you send, otherwise no Email will be send, because a notification Email is not send to the owner of the page.
-- RudolfReuter 2011-03-16 17:16:25
Great Work! -- DuffDave 2011-09-14 18:47:17