Skip to content

armgit / fider

Public Imported from GitHub
0

Open platform to collect and prioritize feedback

Post and comment moderation on the show post page seems to be working

Matt Robertscd7ffbf256d1
diff --git a/app/cmd/routes.go b/app/cmd/routes.go
index 388861843..da5455657 100644
--- a/app/cmd/routes.go
+++ b/app/cmd/routes.go
@@ -187,12 +187,6 @@ func routes(r *web.Engine) *web.Engine {
ui.Put("/_api/admin/users/:userID/block", handlers.BlockUser())
ui.Delete("/_api/admin/users/:userID/block", handlers.UnblockUser())
ui.Get("/_api/admin/moderation/items", handlers.GetModerationItems())
- ui.Post("/_api/admin/moderation/posts/:id/approve", handlers.ApprovePost())
- ui.Post("/_api/admin/moderation/posts/:id/decline", handlers.DeclinePost())
- ui.Post("/_api/admin/moderation/comments/:id/approve", handlers.ApproveComment())
- ui.Post("/_api/admin/moderation/comments/:id/decline", handlers.DeclineComment())
- ui.Post("/_api/admin/moderation/bulk/approve", handlers.BulkApproveItems())
- ui.Post("/_api/admin/moderation/bulk/decline", handlers.BulkDeclineItems())
if env.IsBillingEnabled() {
ui.Get("/admin/billing", handlers.ManageBilling())
@@ -267,6 +261,13 @@ func routes(r *web.Engine) *web.Engine {
adminApi.Put("/api/v1/tags/:slug", apiv1.CreateEditTag())
adminApi.Delete("/api/v1/tags/:slug", apiv1.DeleteTag())
+ adminApi.Post("/api/v1/admin/moderation/posts/:id/approve", handlers.ApprovePost())
+ adminApi.Post("/api/v1/admin/moderation/posts/:id/decline", handlers.DeclinePost())
+ adminApi.Post("/api/v1/admin/moderation/comments/:id/approve", handlers.ApproveComment())
+ adminApi.Post("/api/v1/admin/moderation/comments/:id/decline", handlers.DeclineComment())
+ adminApi.Post("/api/v1/admin/moderation/bulk/approve", handlers.BulkApproveItems())
+ adminApi.Post("/api/v1/admin/moderation/bulk/decline", handlers.BulkDeclineItems())
+
adminApi.Use(middlewares.BlockLockedTenants())
adminApi.Delete("/api/v1/posts/:number", apiv1.DeletePost())
}
diff --git a/app/services/sqlstore/postgres/comment.go b/app/services/sqlstore/postgres/comment.go
index a3e6c6b27..95492c644 100644
--- a/app/services/sqlstore/postgres/comment.go
+++ b/app/services/sqlstore/postgres/comment.go
@@ -3,6 +3,7 @@ package postgres
import (
"context"
"encoding/json"
+ "fmt"
"time"
"github.com/getfider/fider/app/models/cmd"
@@ -46,7 +47,7 @@ func (c *dbComment) toModel(ctx context.Context) *entity.Comment {
func addNewComment(ctx context.Context, c *cmd.AddNewComment) error {
return using(ctx, func(trx *dbx.Trx, tenant *entity.Tenant, user *entity.User) error {
- isApproved := !tenant.IsModerationEnabled
+ isApproved := !tenant.IsModerationEnabled || user.IsCollaborator()
var id int
if err := trx.Get(&id, `
INSERT INTO comments (tenant_id, post_id, content, user_id, created_at, is_approved)
@@ -176,8 +177,21 @@ func getCommentsByPost(ctx context.Context, q *query.GetCommentsByPost) error {
if user != nil {
userId = user.ID
}
- err := trx.Select(&comments,
- `
+
+ // Build approval filter based on user permissions
+ approvalFilter := ""
+ if user != nil && user.IsCollaborator() {
+ // Admins and collaborators can see all comments
+ approvalFilter = ""
+ } else if user != nil {
+ // Regular users can see approved comments + their own unapproved comments
+ approvalFilter = fmt.Sprintf(" AND (c.is_approved = true OR c.user_id = %d)", user.ID)
+ } else {
+ // Anonymous users can only see approved comments
+ approvalFilter = " AND c.is_approved = true"
+ }
+
+ query := fmt.Sprintf(`
WITH agg_attachments AS (
SELECT
c.id as comment_id,
@@ -249,8 +263,10 @@ func getCommentsByPost(ctx context.Context, q *query.GetCommentsByPost) error {
ON ar.comment_id = c.id
WHERE p.id = $1
AND p.tenant_id = $2
- AND c.deleted_at IS NULL
- ORDER BY c.created_at ASC`, q.Post.ID, tenant.ID, userId)
+ AND c.deleted_at IS NULL%s
+ ORDER BY c.created_at ASC`, approvalFilter)
+
+ err := trx.Select(&comments, query, q.Post.ID, tenant.ID, userId)
if err != nil {
return errors.Wrap(err, "failed get comments of post with id '%d'", q.Post.ID)
}
diff --git a/app/services/sqlstore/postgres/post.go b/app/services/sqlstore/postgres/post.go
index 4bb251dbe..f4a8a1682 100644
--- a/app/services/sqlstore/postgres/post.go
+++ b/app/services/sqlstore/postgres/post.go
@@ -99,8 +99,8 @@ var (
agg_comments AS (
SELECT
post_id,
- COUNT(CASE WHEN comments.created_at > CURRENT_DATE - INTERVAL '30 days' THEN 1 END) as recent,
- COUNT(*) as all
+ COUNT(CASE WHEN comments.created_at > CURRENT_DATE - INTERVAL '30 days' AND comments.is_approved = true THEN 1 END) as recent,
+ COUNT(CASE WHEN comments.is_approved = true THEN 1 END) as all
FROM comments
INNER JOIN posts
ON posts.id = comments.post_id
@@ -153,7 +153,8 @@ var (
d.slug AS original_slug,
d.status AS original_status,
COALESCE(agg_t.tags, ARRAY[]::text[]) AS tags,
- COALESCE(%s, false) AS has_voted
+ COALESCE(%s, false) AS has_voted,
+ p.is_approved
FROM posts p
INNER JOIN users u
ON u.id = p.user_id
@@ -291,7 +292,7 @@ func countPostPerStatus(ctx context.Context, q *query.CountPostPerStatus) error
func addNewPost(ctx context.Context, c *cmd.AddNewPost) error {
return using(ctx, func(trx *dbx.Trx, tenant *entity.Tenant, user *entity.User) error {
- isApproved := !tenant.IsModerationEnabled
+ isApproved := !tenant.IsModerationEnabled || user.IsCollaborator()
var id int
err := trx.Get(&id,
`INSERT INTO posts (title, slug, number, description, tenant_id, user_id, created_at, status, is_approved)
@@ -524,5 +525,20 @@ func buildPostQuery(user *entity.User, filter string) string {
if user != nil {
hasVotedSubQuery = fmt.Sprintf("(SELECT true FROM post_votes WHERE post_id = p.id AND user_id = %d)", user.ID)
}
- return fmt.Sprintf(sqlSelectPostsWhere, tagCondition, hasVotedSubQuery, filter)
+
+ // Add approval filtering based on user permissions
+ approvalFilter := ""
+ if user != nil && user.IsCollaborator() {
+ // Admins and collaborators can see all posts
+ approvalFilter = ""
+ } else if user != nil {
+ // Regular users can see approved posts + their own unapproved posts
+ approvalFilter = fmt.Sprintf(" AND (p.is_approved = true OR p.user_id = %d)", user.ID)
+ } else {
+ // Anonymous users can only see approved posts
+ approvalFilter = " AND p.is_approved = true"
+ }
+
+ combinedFilter := filter + approvalFilter
+ return fmt.Sprintf(sqlSelectPostsWhere, tagCondition, hasVotedSubQuery, combinedFilter)
}
diff --git a/app/services/sqlstore/postgres/tenant.go b/app/services/sqlstore/postgres/tenant.go
index 33a78901c..c5971a457 100644
--- a/app/services/sqlstore/postgres/tenant.go
+++ b/app/services/sqlstore/postgres/tenant.go
@@ -17,21 +17,22 @@ import (
)
type dbTenant struct {
- ID int `db:"id"`
- Name string `db:"name"`
- Subdomain string `db:"subdomain"`
- CNAME string `db:"cname"`
- Invitation string `db:"invitation"`
- WelcomeMessage string `db:"welcome_message"`
- Status int `db:"status"`
- Locale string `db:"locale"`
- IsPrivate bool `db:"is_private"`
- LogoBlobKey string `db:"logo_bkey"`
- CustomCSS string `db:"custom_css"`
- AllowedSchemes string `db:"allowed_schemes"`
- IsEmailAuthAllowed bool `db:"is_email_auth_allowed"`
- IsFeedEnabled bool `db:"is_feed_enabled"`
- PreventIndexing bool `db:"prevent_indexing"`
+ ID int `db:"id"`
+ Name string `db:"name"`
+ Subdomain string `db:"subdomain"`
+ CNAME string `db:"cname"`
+ Invitation string `db:"invitation"`
+ WelcomeMessage string `db:"welcome_message"`
+ Status int `db:"status"`
+ Locale string `db:"locale"`
+ IsPrivate bool `db:"is_private"`
+ LogoBlobKey string `db:"logo_bkey"`
+ CustomCSS string `db:"custom_css"`
+ AllowedSchemes string `db:"allowed_schemes"`
+ IsEmailAuthAllowed bool `db:"is_email_auth_allowed"`
+ IsFeedEnabled bool `db:"is_feed_enabled"`
+ PreventIndexing bool `db:"prevent_indexing"`
+ IsModerationEnabled bool `db:"is_moderation_enabled"`
}
func (t *dbTenant) toModel() *entity.Tenant {
@@ -40,21 +41,22 @@ func (t *dbTenant) toModel() *entity.Tenant {
}
tenant := &entity.Tenant{
- ID: t.ID,
- Name: t.Name,
- Subdomain: t.Subdomain,
- CNAME: t.CNAME,
- Invitation: t.Invitation,
- WelcomeMessage: t.WelcomeMessage,
- Status: enum.TenantStatus(t.Status),
- Locale: t.Locale,
- IsPrivate: t.IsPrivate,
- LogoBlobKey: t.LogoBlobKey,
- CustomCSS: t.CustomCSS,
- AllowedSchemes: t.AllowedSchemes,
- IsEmailAuthAllowed: t.IsEmailAuthAllowed,
- IsFeedEnabled: t.IsFeedEnabled,
- PreventIndexing: t.PreventIndexing,
+ ID: t.ID,
+ Name: t.Name,
+ Subdomain: t.Subdomain,
+ CNAME: t.CNAME,
+ Invitation: t.Invitation,
+ WelcomeMessage: t.WelcomeMessage,
+ Status: enum.TenantStatus(t.Status),
+ Locale: t.Locale,
+ IsPrivate: t.IsPrivate,
+ LogoBlobKey: t.LogoBlobKey,
+ CustomCSS: t.CustomCSS,
+ AllowedSchemes: t.AllowedSchemes,
+ IsEmailAuthAllowed: t.IsEmailAuthAllowed,
+ IsFeedEnabled: t.IsFeedEnabled,
+ PreventIndexing: t.PreventIndexing,
+ IsModerationEnabled: t.IsModerationEnabled,
}
return tenant
@@ -283,7 +285,6 @@ func getFirstTenant(ctx context.Context, q *query.GetFirstTenant) error {
FROM tenants
ORDER BY id LIMIT 1
`)
-
if err != nil {
return errors.Wrap(err, "failed to get first tenant")
}
@@ -298,7 +299,7 @@ func getTenantByDomain(ctx context.Context, q *query.GetTenantByDomain) error {
tenant := dbTenant{}
err := trx.Get(&tenant, `
- SELECT id, name, subdomain, cname, invitation, locale, welcome_message, status, is_private, logo_bkey, custom_css, allowed_schemes, is_email_auth_allowed, is_feed_enabled, prevent_indexing
+ SELECT id, name, subdomain, cname, invitation, locale, welcome_message, status, is_private, logo_bkey, custom_css, is_email_auth_allowed, is_feed_enabled, is_moderation_enabled, prevent_indexing
FROM tenants t
WHERE subdomain = $1 OR subdomain = $2 OR cname = $3
ORDER BY cname DESC
diff --git a/locale/ar/client.json b/locale/ar/client.json
index e28eb8cf7..8db10b29b 100644
--- a/locale/ar/client.json
+++ b/locale/ar/client.json
@@ -1,10 +1,12 @@
{
+ "action.approve": "",
"action.cancel": "إلغاء",
"action.change": "تغيير",
"action.close": "إغلاق",
"action.commentsfeed": "تغذية التعليقات",
"action.confirm": "تأكيد",
"action.copylink": "نسخ الرابط",
+ "action.decline": "",
"action.delete": "حذف",
"action.edit": "تعديل",
"action.markallasread": "تمييز الكل كمقروءة",
@@ -16,6 +18,7 @@
"action.submit": "إرسال",
"action.vote": "صوت لهذه الفكرة",
"action.voted": "تم التصويت!",
+ "comment.moderation.notice": "",
"d41FkJ": "{count, plural, zero {}one {# وسم} two {# وسوم} few {# وسوم} many {# وسوم} other {# وسوم}}",
"editor.markdownmode": "الانتقال إلى محرر النصوص (Markdown)",
"editor.richtextmode": "التبديل إلى محرر نص منسق",
@@ -158,6 +161,7 @@
"newpost.modal.title": "شارك بفكرتك...",
"newpost.modal.title.label": "أعط فكرتك عنوانًا",
"newpost.modal.title.placeholder": "شيء قصير وموجز، لخصه في بضع كلمات",
+ "newpost.moderation.notice": "",
"page.backhome": "خذني إلى <0>{0}</0> الصفحة الرئيسية.",
"page.notinvited.text": "لم نتمكن من العثور على حساب لعنوان بريدك الإلكتروني.",
"page.notinvited.title": "لم تتم دعوتك",
@@ -172,6 +176,22 @@
"showpost.discussionpanel.emptymessage": "لم يعلق أحد بعد.",
"showpost.label.author": "نشرت بواسطة <0/> · <1/>",
"showpost.message.nodescription": "لا يوجد وصف.",
+ "showpost.moderation.admin.description": "",
+ "showpost.moderation.admin.title": "",
+ "showpost.moderation.approved": "",
+ "showpost.moderation.approveerror": "",
+ "showpost.moderation.awaiting": "",
+ "showpost.moderation.comment.admin.description": "",
+ "showpost.moderation.comment.admin.title": "",
+ "showpost.moderation.comment.approved": "",
+ "showpost.moderation.comment.approveerror": "",
+ "showpost.moderation.comment.awaiting": "",
+ "showpost.moderation.comment.declined": "",
+ "showpost.moderation.comment.declineerror": "",
+ "showpost.moderation.commentsuccess": "",
+ "showpost.moderation.declined": "",
+ "showpost.moderation.declineerror": "",
+ "showpost.moderation.postsuccess": "",
"showpost.moderationpanel.text.help": "هذه العملية <0>لا يمكن</0> التراجع عنها.",
"showpost.moderationpanel.text.placeholder": "لماذا تقوم بحذف هذا المنشور؟ (اختياري)",
"showpost.mostwanted.comments": "{count, plural, zero {}one {# تعليق} two {# تعليقات} few {# تعليقات} many {# تعليقات} other {# تعليقات}}",
diff --git a/locale/de/client.json b/locale/de/client.json
index c82923a42..5eccae17c 100644
--- a/locale/de/client.json
+++ b/locale/de/client.json
@@ -1,10 +1,12 @@
{
+ "action.approve": "",
"action.cancel": "Abbrechen",
"action.change": "ändern",
"action.close": "Schließen",
"action.commentsfeed": "Kommentar-Feed",
"action.confirm": "Bestätigen",
"action.copylink": "Link kopieren",
+ "action.decline": "",
"action.delete": "Löschen",
"action.edit": "Bearbeiten",
"action.markallasread": "Alle als gelesen markieren",
@@ -16,6 +18,7 @@
"action.submit": "Absenden",
"action.vote": "Abstimmen",
"action.voted": "Abgestimmt!",
+ "comment.moderation.notice": "",
"d41FkJ": "{count, plural, one {# Tag} other {# Tags}}",
"editor.markdownmode": "Zum Markdown-Editor wechseln",
"editor.richtextmode": "Zum Rich-Text-Editor wechseln",
@@ -158,6 +161,7 @@
"newpost.modal.title": "Teile deine Idee ...",
"newpost.modal.title.label": "Gib deiner Idee einen Titel",
"newpost.modal.title.placeholder": "Eine kurze und knappe Zusammenfassung in wenigen Worten",
+ "newpost.moderation.notice": "",
"page.backhome": "Zurück zur <0>{0}</0> Homepage.",
"page.notinvited.text": "Wir konnten kein Account für deine E-Mail-Adresse finden.",
"page.notinvited.title": "Nicht eingeladen",
@@ -172,6 +176,22 @@
"showpost.discussionpanel.emptymessage": "Niemand hat bisher kommentiert.",
"showpost.label.author": "Gepostet von <0/> · <1/>",
"showpost.message.nodescription": "Keine Beschreibung angegeben.",
+ "showpost.moderation.admin.description": "",
+ "showpost.moderation.admin.title": "",
+ "showpost.moderation.approved": "",
+ "showpost.moderation.approveerror": "",
+ "showpost.moderation.awaiting": "",
+ "showpost.moderation.comment.admin.description": "",
+ "showpost.moderation.comment.admin.title": "",
+ "showpost.moderation.comment.approved": "",
+ "showpost.moderation.comment.approveerror": "",
+ "showpost.moderation.comment.awaiting": "",
+ "showpost.moderation.comment.declined": "",
+ "showpost.moderation.comment.declineerror": "",
+ "showpost.moderation.commentsuccess": "",
+ "showpost.moderation.declined": "",
+ "showpost.moderation.declineerror": "",
+ "showpost.moderation.postsuccess": "",
"showpost.moderationpanel.text.help": "Diese Aktion <0>kann nicht</0> rückgängig gemacht werden.",
"showpost.moderationpanel.text.placeholder": "Warum löschst du diesen Beitrag? (optional)",
"showpost.mostwanted.comments": "{count, plural, one {# Kommentar} other {# Kommentare}}",
diff --git a/locale/el/client.json b/locale/el/client.json
index 75e603614..71e145d75 100644
--- a/locale/el/client.json
+++ b/locale/el/client.json
@@ -1,10 +1,12 @@
{
+ "action.approve": "",
"action.cancel": "Ακύρωση",
"action.change": "αλλαγή",
"action.close": "Κλείσιμο",
"action.commentsfeed": "Ροή σχολίων",
"action.confirm": "Επιβεβαίωση",
"action.copylink": "Αντιγραφή συνδέσμου",
+ "action.decline": "",
"action.delete": "Διαγραφή",
"action.edit": "Επεξεργασία",
"action.markallasread": "Σήμανση όλων ως αναγνωσμένων",
@@ -16,6 +18,7 @@
"action.submit": "Υποβολή",
"action.vote": "Ψηφίστε αυτήν την ιδέα",
"action.voted": "Ψηφίστηκε!",
+ "comment.moderation.notice": "",
"d41FkJ": "{count, plural, one {# tag} other {# tags}}",
"editor.markdownmode": "Μετάβαση στο πρόγραμμα επεξεργασίας markdown",
"editor.richtextmode": "Μετάβαση σε πρόγραμμα επεξεργασίας εμπλουτισμένου κειμένου",
@@ -158,6 +161,7 @@
"newpost.modal.title": "Μοιραστείτε την ιδέα σας...",
"newpost.modal.title.label": "Δώστε έναν τίτλο στην ιδέα σας",
"newpost.modal.title.placeholder": "Κάτι σύντομο και περιεκτικό, συνοψίστε το σε λίγες λέξεις",
+ "newpost.moderation.notice": "",
"page.backhome": "Επιστρέψτε με στην αρχική σελίδα <0>{0}</0>.",
"page.notinvited.text": "Δεν μπορέσαμε να βρούμε λογαριασμό για τη διεύθυνση email σας.",
"page.notinvited.title": "Δεν έχει προσκληθεί",
@@ -172,6 +176,22 @@
"showpost.discussionpanel.emptymessage": "Κανείς δεν έχει σχολιάσει ακόμα.",
"showpost.label.author": "Δημοσιεύτηκε από <0/> · <1/>",
"showpost.message.nodescription": "Δεν υπάρχει περιγραφή.",
+ "showpost.moderation.admin.description": "",
+ "showpost.moderation.admin.title": "",
+ "showpost.moderation.approved": "",
+ "showpost.moderation.approveerror": "",
+ "showpost.moderation.awaiting": "",
+ "showpost.moderation.comment.admin.description": "",
+ "showpost.moderation.comment.admin.title": "",
+ "showpost.moderation.comment.approved": "",
+ "showpost.moderation.comment.approveerror": "",
+ "showpost.moderation.comment.awaiting": "",
+ "showpost.moderation.comment.declined": "",
+ "showpost.moderation.comment.declineerror": "",
+ "showpost.moderation.commentsuccess": "",
+ "showpost.moderation.declined": "",
+ "showpost.moderation.declineerror": "",
+ "showpost.moderation.postsuccess": "",
"showpost.moderationpanel.text.help": "Αυτή η λειτουργία <0>δεν μπορεί</0> να αναιρεθεί.",
"showpost.moderationpanel.text.placeholder": "Γιατί διαγράφετε αυτή την ανάρτηση; (προαιρετικό)",
"showpost.mostwanted.comments": "{count, plural, one {# comment} other {# comments}}",
diff --git a/locale/en/client.json b/locale/en/client.json
index abf3194b4..a3da2889f 100644
--- a/locale/en/client.json
+++ b/locale/en/client.json
@@ -1,10 +1,12 @@
{
+ "action.approve": "Approve",
"action.cancel": "Cancel",
"action.change": "change",
"action.close": "Close",
"action.commentsfeed": "Comment Feed",
"action.confirm": "Confirm",
"action.copylink": "Copy link",
+ "action.decline": "Decline",
"action.delete": "Delete",
"action.edit": "Edit",
"action.markallasread": "Mark All as Read",
@@ -16,6 +18,7 @@
"action.submit": "Submit",
"action.vote": "Vote for this idea",
"action.voted": "Voted!",
+ "comment.moderation.notice": "Your comment will be reviewed by an administrator before being visible to other users.",
"d41FkJ": "{count, plural, one {# tag} other {# tags}}",
"editor.markdownmode": "Switch to markdown editor",
"editor.richtextmode": "Switch to rich text editor",
@@ -157,6 +160,7 @@
"newpost.modal.title": "Share your idea...",
"newpost.modal.title.label": "Give your idea a title",
"newpost.modal.title.placeholder": "Something short and snappy, sum it up in a few words",
+ "newpost.moderation.notice": "Your post will be reviewed by an administrator before being visible to other users.",
"page.backhome": "Take me back to <0>{0}</0> home page.",
"page.notinvited.text": "We could not find an account for your email address.",
"page.notinvited.title": "Not invited",
@@ -171,6 +175,22 @@
"showpost.discussionpanel.emptymessage": "No one has commented yet.",
"showpost.label.author": "Posted by <0/> · <1/>",
"showpost.message.nodescription": "No description provided.",
+ "showpost.moderation.admin.description": "This post is awaiting your approval to be visible to all users.",
+ "showpost.moderation.admin.title": "Post Moderation",
+ "showpost.moderation.approved": "Post approved successfully",
+ "showpost.moderation.approveerror": "Failed to approve post",
+ "showpost.moderation.awaiting": "This post is awaiting moderation by an administrator before being visible to other users.",
+ "showpost.moderation.comment.admin.description": "This comment is awaiting your approval to be visible to all users.",
+ "showpost.moderation.comment.admin.title": "Comment Moderation",
+ "showpost.moderation.comment.approved": "Comment approved successfully",
+ "showpost.moderation.comment.approveerror": "Failed to approve comment",
+ "showpost.moderation.comment.awaiting": "This comment is awaiting moderation by an administrator before being visible to other users.",
+ "showpost.moderation.comment.declined": "Comment declined successfully",
+ "showpost.moderation.comment.declineerror": "Failed to decline comment",
+ "showpost.moderation.commentsuccess": "Your comment has been submitted and is awaiting moderation 📝",
+ "showpost.moderation.declined": "Post declined successfully",
+ "showpost.moderation.declineerror": "Failed to decline post",
+ "showpost.moderation.postsuccess": "Your idea has been submitted and is awaiting moderation 📝",
"showpost.moderationpanel.text.help": "This operation <0>cannot</0> be undone.",
"showpost.moderationpanel.text.placeholder": "Why are you deleting this post? (optional)",
"showpost.mostwanted.comments": "{count, plural, one {# comment} other {# comments}}",
diff --git a/locale/es-ES/client.json b/locale/es-ES/client.json
index 14988203b..14406f82c 100644
--- a/locale/es-ES/client.json
+++ b/locale/es-ES/client.json
@@ -1,10 +1,12 @@
{
+ "action.approve": "",
"action.cancel": "Cancelar",
"action.change": "cambiar",
"action.close": "Cerrar",
"action.commentsfeed": "Feed de comentarios",
"action.confirm": "Confirmar",
"action.copylink": "Copiar enlace",
+ "action.decline": "",
"action.delete": "Eliminar",
"action.edit": "Editar",
"action.markallasread": "Marcar Todo como Leído",
@@ -16,6 +18,7 @@
"action.submit": "Enviar",
"action.vote": "Vota por esta idea",
"action.voted": "¡Votado!",
+ "comment.moderation.notice": "",
"d41FkJ": "{count, plural, one {# tag} other {# tags}}",
"editor.markdownmode": "Cambiar al editor de rebajas",
"editor.richtextmode": "Cambiar al editor de texto enriquecido",
@@ -158,6 +161,7 @@
"newpost.modal.title": "Comparte tu idea...",
"newpost.modal.title.label": "Dale un título a tu idea",
"newpost.modal.title.placeholder": "Algo corto y conciso, resúmalo en pocas palabras.",
+ "newpost.moderation.notice": "",
"page.backhome": "Llévame a la página de inicio de <0>{0}</0>.",
"page.notinvited.text": "No pudimos encontrar una cuenta asociada a tu correo electrónico.",
"page.notinvited.title": "Sin invitación",
@@ -172,6 +176,22 @@
"showpost.discussionpanel.emptymessage": "Nadie ha comentado todavía.",
"showpost.label.author": "Publicado por <0/> · <1/>",
"showpost.message.nodescription": "No se proporcionó ninguna descripción.",
+ "showpost.moderation.admin.description": "",
+ "showpost.moderation.admin.title": "",
+ "showpost.moderation.approved": "",
+ "showpost.moderation.approveerror": "",
+ "showpost.moderation.awaiting": "",
+ "showpost.moderation.comment.admin.description": "",
+ "showpost.moderation.comment.admin.title": "",
+ "showpost.moderation.comment.approved": "",
+ "showpost.moderation.comment.approveerror": "",
+ "showpost.moderation.comment.awaiting": "",
+ "showpost.moderation.comment.declined": "",
+ "showpost.moderation.comment.declineerror": "",
+ "showpost.moderation.commentsuccess": "",
+ "showpost.moderation.declined": "",
+ "showpost.moderation.declineerror": "",
+ "showpost.moderation.postsuccess": "",
"showpost.moderationpanel.text.help": "Esta operación <0>no se puede</0> deshacer.",
"showpost.moderationpanel.text.placeholder": "¿Por qué estás eliminando esta publicación? (opcional)",
"showpost.mostwanted.comments": "{count, plural, one {# comment} other {# comments}}",
diff --git a/locale/fr/client.json b/locale/fr/client.json
index 944f7e176..7f37c6299 100644
--- a/locale/fr/client.json
+++ b/locale/fr/client.json
@@ -1,10 +1,12 @@
{
+ "action.approve": "",
"action.cancel": "Annuler",
"action.change": "changer",
"action.close": "Fermer",
"action.commentsfeed": "Flux de commentaires",
"action.confirm": "Confirmer",
"action.copylink": "Copier le lien",
+ "action.decline": "",
"action.delete": "Supprimer",
"action.edit": "Modifier",
"action.markallasread": "Tout marquer comme lu",
@@ -16,6 +18,7 @@
"action.submit": "Valider",
"action.vote": "Voter pour cette idée",
"action.voted": "Votée !",
+ "comment.moderation.notice": "",
"d41FkJ": "{count, plural, one {# étiquette} other {# étiquettes}}",
"editor.markdownmode": "Basculer vers l'éditeur markdown",
"editor.richtextmode": "Basculer vers l'éditeur de texte enrichi",
@@ -158,6 +161,7 @@
"newpost.modal.title": "Partagez votre idée...",
"newpost.modal.title.label": "Donnez un titre à votre idée",
"newpost.modal.title.placeholder": "Quelque chose de court et percutant, résumez-le en quelques mots",
+ "newpost.moderation.notice": "",
"page.backhome": "Ramenez-moi à la page d'accueil de <0>{0}</0>.",
"page.notinvited.text": "Nous n'avons pas trouvé de compte avec cette adresse e-mail.",
"page.notinvited.title": "Non invité",
@@ -172,6 +176,22 @@
"showpost.discussionpanel.emptymessage": "Personne n'a encore commenté.",
"showpost.label.author": "Posté par <0/> · <1/>",
"showpost.message.nodescription": "Aucune description fournie.",
+ "showpost.moderation.admin.description": "",
+ "showpost.moderation.admin.title": "",
+ "showpost.moderation.approved": "",
+ "showpost.moderation.approveerror": "",
+ "showpost.moderation.awaiting": "",
+ "showpost.moderation.comment.admin.description": "",
+ "showpost.moderation.comment.admin.title": "",
+ "showpost.moderation.comment.approved": "",
+ "showpost.moderation.comment.approveerror": "",
+ "showpost.moderation.comment.awaiting": "",
+ "showpost.moderation.comment.declined": "",
+ "showpost.moderation.comment.declineerror": "",
+ "showpost.moderation.commentsuccess": "",
+ "showpost.moderation.declined": "",
+ "showpost.moderation.declineerror": "",
+ "showpost.moderation.postsuccess": "",
"showpost.moderationpanel.text.help": "Cette opération <0>ne peut pas</0> être annulée.",
"showpost.moderationpanel.text.placeholder": "Pourquoi supprimez-vous ce message ? (optionnel)",
"showpost.mostwanted.comments": "{count, plural, one {# commentaire} other {# commentaires}}",
diff --git a/locale/it/client.json b/locale/it/client.json
index 16bae16a6..4be5351ae 100644
--- a/locale/it/client.json
+++ b/locale/it/client.json
@@ -1,10 +1,12 @@
{
+ "action.approve": "",
"action.cancel": "Cancella",
"action.change": "modifica",
"action.close": "Chiudi",
"action.commentsfeed": "Feed dei commenti",
"action.confirm": "Conferma",
"action.copylink": "Copia il collegamento",
+ "action.decline": "",
"action.delete": "Cancella",
"action.edit": "Modifica",
"action.markallasread": "Segna tutto come letto",
@@ -16,6 +18,7 @@
"action.submit": "Invia",
"action.vote": "Vota questa idea",
"action.voted": "Votato!",
+ "comment.moderation.notice": "",
"d41FkJ": "{count, plural, one {# tag} other {# tags}}",
"editor.markdownmode": "Passa all'editor di markdown",
"editor.richtextmode": "Passa all'editor di testo avanzato",
@@ -158,6 +161,7 @@
"newpost.modal.title": "Condividi la tua idea...",
"newpost.modal.title.label": "Dai un titolo alla tua idea",
"newpost.modal.title.placeholder": "Qualcosa di breve e conciso, riassumilo in poche parole",
+ "newpost.moderation.notice": "",
"page.backhome": "Portami indietro alla <0>{0}</0> pagina principale.",
"page.notinvited.text": "Non siamo riusciti a trovare un account per il tuo indirizzo email.",
"page.notinvited.title": "Nessun invito",
@@ -172,6 +176,22 @@
"showpost.discussionpanel.emptymessage": "Nessuno ha ancora commentato.",
"showpost.label.author": "Scritto da <0/>·<1/>",
"showpost.message.nodescription": "Nessuna descrizione fornita.",
+ "showpost.moderation.admin.description": "",
+ "showpost.moderation.admin.title": "",
+ "showpost.moderation.approved": "",
+ "showpost.moderation.approveerror": "",
+ "showpost.moderation.awaiting": "",
+ "showpost.moderation.comment.admin.description": "",
+ "showpost.moderation.comment.admin.title": "",
+ "showpost.moderation.comment.approved": "",
+ "showpost.moderation.comment.approveerror": "",
+ "showpost.moderation.comment.awaiting": "",
+ "showpost.moderation.comment.declined": "",
+ "showpost.moderation.comment.declineerror": "",
+ "showpost.moderation.commentsuccess": "",
+ "showpost.moderation.declined": "",
+ "showpost.moderation.declineerror": "",
+ "showpost.moderation.postsuccess": "",
"showpost.moderationpanel.text.help": "Questa operano <0>non</0> può essere cancellata.",
"showpost.moderationpanel.text.placeholder": "Stai eliminando questo post? (Opzione)",
"showpost.mostwanted.comments": "{count, plural, one {# comment} other {# comments}}",
diff --git a/locale/ja/client.json b/locale/ja/client.json
index a439c64e7..c6d3a7d17 100644
--- a/locale/ja/client.json
+++ b/locale/ja/client.json
@@ -1,10 +1,12 @@
{
+ "action.approve": "",
"action.cancel": "キャンセル",
"action.change": "変更",
"action.close": "閉じる",
"action.commentsfeed": "コメントフィード",
"action.confirm": "確認",
"action.copylink": "リンクをコピー",
+ "action.decline": "",
"action.delete": "削除",
"action.edit": "編集",
"action.markallasread": "すべて既読にする",
@@ -16,6 +18,7 @@
"action.submit": "送信",
"action.vote": "このアイデアに投票",
"action.voted": "投票完了!",
+ "comment.moderation.notice": "",
"d41FkJ": "{count, plural, one {# tag} other {# tags}}",
"editor.markdownmode": "マークダウンエディターに切り替える",
"editor.richtextmode": "リッチテキストエディタに切り替える",
@@ -158,6 +161,7 @@
"newpost.modal.title": "あなたのアイデアを共有してください...",
"newpost.modal.title.label": "アイデアにタイトルをつける",
"newpost.modal.title.placeholder": "短くて簡潔なもの、一言でまとめましょう",
+ "newpost.moderation.notice": "",
"page.backhome": "<0>{0}</0>のホームページに戻ります。",
"page.notinvited.text": "あなたのメールアドレスのアカウントが見つかりませんでした",
"page.notinvited.title": "未招待",
@@ -172,6 +176,22 @@
"showpost.discussionpanel.emptymessage": "コメントがありません。",
"showpost.label.author": "<0/> · <1/>による投稿",
"showpost.message.nodescription": "詳細がありません。",
+ "showpost.moderation.admin.description": "",
+ "showpost.moderation.admin.title": "",
+ "showpost.moderation.approved": "",
+ "showpost.moderation.approveerror": "",
+ "showpost.moderation.awaiting": "",
+ "showpost.moderation.comment.admin.description": "",
+ "showpost.moderation.comment.admin.title": "",
+ "showpost.moderation.comment.approved": "",
+ "showpost.moderation.comment.approveerror": "",
+ "showpost.moderation.comment.awaiting": "",
+ "showpost.moderation.comment.declined": "",
+ "showpost.moderation.comment.declineerror": "",
+ "showpost.moderation.commentsuccess": "",
+ "showpost.moderation.declined": "",
+ "showpost.moderation.declineerror": "",
+ "showpost.moderation.postsuccess": "",
"showpost.moderationpanel.text.help": "この操作は元に戻せません<0></0>。",
"showpost.moderationpanel.text.placeholder": "なぜこの投稿を削除するのですか? (任意)",
"showpost.mostwanted.comments": "{count, plural, one {# comment} other {# comments}}",
diff --git a/locale/nl/client.json b/locale/nl/client.json
index 86a36ac79..ccab3dc13 100644
--- a/locale/nl/client.json
+++ b/locale/nl/client.json
@@ -1,10 +1,12 @@
{
+ "action.approve": "",
"action.cancel": "Annuleren",
"action.change": "aanpassen",
"action.close": "Sluiten",
"action.commentsfeed": "Reactiefeed",
"action.confirm": "Bevestigen",
"action.copylink": "Link kopiëren",
+ "action.decline": "",
"action.delete": "Verwijderen",
"action.edit": "Bewerken",
"action.markallasread": "Markeer alles als gelezen",
@@ -16,6 +18,7 @@
"action.submit": "Verzenden",
"action.vote": "Stem op dit idee",
"action.voted": "Gestemd!",
+ "comment.moderation.notice": "",
"d41FkJ": "{count, plural, one {# tag} other {# tags}}",
"editor.markdownmode": "Overschakelen naar markdown-editor",
"editor.richtextmode": "Overschakelen naar rich text-editor",
@@ -158,6 +161,7 @@
"newpost.modal.title": "Deel uw idee...",
"newpost.modal.title.label": "Geef je idee een titel",
"newpost.modal.title.placeholder": "Iets kort en krachtigs, vat het samen in een paar woorden",
+ "newpost.moderation.notice": "",
"page.backhome": "Ga terug naar <0>{0}</0> startpagina.",
"page.notinvited.text": "We konden geen account vinden voor dit e-mailadres.",
"page.notinvited.title": "Niet uitgenodigd",
@@ -172,6 +176,22 @@
"showpost.discussionpanel.emptymessage": "Nog niemand heeft gereageerd.",
"showpost.label.author": "Geplaatst door <0/> · <1/>",
"showpost.message.nodescription": "Geen omschrijving opgegeven.",
+ "showpost.moderation.admin.description": "",
+ "showpost.moderation.admin.title": "",
+ "showpost.moderation.approved": "",
+ "showpost.moderation.approveerror": "",
+ "showpost.moderation.awaiting": "",
+ "showpost.moderation.comment.admin.description": "",
+ "showpost.moderation.comment.admin.title": "",
+ "showpost.moderation.comment.approved": "",
+ "showpost.moderation.comment.approveerror": "",
+ "showpost.moderation.comment.awaiting": "",
+ "showpost.moderation.comment.declined": "",
+ "showpost.moderation.comment.declineerror": "",
+ "showpost.moderation.commentsuccess": "",
+ "showpost.moderation.declined": "",
+ "showpost.moderation.declineerror": "",
+ "showpost.moderation.postsuccess": "",
"showpost.moderationpanel.text.help": "Deze bewerking kan <0>niet</0> ongedaan gemaakt worden.",
"showpost.moderationpanel.text.placeholder": "Waarom verwijder je dit bericht? (optioneel)",
"showpost.mostwanted.comments": "{count, plural, one {# comment} other {# comments}}",
diff --git a/locale/pl/client.json b/locale/pl/client.json
index 0aa1bf81f..4745447e0 100644
--- a/locale/pl/client.json
+++ b/locale/pl/client.json
@@ -1,10 +1,12 @@
{
+ "action.approve": "",
"action.cancel": "Anuluj",
"action.change": "zmień",
"action.close": "Zamknij",
"action.commentsfeed": "Kanał komentarzy",
"action.confirm": "Potwierdź",
"action.copylink": "Kopiuj link",
+ "action.decline": "",
"action.delete": "Usuń",
"action.edit": "Edytuj",
"action.markallasread": "Oznacz wszystkie jako przeczytane",
@@ -16,6 +18,7 @@
"action.submit": "Prześlij",
"action.vote": "Zagłosuj na ten pomysł",
"action.voted": "Zagłosowane!",
+ "comment.moderation.notice": "",
"d41FkJ": "{count, plural, one {# tag} other {# tags}}",
"editor.markdownmode": "Przełącz na edytor Markdown",
"editor.richtextmode": "Przełącz na edytor tekstu",
@@ -158,6 +161,7 @@
"newpost.modal.title": "Podziel się swoim pomysłem...",
"newpost.modal.title.label": "Nadaj swojemu pomysłowi tytuł",
"newpost.modal.title.placeholder": "Coś krótkiego i zwięzłego, podsumuj to w kilku słowach",
+ "newpost.moderation.notice": "",
"page.backhome": "Zabierz mnie z powrotem na stronę główną <0>{0}</0>.",
"page.notinvited.text": "Nie znaleźliśmy konta powiązanego z Twoim adresem email.",
"page.notinvited.title": "Niezaproszony",
@@ -172,6 +176,22 @@
"showpost.discussionpanel.emptymessage": "Wygląda na to, że nikt jeszcze nie skomentował.",
"showpost.label.author": "Wysłane przez <0/> · <1/>",
"showpost.message.nodescription": "Brak opisu.",
+ "showpost.moderation.admin.description": "",
+ "showpost.moderation.admin.title": "",
+ "showpost.moderation.approved": "",
+ "showpost.moderation.approveerror": "",
+ "showpost.moderation.awaiting": "",
+ "showpost.moderation.comment.admin.description": "",
+ "showpost.moderation.comment.admin.title": "",
+ "showpost.moderation.comment.approved": "",
+ "showpost.moderation.comment.approveerror": "",
+ "showpost.moderation.comment.awaiting": "",
+ "showpost.moderation.comment.declined": "",
+ "showpost.moderation.comment.declineerror": "",
+ "showpost.moderation.commentsuccess": "",
+ "showpost.moderation.declined": "",
+ "showpost.moderation.declineerror": "",
+ "showpost.moderation.postsuccess": "",
"showpost.moderationpanel.text.help": "Ta akcja <0>nie może</0> zostać wykonana.",
"showpost.moderationpanel.text.placeholder": "Dlaczego usuwasz ten wpis? (opcjonalne)",
"showpost.mostwanted.comments": "{count, plural, one {# comment} other {# comments}}",
diff --git a/locale/pt-BR/client.json b/locale/pt-BR/client.json
index 07f2d348b..d62cac41b 100644
--- a/locale/pt-BR/client.json
+++ b/locale/pt-BR/client.json
@@ -1,10 +1,12 @@
{
+ "action.approve": "",
"action.cancel": "Cancelar",
"action.change": "alterar",
"action.close": "Fechar",
"action.commentsfeed": "Feed de comentários",
"action.confirm": "Confirmar",
"action.copylink": "Copiar link",
+ "action.decline": "",
"action.delete": "Deletar",
"action.edit": "Editar",
"action.markallasread": "Marcar todas como lidas",
@@ -16,6 +18,7 @@
"action.submit": "Enviar",
"action.vote": "Votar",
"action.voted": "Votado",
+ "comment.moderation.notice": "",
"d41FkJ": "{count, plural, one {# tag} other {# tags}}",
"editor.markdownmode": "Alternar para o editor de markdown",
"editor.richtextmode": "Alternar para editor de texto avançado",
@@ -158,6 +161,7 @@
"newpost.modal.title": "Compartilhe sua ideia...",
"newpost.modal.title.label": "Dê um título à sua ideia",
"newpost.modal.title.placeholder": "Algo curto e rápido, resuma em poucas palavras",
+ "newpost.moderation.notice": "",
"page.backhome": "Me leve de volta para a página inicial <0>{0}</0>.",
"page.notinvited.text": "Não encontramos nenhuma conta para o seu endereço de e-mail.",
"page.notinvited.title": "Sem convite",
@@ -172,6 +176,22 @@
"showpost.discussionpanel.emptymessage": "Ninguém comentou ainda.",
"showpost.label.author": "Publicado por <0/> · <1/>",
"showpost.message.nodescription": "Nenhuma descrição fornecida.",
+ "showpost.moderation.admin.description": "",
+ "showpost.moderation.admin.title": "",
+ "showpost.moderation.approved": "",
+ "showpost.moderation.approveerror": "",
+ "showpost.moderation.awaiting": "",
+ "showpost.moderation.comment.admin.description": "",
+ "showpost.moderation.comment.admin.title": "",
+ "showpost.moderation.comment.approved": "",
+ "showpost.moderation.comment.approveerror": "",
+ "showpost.moderation.comment.awaiting": "",
+ "showpost.moderation.comment.declined": "",
+ "showpost.moderation.comment.declineerror": "",
+ "showpost.moderation.commentsuccess": "",
+ "showpost.moderation.declined": "",
+ "showpost.moderation.declineerror": "",
+ "showpost.moderation.postsuccess": "",
"showpost.moderationpanel.text.help": "Esta operação <0>não pode</0> ser desfeita.",
"showpost.moderationpanel.text.placeholder": "Por que você está excluindo esta postagem? (opcional)",
"showpost.mostwanted.comments": "{count, plural, one {# comment} other {# comments}}",
diff --git a/locale/ru/client.json b/locale/ru/client.json
index 9d23ae9f5..c134af051 100644
--- a/locale/ru/client.json
+++ b/locale/ru/client.json
@@ -1,10 +1,12 @@
{
+ "action.approve": "",
"action.cancel": "Отмена",
"action.change": "изменить",
"action.close": "Закрыть",
"action.commentsfeed": "Лента комментариев",
"action.confirm": "Подтвердить",
"action.copylink": "Копировать ссылку",
+ "action.decline": "",
"action.delete": "Удалить",
"action.edit": "Изменить",
"action.markallasread": "Отметить всё как прочитанное",
@@ -16,6 +18,7 @@
"action.submit": "Продолжить",
"action.vote": "Проголосуйте за эту идею",
"action.voted": "Проголосовал!",
+ "comment.moderation.notice": "",
"d41FkJ": "{count, plural, one {# tag} other {# tags}}",
"editor.markdownmode": "Переключиться на редактор разметки",
"editor.richtextmode": "Переключиться на редактор форматированного текста",
@@ -158,6 +161,7 @@
"newpost.modal.title": "Поделитесь своей идеей...",
"newpost.modal.title.label": "Дайте название своей идее",
"newpost.modal.title.placeholder": "Что-то короткое и емкое, изложите это в нескольких словах.",
+ "newpost.moderation.notice": "",
"page.backhome": "Верните меня на домашнюю страницу <0>{0}</0>.",
"page.notinvited.text": "Мы не смогли найти аккаунт, соответствующий этому адресу электронной почты.",
"page.notinvited.title": "Не приглашён",
@@ -172,6 +176,22 @@
"showpost.discussionpanel.emptymessage": "Комментариев нет.",
"showpost.label.author": "Создал <0/> · <1/>",
"showpost.message.nodescription": "Описания нет.",
+ "showpost.moderation.admin.description": "",
+ "showpost.moderation.admin.title": "",
+ "showpost.moderation.approved": "",
+ "showpost.moderation.approveerror": "",
+ "showpost.moderation.awaiting": "",
+ "showpost.moderation.comment.admin.description": "",
+ "showpost.moderation.comment.admin.title": "",
+ "showpost.moderation.comment.approved": "",
+ "showpost.moderation.comment.approveerror": "",
+ "showpost.moderation.comment.awaiting": "",
+ "showpost.moderation.comment.declined": "",
+ "showpost.moderation.comment.declineerror": "",
+ "showpost.moderation.commentsuccess": "",
+ "showpost.moderation.declined": "",
+ "showpost.moderation.declineerror": "",
+ "showpost.moderation.postsuccess": "",
"showpost.moderationpanel.text.help": "Это действие <0>нельзя</0> отменить.",
"showpost.moderationpanel.text.placeholder": "Почему вы удаляете этот пост? (необязательно)",
"showpost.mostwanted.comments": "{count, plural, one {# comment} other {# comments}}",
diff --git a/locale/sk/client.json b/locale/sk/client.json
index 9cc563320..782c4497f 100644
--- a/locale/sk/client.json
+++ b/locale/sk/client.json
@@ -1,10 +1,12 @@
{
+ "action.approve": "",
"action.cancel": "Zrušiť",
"action.change": "zmeniť",
"action.close": "Zavrieť",
"action.commentsfeed": "Kanál komentárov",
"action.confirm": "Potvrdiť",
"action.copylink": "Kopírovať odkaz",
+ "action.decline": "",
"action.delete": "Vymazať",
"action.edit": "Upraviť",
"action.markallasread": "Označiť všetko ako prečítané",
@@ -16,6 +18,7 @@
"action.submit": "Potvrdiť",
"action.vote": "Hlasovať za tento nápad",
"action.voted": "Zahlasované!",
+ "comment.moderation.notice": "",
"d41FkJ": "{count, plural, one {# značka} few {# značky} other {# značiek}}",
"editor.markdownmode": "Prepnúť na markdown editor",
"editor.richtextmode": "Prepnúť na bohatý textový editor",
@@ -158,6 +161,7 @@
"newpost.modal.title": "Podeľte sa o svoj nápad...",
"newpost.modal.title.label": "Dajte svojmu nápadu názov",
"newpost.modal.title.placeholder": "Niečo krátke a výstižné, zhrňte to pár slovami",
+ "newpost.moderation.notice": "",
"page.backhome": "Vezmi ma späť do <0>{0}</0> domovskú stránku.",
"page.notinvited.text": "Nepodarilo sa nám nájsť účet pre vašu emailovú adresu.",
"page.notinvited.title": "Nepozvaný",
@@ -172,6 +176,22 @@
"showpost.discussionpanel.emptymessage": "Zatiaľ sa nikto nevyjadril.",
"showpost.label.author": "Pridané <0/> · <1/>",
"showpost.message.nodescription": "Nie je poskytnutý žiadny popis.",
+ "showpost.moderation.admin.description": "",
+ "showpost.moderation.admin.title": "",
+ "showpost.moderation.approved": "",
+ "showpost.moderation.approveerror": "",
+ "showpost.moderation.awaiting": "",
+ "showpost.moderation.comment.admin.description": "",
+ "showpost.moderation.comment.admin.title": "",
+ "showpost.moderation.comment.approved": "",
+ "showpost.moderation.comment.approveerror": "",
+ "showpost.moderation.comment.awaiting": "",
+ "showpost.moderation.comment.declined": "",
+ "showpost.moderation.comment.declineerror": "",
+ "showpost.moderation.commentsuccess": "",
+ "showpost.moderation.declined": "",
+ "showpost.moderation.declineerror": "",
+ "showpost.moderation.postsuccess": "",
"showpost.moderationpanel.text.help": "Túto operáciu <0>nemožno</0> vrátiť späť.",
"showpost.moderationpanel.text.placeholder": "Prečo mažete tento príspevok? (voliteľné)",
"showpost.mostwanted.comments": "{count, plural, one {# komentár} few {# komentáre} other {# komentárov}}",
diff --git a/locale/sv-SE/client.json b/locale/sv-SE/client.json
index b2ca6f9f6..0491c8cd9 100644
--- a/locale/sv-SE/client.json
+++ b/locale/sv-SE/client.json
@@ -1,10 +1,12 @@
{
+ "action.approve": "",
"action.cancel": "Avbryt",
"action.change": "ändra",
"action.close": "Stäng",
"action.commentsfeed": "Kommentarflöde",
"action.confirm": "Bekräfta",
"action.copylink": "Kopiera länk",
+ "action.decline": "",
"action.delete": "Radera",
"action.edit": "Ändra",
"action.markallasread": "Markera alla som lästa",
@@ -16,6 +18,7 @@
"action.submit": "Skicka",
"action.vote": "Rösta på den här idén",
"action.voted": "Röstade!",
+ "comment.moderation.notice": "",
"d41FkJ": "{count, plural, one {# tag} other {# tags}}",
"editor.markdownmode": "Växla till markdown-redigeraren",
"editor.richtextmode": "Växla till RTF-redigerare",
@@ -158,6 +161,7 @@
"newpost.modal.title": "Dela din idé...",
"newpost.modal.title.label": "Ge din idé en titel",
"newpost.modal.title.placeholder": "Något kort och rappt, sammanfatta det med några få ord",
+ "newpost.moderation.notice": "",
"page.backhome": "Ta mig tillbaka till <0>{0}</0> hemsida.",
"page.notinvited.text": "Vi kunde inte hitta ett konto för din e-postadress.",
"page.notinvited.title": "Inte inbjuden",
@@ -172,6 +176,22 @@
"showpost.discussionpanel.emptymessage": "Ingen har kommenterat ännu.",
"showpost.label.author": "Skriven av <0/> · <1/>",
"showpost.message.nodescription": "Ingen beskrivning angiven.",
+ "showpost.moderation.admin.description": "",
+ "showpost.moderation.admin.title": "",
+ "showpost.moderation.approved": "",
+ "showpost.moderation.approveerror": "",
+ "showpost.moderation.awaiting": "",
+ "showpost.moderation.comment.admin.description": "",
+ "showpost.moderation.comment.admin.title": "",
+ "showpost.moderation.comment.approved": "",
+ "showpost.moderation.comment.approveerror": "",
+ "showpost.moderation.comment.awaiting": "",
+ "showpost.moderation.comment.declined": "",
+ "showpost.moderation.comment.declineerror": "",
+ "showpost.moderation.commentsuccess": "",
+ "showpost.moderation.declined": "",
+ "showpost.moderation.declineerror": "",
+ "showpost.moderation.postsuccess": "",
"showpost.moderationpanel.text.help": "Denna åtgärd <0>går inte</0> att ångra.",
"showpost.moderationpanel.text.placeholder": "Varför tar du bort detta inlägg? (valfritt)",
"showpost.mostwanted.comments": "{count, plural, one {# comment} other {# comments}}",
diff --git a/locale/tr/client.json b/locale/tr/client.json
index dc1128176..83fabac63 100644
--- a/locale/tr/client.json
+++ b/locale/tr/client.json
@@ -1,10 +1,12 @@
{
+ "action.approve": "",
"action.cancel": "İptal",
"action.change": "değiştir",
"action.close": "Kapat",
"action.commentsfeed": "Yorum Beslemesi",
"action.confirm": "Onayla",
"action.copylink": "Bağlantıyı kopyala",
+ "action.decline": "",
"action.delete": "Sil",
"action.edit": "Düzenle",
"action.markallasread": "Tümünü Okundu olarak işaretle",
@@ -16,6 +18,7 @@
"action.submit": "Gönder",
"action.vote": "Bu fikre oy verin",
"action.voted": "Oy verildi!",
+ "comment.moderation.notice": "",
"d41FkJ": "{count, plural, one {# tag} other {# tags}}",
"editor.markdownmode": "Markdown düzenleyicisine geç",
"editor.richtextmode": "Zengin metin düzenleyicisine geç",
@@ -158,6 +161,7 @@
"newpost.modal.title": "Fikrinizi paylaşın...",
"newpost.modal.title.label": "Fikrinize bir başlık verin",
"newpost.modal.title.placeholder": "Kısa ve öz bir şey, birkaç kelimeyle özetleyin",
+ "newpost.moderation.notice": "",
"page.backhome": "Beni <0>{0}</0> ana sayfaya götür.",
"page.notinvited.text": "E-posta adresinizle ilişkili bir hesap bulamadık.",
"page.notinvited.title": "Davet edilmemiş",
@@ -172,6 +176,22 @@
"showpost.discussionpanel.emptymessage": "Henüz hiç kimse yorum yapmadı.",
"showpost.label.author": "<0/> · <1/> tarafından gönderildi",
"showpost.message.nodescription": "Herhangi bir açıklama belirtilmedi.",
+ "showpost.moderation.admin.description": "",
+ "showpost.moderation.admin.title": "",
+ "showpost.moderation.approved": "",
+ "showpost.moderation.approveerror": "",
+ "showpost.moderation.awaiting": "",
+ "showpost.moderation.comment.admin.description": "",
+ "showpost.moderation.comment.admin.title": "",
+ "showpost.moderation.comment.approved": "",
+ "showpost.moderation.comment.approveerror": "",
+ "showpost.moderation.comment.awaiting": "",
+ "showpost.moderation.comment.declined": "",
+ "showpost.moderation.comment.declineerror": "",
+ "showpost.moderation.commentsuccess": "",
+ "showpost.moderation.declined": "",
+ "showpost.moderation.declineerror": "",
+ "showpost.moderation.postsuccess": "",
"showpost.moderationpanel.text.help": "Bu işlem geri <0>alınamaz</0>.",
"showpost.moderationpanel.text.placeholder": "Bu öneriyi neden siliyorsunuz? (isteğe bağlı)",
"showpost.mostwanted.comments": "{count, plural, one {# comment} other {# comments}}",
diff --git a/locale/zh-CN/client.json b/locale/zh-CN/client.json
index 4e74ab08b..7c6da8dbc 100644
--- a/locale/zh-CN/client.json
+++ b/locale/zh-CN/client.json
@@ -1,10 +1,12 @@
{
+ "action.approve": "",
"action.cancel": "取消",
"action.change": "修改",
"action.close": "关闭",
"action.commentsfeed": "评论提要",
"action.confirm": "确认",
"action.copylink": "复制链接",
+ "action.decline": "",
"action.delete": "删除",
"action.edit": "编辑",
"action.markallasread": "将全部标记为已读",
@@ -16,6 +18,7 @@
"action.submit": "提交",
"action.vote": "投票支持这个想法",
"action.voted": "已投票!",
+ "comment.moderation.notice": "",
"d41FkJ": "{count, plural, one {# tag} other {# tags}}",
"editor.markdownmode": "切换到 Markdown 编辑器",
"editor.richtextmode": "切换到富文本编辑器",
@@ -158,6 +161,7 @@
"newpost.modal.title": "分享你的想法...",
"newpost.modal.title.label": "给你的想法起个标题",
"newpost.modal.title.placeholder": "简短而活泼,用几句话概括",
+ "newpost.moderation.notice": "",
"page.backhome": "带我回到<0>{0}</0>主页.",
"page.notinvited.text": "我们找不到您电子邮件地址的帐户.",
"page.notinvited.title": "未被邀请",
@@ -172,6 +176,22 @@
"showpost.discussionpanel.emptymessage": "还没有人发表评论.",
"showpost.label.author": "发表者 <0/> · <1/>",
"showpost.message.nodescription": "未提供描述.",
+ "showpost.moderation.admin.description": "",
+ "showpost.moderation.admin.title": "",
+ "showpost.moderation.approved": "",
+ "showpost.moderation.approveerror": "",
+ "showpost.moderation.awaiting": "",
+ "showpost.moderation.comment.admin.description": "",
+ "showpost.moderation.comment.admin.title": "",
+ "showpost.moderation.comment.approved": "",
+ "showpost.moderation.comment.approveerror": "",
+ "showpost.moderation.comment.awaiting": "",
+ "showpost.moderation.comment.declined": "",
+ "showpost.moderation.comment.declineerror": "",
+ "showpost.moderation.commentsuccess": "",
+ "showpost.moderation.declined": "",
+ "showpost.moderation.declineerror": "",
+ "showpost.moderation.postsuccess": "",
"showpost.moderationpanel.text.help": "此操作<0>无法撤消</0>.",
"showpost.moderationpanel.text.placeholder": "你为什么要删除这篇内容?(可选)",
"showpost.mostwanted.comments": "{count, plural, one {# comment} other {# comments}}",
diff --git a/public/components/VoteCounter.spec.tsx b/public/components/VoteCounter.spec.tsx
index bcbf6acb5..cfd63749e 100644
--- a/public/components/VoteCounter.spec.tsx
+++ b/public/components/VoteCounter.spec.tsx
@@ -31,6 +31,7 @@ beforeEach(() => {
votesCount: 5,
commentsCount: 2,
tags: [],
+ isApproved: true,
}
})
diff --git a/public/models/post.ts b/public/models/post.ts
index e9f5a6ff2..2c5fd6bac 100644
--- a/public/models/post.ts
+++ b/public/models/post.ts
@@ -14,6 +14,7 @@ export interface Post {
votesCount: number
commentsCount: number
tags: string[]
+ isApproved: boolean
}
export class PostStatus {
@@ -66,6 +67,7 @@ export interface Comment {
reactionCounts?: ReactionCount[]
editedAt?: string
editedBy?: User
+ isApproved: boolean
}
export interface Tag {
diff --git a/public/pages/Home/components/ShareFeedback.tsx b/public/pages/Home/components/ShareFeedback.tsx
index 67e655da9..ddeda7511 100644
--- a/public/pages/Home/components/ShareFeedback.tsx
+++ b/public/pages/Home/components/ShareFeedback.tsx
@@ -5,7 +5,7 @@ import { SignInControl } from "@fider/components/common/SignInControl"
import { Modal, CloseIcon, Form, Button, Input, LegalFooter } from "@fider/components/common"
import { useFider } from "@fider/hooks"
import { Trans } from "@lingui/react/macro"
-import { actions, Failure, querystring, classSet } from "@fider/services"
+import { actions, Failure, querystring, classSet, cache } from "@fider/services"
import { i18n } from "@lingui/core"
import { Tag } from "@fider/models"
import { SimilarPosts } from "../components/SimilarPosts"
@@ -183,7 +183,11 @@ export const ShareFeedback: React.FC<ShareFeedbackProps> = (props) => {
clearError()
clearCache()
clearAttachments()
- setPostCreated()
+ if (fider.session.tenant.isModerationEnabled && !fider.session.user.isCollaborator) {
+ cache.session.set("POST_CREATED_MODERATION", "true")
+ } else {
+ cache.session.set("POST_CREATED_SUCCESS", "true")
+ }
location.href = `/posts/${result.data.number}/${result.data.slug}`
} else if (result.error) {
setError(result.error)
@@ -253,6 +257,13 @@ export const ShareFeedback: React.FC<ShareFeedbackProps> = (props) => {
</div>
)}
</Form>
+ {fider.session.tenant.isModerationEnabled && fider.session.isAuthenticated && !fider.session.user.isCollaborator && (
+ <div className="c-form-field">
+ <div className="text-muted text-sm p-2 bg-gray-100 rounded border-l-4 border-yellow-500">
+ <Trans id="newpost.moderation.notice">Your post will be reviewed by an administrator before being visible to other users.</Trans>
+ </div>
+ </div>
+ )}
</div>
</div>
{/* For unauthenticated users, always show the sign-in control */}
diff --git a/public/pages/ShowPost/ShowPost.page.tsx b/public/pages/ShowPost/ShowPost.page.tsx
index 90cec7f30..ec1f06822 100644
--- a/public/pages/ShowPost/ShowPost.page.tsx
+++ b/public/pages/ShowPost/ShowPost.page.tsx
@@ -48,6 +48,7 @@ const canEditPost = (user: CurrentUser, post: Post) => {
}
export default function ShowPostPage(props: ShowPostPageProps) {
+ const fider = useFider()
const [editMode, setEditMode] = useState(false)
const [showDeleteModal, setShowDeleteModal] = useState(false)
const [isRSSModalOpen, setIsRSSModalOpen] = useState(false)
@@ -101,11 +102,23 @@ export default function ShowPostPage(props: ShowPostPageProps) {
useEffect(() => {
const showSuccess = cache.session.get("POST_CREATED_SUCCESS")
+ const showModeration = cache.session.get("POST_CREATED_MODERATION")
+ const showCommentModeration = cache.session.get("COMMENT_CREATED_MODERATION")
+
if (showSuccess) {
cache.session.remove("POST_CREATED_SUCCESS")
- // Show success message/toast
notify.success(t({ id: "mysettings.notification.event.newpostcreated", message: "Your idea has been added 👍" }))
}
+
+ if (showModeration) {
+ cache.session.remove("POST_CREATED_MODERATION")
+ notify.success(t({ id: "showpost.moderation.postsuccess", message: "Your idea has been submitted and is awaiting moderation 📝" }))
+ }
+
+ if (showCommentModeration) {
+ cache.session.remove("COMMENT_CREATED_MODERATION")
+ notify.success(t({ id: "showpost.moderation.commentsuccess", message: "Your comment has been submitted and is awaiting moderation 📝" }))
+ }
}, [])
const saveChanges = async () => {
@@ -138,6 +151,26 @@ export default function ShowPostPage(props: ShowPostPageProps) {
setNewDescription(value)
}
+ const handleApprovePost = async () => {
+ const result = await actions.approvePost(props.post.id)
+ if (result.ok) {
+ notify.success(<Trans id="showpost.moderation.approved">Post approved successfully</Trans>)
+ setTimeout(() => location.reload(), 1500)
+ } else {
+ notify.error(<Trans id="showpost.moderation.approveerror">Failed to approve post</Trans>)
+ }
+ }
+
+ const handleDeclinePost = async () => {
+ const result = await actions.declinePost(props.post.id)
+ if (result.ok) {
+ notify.success(<Trans id="showpost.moderation.declined">Post declined successfully</Trans>)
+ setTimeout(() => location.reload(), 1500)
+ } else {
+ notify.error(<Trans id="showpost.moderation.declineerror">Failed to decline post</Trans>)
+ }
+ }
+
const onActionSelected = (action: "copy" | "delete" | "status" | "feed" | "edit") => () => {
if (action === "copy") {
navigator.clipboard.writeText(window.location.href)
@@ -218,6 +251,39 @@ export default function ShowPostPage(props: ShowPostPageProps) {
) : (
<>
<h1 className="text-large text-break">{props.post.title}</h1>
+
+ {/* Moderation status banner for unapproved posts */}
+ {fider.session.tenant.isModerationEnabled && !props.post.isApproved && (
+ <div className="mt-4">
+ {fider.session.isAuthenticated && fider.session.user.id === props.post.user.id && (
+ <div className="text-muted text-sm p-3 bg-yellow-50 rounded border-l-4 border-yellow-500">
+ <Trans id="showpost.moderation.awaiting">
+ This post is awaiting moderation by an administrator before being visible to other users.
+ </Trans>
+ </div>
+ )}
+
+ {/* Admin moderation buttons */}
+ {fider.session.isAuthenticated && fider.session.user.isCollaborator && (
+ <div className="p-3 bg-blue-50 rounded border-l-4 border-blue-500">
+ <div className="mb-2 text-sm font-medium text-blue-800">
+ <Trans id="showpost.moderation.admin.title">Post Moderation</Trans>
+ </div>
+ <div className="text-sm text-blue-700 mb-3">
+ <Trans id="showpost.moderation.admin.description">This post is awaiting your approval to be visible to all users.</Trans>
+ </div>
+ <HStack spacing={2}>
+ <Button variant="primary" size="small" onClick={handleApprovePost}>
+ <Trans id="action.approve">Approve</Trans>
+ </Button>
+ <Button variant="danger" size="small" onClick={handleDeclinePost}>
+ <Trans id="action.decline">Decline</Trans>
+ </Button>
+ </HStack>
+ </div>
+ )}
+ </div>
+ )}
</>
)}
</div>
diff --git a/public/pages/ShowPost/components/CommentInput.tsx b/public/pages/ShowPost/components/CommentInput.tsx
index 3549bc945..578df79ed 100644
--- a/public/pages/ShowPost/components/CommentInput.tsx
+++ b/public/pages/ShowPost/components/CommentInput.tsx
@@ -55,6 +55,9 @@ export const CommentInput = (props: CommentInputProps) => {
if (result.ok) {
clearAttachments()
cache.session.remove(getCacheKey(CACHE_TITLE_KEY))
+ if (fider.session.tenant.isModerationEnabled && !fider.session.user.isCollaborator) {
+ cache.session.set("COMMENT_CREATED_MODERATION", "true")
+ }
location.reload()
} else {
setError(result.error)
@@ -101,6 +104,12 @@ export const CommentInput = (props: CommentInputProps) => {
onImageUploaded={handleImageUploaded}
/>
+ {fider.session.tenant.isModerationEnabled && Fider.session.isAuthenticated && !Fider.session.user.isCollaborator && (
+ <div className="mt-2 text-muted text-sm p-2 bg-gray-50 rounded border-l-4 border-yellow-500">
+ <Trans id="comment.moderation.notice">Your comment will be reviewed by an administrator before being visible to other users.</Trans>
+ </div>
+ )}
+
{hasContent && (
<>
<Button variant="primary" onClick={submit} className="mt-2">
diff --git a/public/pages/ShowPost/components/ShowComment.tsx b/public/pages/ShowPost/components/ShowComment.tsx
index fb090f084..0acfa8211 100644
--- a/public/pages/ShowPost/components/ShowComment.tsx
+++ b/public/pages/ShowPost/components/ShowComment.tsx
@@ -83,6 +83,26 @@ export const ShowComment = (props: ShowCommentProps) => {
}
}
+ const handleApproveComment = async () => {
+ const result = await actions.approveComment(props.comment.id)
+ if (result.ok) {
+ notify.success(<Trans id="showpost.moderation.comment.approved">Comment approved successfully</Trans>)
+ setTimeout(() => location.reload(), 1500)
+ } else {
+ notify.error(<Trans id="showpost.moderation.comment.approveerror">Failed to approve comment</Trans>)
+ }
+ }
+
+ const handleDeclineComment = async () => {
+ const result = await actions.declineComment(props.comment.id)
+ if (result.ok) {
+ notify.success(<Trans id="showpost.moderation.comment.declined">Comment declined successfully</Trans>)
+ setTimeout(() => location.reload(), 1500)
+ } else {
+ notify.error(<Trans id="showpost.moderation.comment.declineerror">Failed to decline comment</Trans>)
+ }
+ }
+
const toggleReaction = async (emoji: string) => {
const response = await actions.toggleCommentReaction(props.post.number, comment.id, emoji)
if (response.ok) {
@@ -225,6 +245,42 @@ export const ShowComment = (props: ShowCommentProps) => {
) : (
<>
<Markdown text={comment.content} style="full" />
+
+ {/* Moderation status banner for unapproved comments */}
+ {fider.session.tenant.isModerationEnabled && !comment.isApproved && (
+ <div className="mt-3">
+ {fider.session.isAuthenticated && fider.session.user.id === comment.user.id && (
+ <div className="text-muted text-xs p-2 bg-yellow-50 rounded border-l-4 border-yellow-500">
+ <Trans id="showpost.moderation.comment.awaiting">
+ This comment is awaiting moderation by an administrator before being visible to other users.
+ </Trans>
+ </div>
+ )}
+
+ {/* Admin moderation buttons */}
+ {fider.session.isAuthenticated && fider.session.user.isCollaborator && (
+ <div className="p-2 bg-blue-50 rounded border-l-4 border-blue-500">
+ <div className="mb-1 text-xs font-medium text-blue-800">
+ <Trans id="showpost.moderation.comment.admin.title">Comment Moderation</Trans>
+ </div>
+ <div className="text-xs text-blue-700 mb-2">
+ <Trans id="showpost.moderation.comment.admin.description">
+ This comment is awaiting your approval to be visible to all users.
+ </Trans>
+ </div>
+ <HStack spacing={1}>
+ <Button variant="primary" size="small" onClick={handleApproveComment}>
+ <Trans id="action.approve">Approve</Trans>
+ </Button>
+ <Button variant="danger" size="small" onClick={handleDeclineComment}>
+ <Trans id="action.decline">Decline</Trans>
+ </Button>
+ </HStack>
+ </div>
+ )}
+ </div>
+ )}
+
<Reactions reactions={localReactionCounts} emojiSelectorRef={emojiSelectorRef} toggleReaction={toggleReaction} />
</>
)}
diff --git a/public/services/actions/post.ts b/public/services/actions/post.ts
index 18a5e43d1..e9948555c 100644
--- a/public/services/actions/post.ts
+++ b/public/services/actions/post.ts
@@ -118,3 +118,19 @@ export const createPost = async (title: string, description: string, attachments
export const updatePost = async (postNumber: number, title: string, description: string, attachments: ImageUpload[]): Promise<Result> => {
return http.put(`/api/v1/posts/${postNumber}`, { title, description, attachments }).then(http.event("post", "update"))
}
+
+export const approvePost = async (postID: number): Promise<Result> => {
+ return http.post(`/api/v1/admin/moderation/posts/${postID}/approve`).then(http.event("post", "approve"))
+}
+
+export const declinePost = async (postID: number): Promise<Result> => {
+ return http.post(`/api/v1/admin/moderation/posts/${postID}/decline`).then(http.event("post", "decline"))
+}
+
+export const approveComment = async (commentID: number): Promise<Result> => {
+ return http.post(`/api/v1/admin/moderation/comments/${commentID}/approve`).then(http.event("comment", "approve"))
+}
+
+export const declineComment = async (commentID: number): Promise<Result> => {
+ return http.post(`/api/v1/admin/moderation/comments/${commentID}/decline`).then(http.event("comment", "decline"))
+}