Opened 8 years ago

## #2385 new enhancement

### Description

I like this macro.

Nice if possible to:

• enfasize the comment itself instead of the text "Comment by..." ie: don't use bold on this text or chage the color to grey (like the one appears on this page at "Description Preview" box)
• change date format to YYYY-MM-DD hh:mm:ss (hh = 24 formated time)
• presentation could it be one of this ways:
• <user> commented this on YYYY-MM-DD hh:mm:ss
• Comment added on YYYY-MM-DD hh:mm:ss by <user> (this I guess would be preferable)
• an user option to expand / collapse comments

Documentation improvements

Renders this

Include here a screenshoot


Nice Work!!

P/S:

• That's my 2cents. Feel free to contact me in case of doubts (or if weren't clear :( ).
• the "clear/explicit" issue is because beginers like me need more recipes to be more efficients. I think givin all the tips on the same place improves user satisfaction. But if the guideline is to be DRY, forget abbout this particular comment.
• BTW I installed and it worked nicely.

### comment:1 Changed 8 years ago by athomas

• Owner changed from athomas to cboos

### comment:2 Changed 8 years ago by athomas

• Owner changed from cboos to osimons

Err, whoops.

### comment:3 follow-up: ↓ 4 Changed 8 years ago by osimons

The macro has some inherit problems doing custom display in that it just inserts text into the wiki page, and will render like any other text on the wiki page. That is why custom styling and comment folding and such will likely not get done as part of the macro in its current incarnation as the macro cannot influence that rendering.

The point about date/time formatting though is very relevant actually - as the text gets inserted into the wiki markup regardless of locale it may also soon inherit the locale of the user making the comment. It may indeed be a good idea to use a common, more or less international, way of rendering the time in a uniform manner. I'll add that to my todo list.

Lastly, the feedback on the wiki page with instructions and info: It is a wiki page, editable by everyone. If you as a user feels something is missing, then by all means just edit the page to add whatever you find out that may help others use the macro. Be my guest :-)

### comment:4 in reply to: ↑ 3 Changed 8 years ago by osimons

The point about date/time formatting though is very relevant actually....

Well, look at it and it probably isn't such a good idea now anyway. The formatting uses the server locale setting - with many ways to override it and use your own. That means it will also follow the other similar Trac datetime points. See wiki:TracFaq#how-do-i-change-the-format-used-for-displaying-date-and-time.

I think it is preferable to just leave it until this gets redone for 0.12 following Babel introduction and such.

BTW, enclosing a patch that gives you what you requested, but it won't make it to the repos anytime soon.

 # If we are submitting or previewing, inject comment as it should look if cancomment and comment and (preview or submit): heading = tag.h4("Comment by ", authname, " on ", to_unicode(time.strftime('%c', time.localtime())), to_unicode(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime())), id="commentpreview") if preview: the_preview = tag.div(heading, if line.find('[[AddComment') == 0: newtext += "==== Comment by %s on %s ====\n%s\n\n" % ( authname, to_unicode(time.strftime('%c', time.localtime())), to_unicode(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime())), comment) submitted = True newtext += line+"\n"

### comment:5 Changed 8 years ago by LK <leho@…>

• Cc leho@… added; anonymous removed

Ability for user to select the height of edit box, like trac built in wiki editor, would be very nice.

### comment:6 Changed 8 years ago by LK <leho@…>

If you preview a page with AddComment? in it, it shows me two button toolbars on top of each other in the add comment box.