New Comments Implementation
Last modified by Vincent Massol on 2024/11/19 16:12
Description
Comment Display
On the wiki page to which the content is added (original page)
- The "insert comment" field is always displayed at the bottom of the comments list
- That field can be displayed in between comments when clicking on the "reply" button (see example on the TechCrunch website / reference below)
- When adding a comment, the whole page is not reloaded
- The comment is added at the bottom of the page or under the reply-to comment using AJAX
- The total number of comments is listed in the "Comments" tab
- When displaying the page, comments are dynamically displayed with their comment number (that is different from their ID)
- If a comment that is the reply-to parent comment of another comment is deleted, the children comment takes the place of its parent on $originalDoc
- Children to that comment are not affected
All Users
- User picture if she has one / nothing otherwise
- User Name with either : link to his profile (if it's a XWiki User) / website URL (if she specified one) / no link (no URL / no profile)
- Date when the comment was posted
- Comment permalink
- Comment content
- "Reply" button at the bottom of the comment
- Once the reply button was clicked : insert comment content field
- Threaded comments (30 px margin on the left)
Logged Users
- Use the XWiki UserName of the user
- No Captcha
- "Add this page to my watchlist (you'll be notified of further comments to this page by email)" checkbox (not displayed if the page is already on the user's watchlist)
Guests
- Name (compulsory)
- Email (compulsory)
- Website / URL (optional)
- Captcha (compulsory)
Admins
- "Delete comment" button
On the individual page where the comment is stored
- Title of the page : "This comment belongs to the $originalDoc.title (fallback on $originalDoc.fullName) page"
- User picture if she has one / nothing otherwise
- User Name with either : link to his profile (if it's a XWiki User) / website URL (if she specified one) / no link (no URL / no profile)
- Date when the comment was posted
- Comment content
- "Reply to this comment" button -> sends the user to an input field located below that comment on $originalDoc
- "View this comment in context" -> sends the user to the comment on $originalDoc
- Permalink to this comment
- "Delete comment" button for admins
Technical Stuff
Comment Object Fields
- CommentID -> unique ID of the comment (could be the object identifier itself)
- OriginalPageName -> name of the page to which the comment belongs (could we use the "Parent" field for this ?)
- URL
- AuthorName -> either the XWikiUser or the inputted name
- Content
- ReplyID -> Unique ID of the comment this comment is a reply to
Comments Storage
- As objects attached to the page
- As independant pages
- Design/$commentNumber
- /Comment$randomID
Design
- The permalink links to the comment unique anchor if comments are stored as objects and to the comment's page if comments are stored as pages
Add a comment
Guests have the right to add a comment
\
- The "Add a comment" part is always displayed opened at the bottom of the "Comments" tab
- Clicking on "login" displays the inline login form (AJAX)
- Clicking on "create an account" opens the Create an account dialog box
- "Create an account" is not displayed if the current user does not have the right to register
- To check that users fill in the compulsory fields properly, we could use the same JS tools as those used on the register page in XWiki Workspaces
Guests do not have the right to add a comment
\
- Clicking on "login" displays the inline login form (AJAX)
- Clicking on "create an account" opens the "Create an account" dialog box
- "Create an account" is not displayed if the current user does not have the right to register
Login
\
\
\
- Clicking on "cancel your login" brings the user back to the standard view
- "create an account" is not displayed if the current user does not have the right to register
Creating an account
\
\
\
- XWiki Workspaces uses a nice set of register form JS validation tools, we might be able to re-use them here
Logged-in users
\
- If the page already is in the user watchlist, the "Add this page to my watchlist" message is not displayed
- If the current logged-in users does not have the right to add comments, nothing is displayed (neither "reply" nor the "Add a comment" part)
Leave a reply
Guests have the right to leave a reply to a comment
\
- "create an account" is not displayed if the current user does not have the right to register
- If the captcha doesn't work, the data entered by the user is kept and displayed again (same than for the register form seen above)
- Clicking on "Click here to cancel your reply" hides all input fields as well as "Leave a Reply"
- To check that users fill in the compulsory fields properly, we could use the same JS tools as those used on the register page in XWiki Workspaces
Guests do not have the right to leave a reply
\
- "Create an account" is not displayed if the current user does not have the right to register
- Once her account has been created, the user is brought back to the comment she wanted to reply with the "Leave a reply" part opened
Login
\
- If the login does not work, the same error messages as those seen above for inline login are displayed
Logged-in users
\
- If the page already is in the user watchlist, the "Add this page to my watchlist" message is not displayed
- If the current logged-in users does not have the right to add comments, nothing is displayed (neither "reply" nor the "Leave a reply" part)
Moderation
New control panel with Comments icon
\
Comments page in the Administration Control Panel
\
Comments Moderation
\
- When the user clicks on accept / refuse comment, an AJAX reload is done on that area and the resulting message is displayed.
- To validate all his actions, the user needs to click on "Save" at the bottom of the page
\
\
Guillaume Lerouge