Opened 17 years ago
Last modified 16 years ago
#2385 new enhancement
AddComment Improvements
Reported by: | Owned by: | osimons | |
---|---|---|---|
Priority: | normal | Component: | AddCommentMacro |
Severity: | normal | Keywords: | |
Cc: | leho@… | Trac Release: | 0.11 |
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
- Add an Installation section (could it be like this)
Note: Instructions on how to install a plugin: [http://trac.edgewall.org/wiki/TracPlugins
- Install MacroPostPlugin
- Enable through WebAdmin panel (this line is because that other macro isn't clear)
- Restart server
- Install AddCommentMacro
- Enable through WebAdmin panel (this line is because this macro isn't also clear/explicit)
- Restart server
- Install MacroPostPlugin
- Example:
[[AddComment]]
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.
Attachments (0)
Change History (6)
comment:1 Changed 17 years ago by
Owner: | changed from Alec Thomas to Christian Boos |
---|
comment:2 Changed 17 years ago by
Owner: | changed from Christian Boos to osimons |
---|
comment:3 follow-up: 4 Changed 17 years ago by
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 Changed 17 years ago by
Replying to 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.
-
0.11/addcomment/macro.py
81 81 # If we are submitting or previewing, inject comment as it should look 82 82 if cancomment and comment and (preview or submit): 83 83 heading = tag.h4("Comment by ", authname, " on ", 84 to_unicode(time.strftime('% c', time.localtime())),84 to_unicode(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime())), 85 85 id="commentpreview") 86 86 if preview: 87 87 the_preview = tag.div(heading, … … 105 105 if line.find('[[AddComment') == 0: 106 106 newtext += "==== Comment by %s on %s ====\n%s\n\n" % ( 107 107 authname, 108 to_unicode(time.strftime('% c', time.localtime())),108 to_unicode(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime())), 109 109 comment) 110 110 submitted = True 111 111 newtext += line+"\n"
comment:5 Changed 17 years ago by
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 17 years ago by
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.
Err, whoops.