Wiki source code of New Comments Implementation
Last modified by Vincent Massol on 2024/11/19 16:12
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | {{toc/}} | ||
| 2 | |||
| 3 | {{velocity filter="none"}} | ||
| 4 | {{html clean="false" wiki="true"}} | ||
| 5 | #macro(zimg $imgnb) | ||
| 6 | {{html clean="false" wiki="true"}} | ||
| 7 | <img style='border: 1px solid #000;' src='$doc.getAttachmentURL("COMMENTS.zip")/COMMENTS.${imgnb}.png' /> \ | ||
| 8 | |||
| 9 | {{/html}}#end | ||
| 10 | <p/> | ||
| 11 | {{info}}**Aims :** Provide a design proposal for a new interface for comments.{{/info}} | ||
| 12 | |||
| 13 | == Comment Display == | ||
| 14 | |||
| 15 | === On the wiki page to which the content is added (original page) === | ||
| 16 | |||
| 17 | * The "insert comment" field is always displayed at the bottom of the comments list | ||
| 18 | ** That field can be displayed in between comments when clicking on the "reply" button (see example on the TechCrunch website / reference below) | ||
| 19 | * When adding a comment, the whole page is not reloaded | ||
| 20 | ** The comment is added at the bottom of the page or under the reply-to comment using AJAX | ||
| 21 | * The total number of comments is listed in the "Comments" tab | ||
| 22 | ** When displaying the page, comments are dynamically displayed with their comment number (that is different from their ID) | ||
| 23 | * 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 | ||
| 24 | ** Children to that comment are not affected | ||
| 25 | |||
| 26 | ==== All Users ==== | ||
| 27 | |||
| 28 | * User picture if she has one / nothing otherwise | ||
| 29 | * 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) | ||
| 30 | * Date when the comment was posted | ||
| 31 | * Comment permalink | ||
| 32 | * Comment content | ||
| 33 | * "Reply" button at the bottom of the comment | ||
| 34 | * Once the reply button was clicked : insert comment content field | ||
| 35 | * Threaded comments (30 px margin on the left) | ||
| 36 | |||
| 37 | ==== Logged Users ==== | ||
| 38 | |||
| 39 | * Use the XWiki UserName of the user | ||
| 40 | * No Captcha | ||
| 41 | * "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) | ||
| 42 | |||
| 43 | ==== Guests ==== | ||
| 44 | |||
| 45 | * Name (compulsory) | ||
| 46 | * Email (compulsory) | ||
| 47 | * Website / URL (optional) | ||
| 48 | * Captcha (compulsory) | ||
| 49 | |||
| 50 | ==== Admins ==== | ||
| 51 | |||
| 52 | * "Delete comment" button | ||
| 53 | |||
| 54 | === On the individual page where the comment is stored === | ||
| 55 | |||
| 56 | * Title of the page : "This comment belongs to the $originalDoc.title (fallback on $originalDoc.fullName) page" | ||
| 57 | * User picture if she has one / nothing otherwise | ||
| 58 | * 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) | ||
| 59 | * Date when the comment was posted | ||
| 60 | * Comment content | ||
| 61 | * "Reply to this comment" button -> sends the user to an input field located below that comment on $originalDoc | ||
| 62 | * "View this comment in context" -> sends the user to the comment on $originalDoc | ||
| 63 | * Permalink to this comment | ||
| 64 | * "Delete comment" button for admins | ||
| 65 | <p/> | ||
| 66 | {{info}}Should we allow users to comment on a comment itself rather than as a reply to that comment on $originalDoc ?{{/info}} | ||
| 67 | |||
| 68 | == Technical Stuff == | ||
| 69 | |||
| 70 | === Comment Object Fields === | ||
| 71 | |||
| 72 | * CommentID -> unique ID of the comment (could be the object identifier itself) | ||
| 73 | * OriginalPageName -> name of the page to which the comment belongs (could we use the "Parent" field for this ?) | ||
| 74 | * URL | ||
| 75 | |||
| 76 | * AuthorName -> either the XWikiUser or the inputted name | ||
| 77 | * Content | ||
| 78 | * ReplyID -> Unique ID of the comment this comment is a reply to | ||
| 79 | |||
| 80 | === Comments Storage === | ||
| 81 | |||
| 82 | * As objects attached to the page | ||
| 83 | * As independant pages | ||
| 84 | ** $doc.Space/$doc.NameComment$commentNumber | ||
| 85 | ** $doc.SpaceComments/Comment$randomID | ||
| 86 | |||
| 87 | == Design == | ||
| 88 | |||
| 89 | * 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 | ||
| 90 | |||
| 91 | === Add a comment === | ||
| 92 | |||
| 93 | ==== Guests have the right to add a comment ==== | ||
| 94 | |||
| 95 | #zimg("001") | ||
| 96 | |||
| 97 | * The "Add a comment" part is always displayed opened at the bottom of the "Comments" tab | ||
| 98 | * Clicking on "login" displays the inline login form (AJAX) | ||
| 99 | * Clicking on "create an account" opens the Create an account dialog box | ||
| 100 | * "Create an account" is not displayed if the current user does not have the right to register | ||
| 101 | * 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 | ||
| 102 | |||
| 103 | ==== Guests do not have the right to add a comment ==== | ||
| 104 | |||
| 105 | #zimg("002") | ||
| 106 | |||
| 107 | * Clicking on "login" displays the inline login form (AJAX) | ||
| 108 | * Clicking on "create an account" opens the "Create an account" dialog box | ||
| 109 | * "Create an account" is not displayed if the current user does not have the right to register | ||
| 110 | |||
| 111 | ==== Login ==== | ||
| 112 | |||
| 113 | #zimg("003") | ||
| 114 | <p/> | ||
| 115 | #zimg("004") | ||
| 116 | |||
| 117 | #zimg("005") | ||
| 118 | |||
| 119 | * Clicking on "cancel your login" brings the user back to the standard view | ||
| 120 | * "create an account" is not displayed if the current user does not have the right to register | ||
| 121 | |||
| 122 | === Creating an account === | ||
| 123 | |||
| 124 | #zimg("006") | ||
| 125 | <p/> | ||
| 126 | #zimg("007") | ||
| 127 | <p/> | ||
| 128 | #zimg("008") | ||
| 129 | |||
| 130 | * XWiki Workspaces uses a nice set of register form JS validation tools, we might be able to re-use them here | ||
| 131 | |||
| 132 | ==== Logged-in users ==== | ||
| 133 | |||
| 134 | #zimg("009") | ||
| 135 | |||
| 136 | * If the page already is in the user watchlist, the "Add this page to my watchlist" message is not displayed | ||
| 137 | * 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) | ||
| 138 | |||
| 139 | === Leave a reply === | ||
| 140 | |||
| 141 | ==== Guests have the right to leave a reply to a comment ==== | ||
| 142 | |||
| 143 | #zimg("010") | ||
| 144 | |||
| 145 | * "create an account" is not displayed if the current user does not have the right to register | ||
| 146 | * 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) | ||
| 147 | * Clicking on "Click here to cancel your reply" hides all input fields as well as "Leave a Reply" | ||
| 148 | * 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 | ||
| 149 | |||
| 150 | ==== Guests do not have the right to leave a reply ==== | ||
| 151 | |||
| 152 | #zimg("011") | ||
| 153 | |||
| 154 | * "Create an account" is not displayed if the current user does not have the right to register | ||
| 155 | * 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 | ||
| 156 | |||
| 157 | ==== Login ==== | ||
| 158 | |||
| 159 | #zimg("012") | ||
| 160 | |||
| 161 | * If the login does not work, the same error messages as those seen above for inline login are displayed | ||
| 162 | |||
| 163 | ==== Logged-in users ==== | ||
| 164 | |||
| 165 | #zimg("013") | ||
| 166 | |||
| 167 | * If the page already is in the user watchlist, the "Add this page to my watchlist" message is not displayed | ||
| 168 | * 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) | ||
| 169 | |||
| 170 | === Moderation === | ||
| 171 | |||
| 172 | ==== New control panel with Comments icon ==== | ||
| 173 | |||
| 174 | #zimg("014") | ||
| 175 | |||
| 176 | ==== Comments page in the Administration Control Panel ==== | ||
| 177 | |||
| 178 | #zimg("015") | ||
| 179 | |||
| 180 | ==== Comments Moderation ==== | ||
| 181 | |||
| 182 | #zimg("016") | ||
| 183 | |||
| 184 | * When the user clicks on accept / refuse comment, an AJAX reload is done on that area and the resulting message is displayed. | ||
| 185 | * To validate all his actions, the user needs to click on "Save" at the bottom of the page | ||
| 186 | <p/> | ||
| 187 | #zimg("017") | ||
| 188 | |||
| 189 | #zimg("018") | ||
| 190 | {{/html}} | ||
| 191 | {{/velocity}} | ||
| 192 | |||
| 193 | ((( | ||
| 194 | |||
| 195 | ))) |