abp
abp copied to clipboard
CMS Kit: Approvement system for the comments
Requirements
- Add
bool? IsApproved
(nullable) and to theComment
entity, which is used to track the approvement state for that comment.-
null
: No action taken yet (default value for new comments) - waiting for moderation -
true
: Approved -
false
: Disapproved
-
- Add a setting to enable/disable the approvement system.
- If
RequireApprovement
is enabled, comments withIsApproved
!=true
are not shown (null
s are not shown). They should be approved in the admin side. - If
RequireApprovement
is disabled, comments withIsApproved
!=false
are not shown (null
s are shown).
Admin UI
-
Add a new filter for the approvement state. Filter title: "Approve state", Values: "All", "Approved", "Disapproved", "Waiting".
- If
RequireApprovement
ofCmsKitCommentOptions
is false, then do not show that filter.
- If
-
Add a new column to the datatable
Approved
and show an icon [1] indicating the approval state.- Do not show that column if
RequireApprovement
ofCmsKitCommentOptions
is false. - Also add the same column to the reply comments in the details page.
- Do not show that column if
-
Add new entity actions for comments (and reply to comments in the detail view) (only available if
RequireApprovement
ofCmsKitCommentOptions
is true):- Approve
- Disapprove
-
Add an information alert on top of the filtering area to show the count of the comments waiting for moderation.
- Alert text: "There are 6 comments waiting for approval" (that number is independent from the filters on the page. it also includes the count of reply comments)
- When we click to the alert message, a new page is open (URL: /Cms/Comments/Approve/{GUID})
- In that page, show all the waiting comments in a data table (including the reply comments) ordered by creation time descending.
- Date columns: approve, username, entity type, text, creation time
- First column will have two icons. Approve or Disapprove. When we click, it changes the state and removes the item from the data table.
- Show full comment message (do not truncate) with markdown support.
-
Additional: Start date should be empty when we first open the comments page
[1] Datatable icons
Disapproved:
Approved:
Waiting for approvement: