I've made a sub-page because I have some fairly lengthy suggestions for changing the Comments2 macro. I'm not proposing to change the core functionality in any way, but merely to tighten up the user interface in various ways.
Contents
User Interface
The following images are screenshots of the current version and mockups of how I envision a slightly tweaked user interface.
This is mainly just collecting the buttons and misc. fields together in one place. When someone has read an article or information page, they usually have a comment in the front of their mind -- Let them write that first and then worry about their name, password and emoticons later
There is no need to show the password field when the user is logged in since it cannot be changed anyway. The password field in my version is fairly short (to save space), but this is not a very high security item so tho password doesn't have to be very long.
Anonymous posting
I would further suggest that the user be allowed to enter a message without entering a password. The comment would still appear in the list of comments, but the user will be offered a random password that can be used to delete the message later. This makes it easier to quickly enter a message without having to understand what the password feature is. When entering a message without a password, the following message could appear:
You did not enter a password. Your message has been posted and the following random password has been generated for you: h75sfjAh If you wish to delete your message later, click the red X and enter this password. |
That will make it self-explanatory and next time the user can pick his/her own password, or just ignore it again.
HelpOnComments page
An optional help link or help icon could be placed within or near the comments area (the latter doesn't require any change to the macro). This lead to a separate page in the wiki with a brief explanation of the comments feature, including the password and the smileys. Example:
Visit HelpOnComments for more information.
A wiki admin installing the comments feature would also copy this page into the underlay directory (unless the comments macro makes it into the default install ...). The contents of a sample HelpOnComments page is pasted follows:
- The comments box provides you with a simple way to add your comment to a wiki page. Just enter your name and a comment, then click save. Optionally you can enter a password so that you can delete (or edit and re-post) the message later.
Smileys
You can also select a smiley from the drop-down box. The following symbols are available.
- Here's a minimalist proposal for when you are logged in:
If you want to have multiple comment areas on one page, reducing the size of the GUI is important. -- AndyCrews 2024-11-25 16:59:29
Yes, saving vertical space is a good idea. I agree that you don't need to show the user name for logged in users, but you've also skipped the smileys You could add the dropdown box above the Save button like:
- but then you will be forced to use 2 lines (or 3?) for the entry box, when you might just want one. What you really want is to have a few pre-selected smileys appear as radio buttons like:
This feature could be enabled by a parameter like smileys=1 and similarly flags=1. Which symbols are included in each of those lists could be defined in an array at the start of the PageComments.py file. -- HenrikOmma
These look good to me. I'm using the wiki in a corporate setting, and the comments will most often be about Specs, so the smileys are not exactly essential. I'm happy if there is a flag to disable/enable them. --AndyCrews
I prefer the icons in the last screenshot -- SeungikLee 2005-11-22 18:22:35
I think that all the suggestions are very valuable to this macro. Before updating the macro, could you please try make and upload an HTML template (sample static html codes) for the screen of pagecomment input form and comment list in order for me to use it in the new version of the macro? Thanks in advance. -- SeungikLee 2005-11-24 15:58:39
I've made some HTML code: http://www.omma.net/PageComments It works for me locally, but YMMV. The image links should be replaced with local ones.
Comment Layout, Numbered Comments, and Permalinks
It is helpful for the comments to be numbered so people can refer to each other's comments and carry on conversation or rebuttal. This is how WordPress does it and I really like it. Also, I like their overall layout which I duplicated below (minus the bullets). Here is another layout link
- Comment first
- Comment by Yompkee | 12/21/2005 - 5:00 pm
- Comment second
- Comment by TroyK | 12/21/2005 - 5:30 pm
- Re: #2....... I know someone named Troy too.
- Comment by Yompkee | 12/21/2005 - 5:50 pm
- Re: #1 I see you managed to make the first comment. Good job!!
- Comment by DavidD | 12/21/2005 - 6:10 pm
Also, if the time (5:00 pm) is hyperlinked with a unique link or anchor, that would enable people to link to particular comments. It certainly isn't essential, just a "nice to have" feature.
Hide /PageCommentData from Navigation bar
If I have Navigation(children) macro in the page I see /PageCommentData in it. Is it posible to hide this link?
Try to use pagename paramter. Create a redundant page for comment only e.g., CommentsForMyPage. And insert [[PageComment2(pagename=CommentPageForMyPage)]] into MyPage. BTW, it should be patched that the history for adding a comment is linked to CommentsForMyPage not MyPage if you added a comment at the MyPage. -- SeungikLee 2006-04-13 09:05:41
Thanks for solution. Could you add option to name created subpage with the name of original page? E.g. if I insert [[PageComment2(pagename=CommentsFromAllPages,dynamicname=1)]] into FrontPage I get CommentsFromAllPages/FrontPage as comments storage. PS Is there macros or so to add my username and current datetime here?
Use section parameter. Use @SIG@ for signature. -- SeungikLee 2006-04-13 10:28:32
Is it posible to make smth like shortcut for lame users who don't want to type [[PageComment2(pagename=CommentsFromAllPages,section=ThisPage)]]? One more question: where can I change defaults used by this macro? -- AlexanderChemeris 2006-04-13 17:32:31
Modify the default values in the source, esp., in getparams() function. -- SeungikLee 2006-04-13 19:48:36
Bugs
- I can't get pagename to work. I used pagecomment(pagename=...) to put comments on a page that is included in another page. When I'm on the page itself,the macro works; when I'm on the included page, the macro fails. That is:
- I have Program/Ideas and Program/Ideas/SomeIdea
SomeIdea has pagecomment2(pagename=Program/Ideas/SomeIdea) on it
- Program/Ideas includes all of its children.
from SomeIdea, the macro works.
- from Ideas, I see the comment box and I see comments, but when I try to add a comment, I get an error that Program/SomeIdea#pagecomment1 doesn't exist.
- Somehow, the macro drops the middle part.
- FIXED: I found a solution (though I don't know if it breaks anything else):
- Line 514 sets Globs.cursubname from the curpage. That fails because it gets sets to the included page, not the calling page.
Change it it Globs.cursubname =
- Now the POST url will be just "#pagecomment1" (for example), which works no matter what.
First comment added is not shown. It seems he then creates the page but not the actual comment. i have to write another comment to be added.-- JureKodzoman 2006-05-10 07:34:47
- More info. on this one... It appears that comments added when there is a #preview in the url are not accepted. This occurs just after you have saved the page, but have not cleared the "thank you" message. The use of the #preview parameter is a bit confusing, as it could either mean that you are previewing or that you have just saved. My guess is that the macro is intending to ignore comments added while viewing an actual preview.
Sorry for your inconvenience. It's because of using formid in PageComment2 which allows to insert two or more page comment macros in a page. If one page comment macro is used, the 'formid' value stored in request object is incremented by 1; next with 2, the other next with 3, and so on. Using this formid, the macro can get to know if the posted input is entered from its input form or not. Strange to say, however, just after editing a page, there was some cases that the formid is not incremented in request object in moinmoin 1.3.5 version. But in the moinmoin 1.5.3, there is no such problem at least in my wiki. To check this out, please let me see your wiki page which includes that problem or you see the html source of the page and the formid is properly configured. For example, search the html source file to get the following text: <a name="pagecomment1"></a>. '1' here indicates the formid. Compare this value of the #preview page and the one of normal page. If they are not same, the formid increment does not work properly. Let's get some digging-up after this check'n. -- SeungikLee 2006-05-11 09:31:01
I observed the same problem. If I add the comment to the page which displays acknowledging message, no comment is added. Typical scenario: a) I edit the page to add PageComment2 macro and save it, b) I enter some comment, c) no comment added. I use standard moinmoin 1.5.3 (debian package) with rightsidebar theme (wiki.schemingmind.com, if it matters). Maybe rightsidebar theme matters? -- Mekk 2007-03-01 19:47:00
- More info. on this one... It appears that comments added when there is a #preview in the url are not accepted. This occurs just after you have saved the page, but have not cleared the "thank you" message. The use of the #preview parameter is a bit confusing, as it could either mean that you are previewing or that you have just saved. My guess is that the macro is intending to ignore comments added while viewing an actual preview.
Problems
When i delete comments, the wrong comment get's deleted. I have set cfg.datetime to cfg.date to display only date. Now I see comments get references by date. Can this be separated? The way they are displayed, and the way they are deleted? Or could they be deleted by some id other than date?-- JureKodzoman 2006-05-10 06:59:52
- Epoch second value generated from mktime method could be a better key for a comment but it could cause a problem on the backward compatibility with the previous versions of pagecomment2. I'll take it into considerations on the next update. BTW, for quick resolution, try to make it remained as it does but change how to display the datetime as follows: Modify the showcomment() function as the following (around 862 line)
htmlcommentitem = u'\n'.join(htmlcomment) % { 'cellstyle': cellstyle, 'icon': getsmiley(item['icon']), 'author': converttext(item['name']), 'text': converttext(item['text'], item['markup']), #'date': item['date'], 'date': formatcfgdatetime(item['date']), 'delform': htmlcommentdel }
using this utility function (just append this code at the end of macro file),1 def formatcfgdatetime(strdatetime): 2 import datetime 3 request = Globs.macro.request 4 try: 5 EpochSeconds = time.mktime(time.strptime(strdatetime, request.cfg.datetime_fmt)) 6 except ValueError: 7 return strdatetime 8 now = datetime.datetime.fromtimestamp(EpochSeconds) 9 if request.user.datetime_fmt: 10 datetime_fmt = request.user.datetime_fmt 11 else: 12 datetime_fmt = request.cfg.datetime_fmt 13 # OR custom datetime format 14 #datetime_fmt = '%B %d, %Y' 15 return now.strftime(str(datetime_fmt))
Good luck -- SeungikLee 2006-05-11 09:31:01
- Epoch second value generated from mktime method could be a better key for a comment but it could cause a problem on the backward compatibility with the previous versions of pagecomment2. I'll take it into considerations on the next update. BTW, for quick resolution, try to make it remained as it does but change how to display the datetime as follows: Modify the showcomment() function as the following (around 862 line)
Using MoinMoin in team environment, the PageComment2 macro has the problem of it's /PageCommentData pages #acl set to All: . Since none of my team users are allowed to view all pages, only the wiki admin can search through page comments. It would be nice for the /PageCommentData to have the same acl as it's parent. (This would clutter the RecentChanges page a bit - but it's worth the annoyance) RemcoBoerma 2008-02-25 10:25:00
CSS Idea
Instead of using hardcoded styles, please consider using CSS styles which can then be defined in screen.css? Or perhaps to make it someway that CSS stylsheet defined values override hardcoded styles. The problem is now that hardcoded values override those in css although classess are defined. I understand that not everyone has the will to edit CSS, especially if he uses more than one theme, but if it could be made to satisfy both it would be great -- JureKodzoman 2006-05-10 06:59:52
I'm sure that the macro goes with css at the future updates. Thanks. -- SeungikLee 2006-05-11 09:31:01
I took a stab at this in the patch I just posted in ../Patches. Take a look and see if it does about what you had in mind. I don't know if I got all of the hard-coded stuff out of the .py and into the .css, but it's at least a start. Regards, GlenWhitney 2007-01-07 02:10:00
Internationalisation?
How can be the macro messages easily translated to other languages? How could we make the macro better for wikis written in other languages than English? -- JózsefJároli 2007-03-26 10:51:41