Skip to content

armgit / fider

Public Imported from GitHub
0

Open platform to collect and prioritize feedback

Merge branch 'main' into content-moderation

Matt Roberts3e4f50069d2a
diff --cc app/pkg/dbx/setup.sql
index 0f7fa69b2,592cfa75c..a5f07306e
--- a/app/pkg/dbx/setup.sql
+++ b/app/pkg/dbx/setup.sql
@@@ -40,3 -40,11 +40,11 @@@ INSERT INTO users (name, email, tenant_
VALUES ('Trial Expired', '[email protected]', 3, now(), 3, 1, 2, '');
INSERT INTO user_providers (user_id, tenant_id, provider, provider_uid, created_at)
VALUES (6, 3, 'facebook', 'FB3333', now());
+
-INSERT INTO tenants (name, subdomain, created_at, cname, invitation, welcome_message, status, is_private, custom_css, logo_bkey, locale, is_email_auth_allowed, is_feed_enabled, prevent_indexing)
-VALUES ('Demonstration German', 'german', now(), '', '', '', 1, false, '', '', 'de', true, true, false);
++INSERT INTO tenants (name, subdomain, created_at, cname, invitation, welcome_message, status, is_private, custom_css, logo_bkey, locale, is_email_auth_allowed, is_feed_enabled, prevent_indexing, is_moderation_enabled)
++VALUES ('Demonstration German', 'german', now(), '', '', '', 1, false, '', '', 'de', true, true, false, false);
+
+ INSERT INTO users (name, email, tenant_id, created_at, role, status, avatar_type, avatar_bkey)
+ VALUES ('Jon Snow', '[email protected]', 4, now(), 3, 1, 2, '');
+ INSERT INTO user_providers (user_id, tenant_id, provider, provider_uid, created_at)
+ VALUES (7, 4, 'facebook', 'FB4444', now());
diff --cc app/services/sqlstore/dbEntities/post.go
index 07304cccf,000000000..b600f42dd
mode 100644,000000..100644
--- a/app/services/sqlstore/dbEntities/post.go
+++ b/app/services/sqlstore/dbEntities/post.go
@@@ -1,73 -1,0 +1,74 @@@
+package dbEntities
+
+import (
+ "context"
+ "time"
+
+ "github.com/getfider/fider/app/models/entity"
+ "github.com/getfider/fider/app/models/enum"
+ "github.com/getfider/fider/app/pkg/dbx"
+ "github.com/lib/pq"
+)
+
+type Post struct {
+ ID int `db:"id"`
+ Number int `db:"number"`
+ Title string `db:"title"`
+ Slug string `db:"slug"`
+ Description string `db:"description"`
+ CreatedAt time.Time `db:"created_at"`
++ Search []byte `db:"search"`
+ User *User `db:"user"`
+ HasVoted bool `db:"has_voted"`
+ VotesCount int `db:"votes_count"`
+ CommentsCount int `db:"comments_count"`
+ RecentVotes int `db:"recent_votes_count"`
+ RecentComments int `db:"recent_comments_count"`
+ Status int `db:"status"`
+ Response dbx.NullString `db:"response"`
+ RespondedAt dbx.NullTime `db:"response_date"`
+ ResponseUser *User `db:"response_user"`
+ OriginalNumber dbx.NullInt `db:"original_number"`
+ OriginalTitle dbx.NullString `db:"original_title"`
+ OriginalSlug dbx.NullString `db:"original_slug"`
+ OriginalStatus dbx.NullInt `db:"original_status"`
+ Tags pq.StringArray `db:"tags"`
+ IsApproved bool `db:"is_approved"`
+}
+
+func (i *Post) ToModel(ctx context.Context) *entity.Post {
+ post := &entity.Post{
+ ID: i.ID,
+ Number: i.Number,
+ Title: i.Title,
+ Slug: i.Slug,
+ Description: i.Description,
+ CreatedAt: i.CreatedAt,
+ User: i.User.ToModel(ctx),
+ HasVoted: i.HasVoted,
+ VotesCount: i.VotesCount,
+ CommentsCount: i.CommentsCount,
+ Status: enum.PostStatus(i.Status),
+ Tags: i.Tags,
+ IsApproved: i.IsApproved,
+ }
+
+ if i.Response.Valid {
+ post.Response = &entity.PostResponse{
+ Text: i.Response.String,
+ RespondedAt: i.RespondedAt.Time,
+ User: i.ResponseUser.ToModel(ctx),
+ }
+
+ if i.OriginalNumber.Valid {
+ post.Response.Original = &entity.OriginalPost{
+ Number: int(i.OriginalNumber.Int64),
+ Title: i.OriginalTitle.String,
+ Slug: i.OriginalSlug.String,
+ Status: enum.PostStatus(i.OriginalStatus.Int64),
+ }
+ }
+ }
+
+ return post
+}
diff --cc app/services/sqlstore/postgres/post.go
index 3274b9883,c7ead685e..b49dc17be
--- a/app/services/sqlstore/postgres/post.go
+++ b/app/services/sqlstore/postgres/post.go
@@@ -232,12 -293,14 +235,15 @@@ func countPostPerStatus(ctx context.Con
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 || !user.RequiresModeration()
var id int
+ // Detect language using lingua-go
+ lang := detectPostLanguage(c.Title, c.Description)
+
err := trx.Get(&id,
- `INSERT INTO posts (title, slug, number, description, tenant_id, user_id, created_at, status, is_approved)
- VALUES ($1, $2, (SELECT COALESCE(MAX(number), 0) + 1 FROM posts p WHERE p.tenant_id = $4), $3, $4, $5, $6, 0, $7)
- RETURNING id`, c.Title, slug.Make(c.Title), c.Description, tenant.ID, user.ID, time.Now(), isApproved)
- `INSERT INTO posts (title, slug, number, description, tenant_id, user_id, created_at, status, language)
- VALUES ($1, $2, (SELECT COALESCE(MAX(number), 0) + 1 FROM posts p WHERE p.tenant_id = $4), $3, $4, $5, $6, 0, $7)
- RETURNING id`, c.Title, slug.Make(c.Title), c.Description, tenant.ID, user.ID, time.Now(), lang)
++ `INSERT INTO posts (title, slug, number, description, tenant_id, user_id, created_at, status, is_approved, language)
++ VALUES ($1, $2, (SELECT COALESCE(MAX(number), 0) + 1 FROM posts p WHERE p.tenant_id = $4), $3, $4, $5, $6, 0, $7, $8)
++ RETURNING id`, c.Title, slug.Make(c.Title), c.Description, tenant.ID, user.ID, time.Now(), isApproved, lang)
if err != nil {
return errors.Wrap(err, "failed add new post")
}
@@@ -258,9 -321,12 +264,12 @@@
func updatePost(ctx context.Context, c *cmd.UpdatePost) error {
return using(ctx, func(trx *dbx.Trx, tenant *entity.Tenant, user *entity.User) error {
- _, err := trx.Execute(`UPDATE posts SET title = $1, slug = $2, description = $3
- WHERE id = $4 AND tenant_id = $5`, c.Title, slug.Make(c.Title), c.Description, c.Post.ID, tenant.ID)
- if err != nil {
+ // Detect language using lingua-go
+ lang := detectPostLanguage(c.Title, c.Description)
- _, err := trx.Execute(`UPDATE posts SET title = $1, slug = $2, description = $3, language = $4
++ _, err := trx.Execute(`UPDATE posts SET title = $1, slug = $2, description = $3, language = $4
+ WHERE id = $5 AND tenant_id = $6`, c.Title, slug.Make(c.Title), c.Description, lang, c.Post.ID, tenant.ID)
+
- if err != nil {
++ if err != nil{
return errors.Wrap(err, "failed update post")
}
diff --cc app/services/sqlstore/postgres/post_test.go
index 7d5720b6e,ba5d7db40..1a776e695
--- a/app/services/sqlstore/postgres/post_test.go
+++ b/app/services/sqlstore/postgres/post_test.go
@@@ -24,10 -24,10 +24,10 @@@ func TestPostStorage_GetAll(t *testing.
now := time.Now()
- _, err := trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, is_approved) VALUES ('add twitter integration', 'add-twitter-integration', 1, 'Would be great to see it integrated with twitter', $1, 1, 1, 1, true)", now)
- _, err := trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, language) VALUES ('add twitter integration', 'add-twitter-integration', 1, 'Would be great to see it integrated with twitter', $1, 1, 1, 1, 'english')", now)
++ _, err := trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, is_approved, language) VALUES ('add twitter integration', 'add-twitter-integration', 1, 'Would be great to see it integrated with twitter', $1, 1, 1, 1, true, 'english')", now)
Expect(err).IsNil()
- _, err = trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, is_approved) VALUES ('this is my post', 'this-is-my-post', 2, 'no description', $1, 1, 2, 2, true)", now)
- _, err = trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, language) VALUES ('this is my post', 'this-is-my-post', 2, 'no description', $1, 1, 2, 2, 'english')", now)
++ _, err = trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, is_approved, language) VALUES ('this is my post', 'this-is-my-post', 2, 'no description', $1, 1, 2, 2, true, 'english')", now)
Expect(err).IsNil()
allPosts := &query.GetAllPosts{}
@@@ -60,6 -60,185 +60,185 @@@
Expect(search10.Result[0].Slug).Equals("add-twitter-integration")
Expect(search0.Result).HasLen(0)
}
+ func TestPostStorage_SearchGermanPosts(t *testing.T) {
+ SetupDatabaseTest(t)
+ defer TeardownDatabaseTest()
+
+ now := time.Now()
+
- _, err := trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, language) VALUES ('Wann kommt der \"Wächter\" für das neue Stunden- und Vertretungsplanmodul?', 'wann-kommt-der-wachter-fur-das-neue-stunden-und-vertretungsplanmodul', 1, 'Description', $1, $2, $3, 0, 'german')", now, germanTenant.ID, germanJonSnow.ID)
++ _, err := trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, is_approved, language) VALUES ('Wann kommt der \"Wächter\" für das neue Stunden- und Vertretungsplanmodul?', 'wann-kommt-der-wachter-fur-das-neue-stunden-und-vertretungsplanmodul', 1, 'Description', $1, $2, $3, 0, true, 'german')", now, germanTenant.ID, germanJonSnow.ID)
+ Expect(err).IsNil()
+
- _, err = trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, language) VALUES ('Neuer Stunden/ Vertretungsplanwächter', 'neuer-stunden-vertretungsplanwachter', 2, 'no description', $1, $2, $3, 0, 'german')", now, germanTenant.ID, germanJonSnow.ID)
++ _, err = trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, is_approved, language) VALUES ('Neuer Stunden/ Vertretungsplanwächter', 'neuer-stunden-vertretungsplanwachter', 2, 'no description', $1, $2, $3, 0, true, 'german')", now, germanTenant.ID, germanJonSnow.ID)
+ Expect(err).IsNil()
+
- _, err = trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, language) VALUES ('Ungeklärte Vertretung wird zu Entfall', 'ungeklarte-vertretung-wird-zu-entfall', 3, 'some description', $1, $2, $3, 0, 'german')", now, germanTenant.ID, germanJonSnow.ID)
++ _, err = trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, is_approved, language) VALUES ('Ungeklärte Vertretung wird zu Entfall', 'ungeklarte-vertretung-wird-zu-entfall', 3, 'some description', $1, $2, $3, 0, true, 'german')", now, germanTenant.ID, germanJonSnow.ID)
+ Expect(err).IsNil()
+
- _, err = trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, language) VALUES ('Vertretungsplan drucken', 'vertretungsplan-drucken', 4, 'another description', $1, $2, $3, 0, 'german')", now, germanTenant.ID, germanJonSnow.ID)
++ _, err = trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, is_approved, language) VALUES ('Vertretungsplan drucken', 'vertretungsplan-drucken', 4, 'another description', $1, $2, $3, 0, true, 'german')", now, germanTenant.ID, germanJonSnow.ID)
+ Expect(err).IsNil()
+
- _, err = trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, language) VALUES ('Vertretungsplanung Wochenansicht', 'vertretungsplanung-wochenansicht', 5, 'description here', $1, $2, $3, 0, 'german')", now, germanTenant.ID, germanJonSnow.ID)
++ _, err = trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, is_approved, language) VALUES ('Vertretungsplanung Wochenansicht', 'vertretungsplanung-wochenansicht', 5, 'description here', $1, $2, $3, 0, true, 'german')", now, germanTenant.ID, germanJonSnow.ID)
+ Expect(err).IsNil()
+
- _, err = trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, language) VALUES ('VertretungsBoard', 'vertretungsboard', 6, 'board description', $1, $2, $3, 0, 'german')", now, germanTenant.ID, germanJonSnow.ID)
++ _, err = trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, is_approved, language) VALUES ('VertretungsBoard', 'vertretungsboard', 6, 'board description', $1, $2, $3, 0, true, 'german')", now, germanTenant.ID, germanJonSnow.ID)
+ Expect(err).IsNil()
+
- _, err = trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, language) VALUES ('Abwesenheiten Vertretungsplan', 'abwesenheiten-vertretungsplan', 7, 'final description', $1, $2, $3, 0, 'german')", now, germanTenant.ID, germanJonSnow.ID)
++ _, err = trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, is_approved, language) VALUES ('Abwesenheiten Vertretungsplan', 'abwesenheiten-vertretungsplan', 7, 'final description', $1, $2, $3, 0, true, 'german')", now, germanTenant.ID, germanJonSnow.ID)
+ Expect(err).IsNil()
+
+ // Search for "Vertretung" - with German stemming, should match all posts containing Vertretung* variants
+ allPosts := &query.SearchPosts{Query: "Vertretung"}
+ err = bus.Dispatch(germanTenantCtx, allPosts)
+ Expect(err).IsNil()
+ // All 7 posts contain "Vertretung" or variants like "Vertretungsplan", "Vertretungsplanung", etc.
+ // German stemming correctly identifies these as the same root word
+ Expect(allPosts.Result).HasLen(7)
+
+ }
+
+ func TestPostStorage_SearchEnglishPosts_SingleWord(t *testing.T) {
+ SetupDatabaseTest(t)
+ defer TeardownDatabaseTest()
+
+ now := time.Now()
+
+ // Create posts with various forms of "integration"
- _, err := trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, language) VALUES ('Add Twitter Integration', 'add-twitter-integration', 1, 'Would be great to integrate with Twitter', $1, 1, 1, 0, 'english')", now)
++ _, err := trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, is_approved, language) VALUES ('Add Twitter Integration', 'add-twitter-integration', 1, 'Would be great to integrate with Twitter', $1, 1, 1, 0, true, 'english')", now)
+ Expect(err).IsNil()
+
- _, err = trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, language) VALUES ('GitHub Integration Needed', 'github-integration-needed', 2, 'Please add GitHub integration', $1, 1, 1, 0, 'english')", now)
++ _, err = trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, is_approved, language) VALUES ('GitHub Integration Needed', 'github-integration-needed', 2, 'Please add GitHub integration', $1, 1, 1, 0, true, 'english')", now)
+ Expect(err).IsNil()
+
- _, err = trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, language) VALUES ('Integrate with Slack', 'integrate-with-slack', 3, 'Slack integration would be useful', $1, 1, 1, 0, 'english')", now)
++ _, err = trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, is_approved, language) VALUES ('Integrate with Slack', 'integrate-with-slack', 3, 'Slack integration would be useful', $1, 1, 1, 0, true, 'english')", now)
+ Expect(err).IsNil()
+
- _, err = trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, language) VALUES ('Email Notifications', 'email-notifications', 4, 'Add email notification support', $1, 1, 1, 0, 'english')", now)
++ _, err = trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, is_approved, language) VALUES ('Email Notifications', 'email-notifications', 4, 'Add email notification support', $1, 1, 1, 0, true, 'english')", now)
+ Expect(err).IsNil()
+
+ // Search for "integration" - should match posts 1, 2, and 3 (with stemming, "integrate" = "integration")
+ searchIntegration := &query.SearchPosts{Query: "integration"}
+ err = bus.Dispatch(demoTenantCtx, searchIntegration)
+ Expect(err).IsNil()
+ Expect(searchIntegration.Result).HasLen(3)
+
+ // Verify the results contain the expected posts (should match all variations due to stemming)
+ slugs := map[string]bool{}
+ for _, post := range searchIntegration.Result {
+ slugs[post.Slug] = true
+ }
+ Expect(slugs["add-twitter-integration"]).IsTrue()
+ Expect(slugs["github-integration-needed"]).IsTrue()
+ Expect(slugs["integrate-with-slack"]).IsTrue()
+ }
+
+ func TestPostStorage_SearchEnglishPosts_MultiWord(t *testing.T) {
+ SetupDatabaseTest(t)
+ defer TeardownDatabaseTest()
+
+ now := time.Now()
+
- _, err := trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, language) VALUES ('Dark Mode Support', 'dark-mode-support', 1, 'Add dark mode to the application', $1, 1, 1, 0, 'english')", now)
++ _, err := trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, is_approved, language) VALUES ('Dark Mode Support', 'dark-mode-support', 1, 'Add dark mode to the application', $1, 1, 1, 0, true, 'english')", now)
+ Expect(err).IsNil()
+
- _, err = trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, language) VALUES ('Light Theme Customization', 'light-theme-customization', 2, 'Customize the light theme colors', $1, 1, 1, 0, 'english')", now)
++ _, err = trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, is_approved, language) VALUES ('Light Theme Customization', 'light-theme-customization', 2, 'Customize the light theme colors', $1, 1, 1, 0, true, 'english')", now)
+ Expect(err).IsNil()
+
- _, err = trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, language) VALUES ('Dark Theme Colors', 'dark-theme-colors', 3, 'Change dark theme color scheme', $1, 1, 1, 0, 'english')", now)
++ _, err = trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, is_approved, language) VALUES ('Dark Theme Colors', 'dark-theme-colors', 3, 'Change dark theme color scheme', $1, 1, 1, 0, true, 'english')", now)
+ Expect(err).IsNil()
+
- _, err = trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, language) VALUES ('User Profile', 'user-profile', 4, 'Improve user profile page', $1, 1, 1, 0, 'english')", now)
++ _, err = trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, is_approved, language) VALUES ('User Profile', 'user-profile', 4, 'Improve user profile page', $1, 1, 1, 0, true, 'english')", now)
+ Expect(err).IsNil()
+
+ searchDarkTheme := &query.SearchPosts{Query: "dark theme"}
+ err = bus.Dispatch(demoTenantCtx, searchDarkTheme)
+ Expect(err).IsNil()
+
+ Expect(searchDarkTheme.Result).HasLen(3)
+ }
+
+ func TestPostStorage_SearchEnglishPosts_PartialMatch(t *testing.T) {
+ SetupDatabaseTest(t)
+ defer TeardownDatabaseTest()
+
+ now := time.Now()
+
- _, err := trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, language) VALUES ('Authentication System', 'authentication-system', 1, 'Improve authentication', $1, 1, 1, 0, 'english')", now)
++ _, err := trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, is_approved, language) VALUES ('Authentication System', 'authentication-system', 1, 'Improve authentication', $1, 1, 1, 0, true, 'english')", now)
+ Expect(err).IsNil()
+
- _, err = trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, language) VALUES ('Authorization Rules', 'authorization-rules', 2, 'Add better authorization', $1, 1, 1, 0, 'english')", now)
++ _, err = trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, is_approved, language) VALUES ('Authorization Rules', 'authorization-rules', 2, 'Add better authorization', $1, 1, 1, 0, true, 'english')", now)
+ Expect(err).IsNil()
+
- _, err = trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, language) VALUES ('OAuth Support', 'oauth-support', 3, 'Support OAuth providers', $1, 1, 1, 0, 'english')", now)
++ _, err = trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, is_approved, language) VALUES ('OAuth Support', 'oauth-support', 3, 'Support OAuth providers', $1, 1, 1, 0, true, 'english')", now)
+ Expect(err).IsNil()
+
+ // Search for "auth" - should match posts 1 and 2 (prefix matching)
+ searchAuth := &query.SearchPosts{Query: "auth"}
+ err = bus.Dispatch(demoTenantCtx, searchAuth)
+ Expect(err).IsNil()
+ Expect(searchAuth.Result).HasLen(2)
+
+ slugs := map[string]bool{}
+ for _, post := range searchAuth.Result {
+ slugs[post.Slug] = true
+ }
+ Expect(slugs["authentication-system"]).IsTrue()
+ Expect(slugs["authorization-rules"]).IsTrue()
+ }
+
+ func TestPostStorage_SearchEnglishPosts_CaseInsensitive(t *testing.T) {
+ SetupDatabaseTest(t)
+ defer TeardownDatabaseTest()
+
+ now := time.Now()
+
- _, err := trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, language) VALUES ('API Documentation', 'api-documentation', 1, 'Improve API docs', $1, 1, 1, 0, 'english')", now)
++ _, err := trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, is_approved, language) VALUES ('API Documentation', 'api-documentation', 1, 'Improve API docs', $1, 1, 1, 0, true, 'english')", now)
+ Expect(err).IsNil()
+
- _, err = trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, language) VALUES ('Rest API Endpoints', 'rest-api-endpoints', 2, 'Add more REST API endpoints', $1, 1, 1, 0, 'english')", now)
++ _, err = trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, is_approved, language) VALUES ('Rest API Endpoints', 'rest-api-endpoints', 2, 'Add more REST API endpoints', $1, 1, 1, 0, true, 'english')", now)
+ Expect(err).IsNil()
+
+ // Search with different cases - all should return same results
+ searchLower := &query.SearchPosts{Query: "api"}
+ searchUpper := &query.SearchPosts{Query: "API"}
+ searchMixed := &query.SearchPosts{Query: "Api"}
+
+ err = bus.Dispatch(demoTenantCtx, searchLower, searchUpper, searchMixed)
+ Expect(err).IsNil()
+
+ Expect(searchLower.Result).HasLen(2)
+ Expect(searchUpper.Result).HasLen(2)
+ Expect(searchMixed.Result).HasLen(2)
+ }
+
+ func TestPostStorage_SearchEnglishPosts_DescriptionMatch(t *testing.T) {
+ SetupDatabaseTest(t)
+ defer TeardownDatabaseTest()
+
+ now := time.Now()
+
- _, err := trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, language) VALUES ('Feature Request', 'feature-request-1', 1, 'Add support for exporting data to CSV format', $1, 1, 1, 0, 'english')", now)
++ _, err := trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, is_approved, language) VALUES ('Feature Request', 'feature-request-1', 1, 'Add support for exporting data to CSV format', $1, 1, 1, 0, true, 'english')", now)
+ Expect(err).IsNil()
+
- _, err = trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, language) VALUES ('Another Feature', 'feature-request-2', 2, 'Improve the dashboard layout', $1, 1, 1, 0, 'english')", now)
++ _, err = trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, is_approved, language) VALUES ('Another Feature', 'feature-request-2', 2, 'Improve the dashboard layout', $1, 1, 1, 0, true, 'english')", now)
+ Expect(err).IsNil()
+
- _, err = trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, language) VALUES ('Export Functionality', 'export-functionality', 3, 'Export reports in PDF format', $1, 1, 1, 0, 'english')", now)
++ _, err = trx.Execute("INSERT INTO posts (title, slug, number, description, created_at, tenant_id, user_id, status, is_approved, language) VALUES ('Export Functionality', 'export-functionality', 3, 'Export reports in PDF format', $1, 1, 1, 0, true, 'english')", now)
+ Expect(err).IsNil()
+
+ // Search for "export" - should match posts 1 and 3 (one in description, one in title)
+ searchExport := &query.SearchPosts{Query: "export"}
+ err = bus.Dispatch(demoTenantCtx, searchExport)
+ Expect(err).IsNil()
+ Expect(searchExport.Result).HasLen(2)
+
+ slugs := map[string]bool{}
+ for _, post := range searchExport.Result {
+ slugs[post.Slug] = true
+ }
+ Expect(slugs["feature-request-1"]).IsTrue()
+ Expect(slugs["export-functionality"]).IsTrue()
+ }
func TestPostStorage_AddAndGet(t *testing.T) {
SetupDatabaseTest(t)
diff --cc app/services/sqlstore/postgres/tenant.go
index 6992e5ed5,31ae9fdf5..fb2b066f8
--- a/app/services/sqlstore/postgres/tenant.go
+++ b/app/services/sqlstore/postgres/tenant.go
@@@ -233,3 -307,35 +233,35 @@@ func getTenantByDomain(ctx context.Cont
return nil
})
}
+
+ func getPendingSignUpVerification(ctx context.Context, q *query.GetPendingSignUpVerification) error {
+ return using(ctx, func(trx *dbx.Trx, tenant *entity.Tenant, user *entity.User) error {
- verification := dbEmailVerification{}
++ verification := dbEntities.EmailVerification{}
+
+ query := `SELECT id, email, name, key, created_at, verified_at, expires_at, kind, user_id
+ FROM email_verifications
+ WHERE tenant_id = $1 AND kind = $2 AND verified_at IS NULL
+ ORDER BY created_at DESC
+ LIMIT 1`
+ err := trx.Get(&verification, query, tenant.ID, enum.EmailVerificationKindSignUp)
+ if err != nil {
+ return errors.Wrap(err, "failed to get pending signup verification for tenant '%d'", tenant.ID)
+ }
+
- q.Result = verification.toModel()
++ q.Result = verification.ToModel()
+ return nil
+ })
+ }
+
+ func invalidatePreviousSignUpKeys(ctx context.Context, c *cmd.InvalidatePreviousSignUpKeys) error {
+ return using(ctx, func(trx *dbx.Trx, tenant *entity.Tenant, user *entity.User) error {
+ query := `UPDATE email_verifications
+ SET expires_at = $1
+ WHERE tenant_id = $2 AND kind = $3 AND verified_at IS NULL AND expires_at > $1`
+ _, err := trx.Execute(query, time.Now(), tenant.ID, enum.EmailVerificationKindSignUp)
+ if err != nil {
+ return errors.Wrap(err, "failed to invalidate previous signup keys for tenant '%d'", tenant.ID)
+ }
+ return nil
+ })
+ }
diff --cc locale/ar/client.json
index 68f5e9709,74f2fb2d0..6898d66fa
--- a/locale/ar/client.json
+++ b/locale/ar/client.json
@@@ -99,6 -96,6 +99,15 @@@
"legal.notice": "من خلال تسجيل الدخول، أنت توافق على <2/><0/> و <1/>.",
"legal.privacypolicy": "سياسة الخصوصية",
"legal.termsofservice": "شروط الخدمة",
++ "linkmodal.insert": "إدراج الرابط",
++ "linkmodal.text.label": "النص المراد عرضه",
++ "linkmodal.text.placeholder": "أدخل نص الرابط",
++ "linkmodal.text.required": "النص مطلوب",
++ "linkmodal.title": "إدراج الرابط",
++ "linkmodal.url.invalid": "الرجاء إدخال عنوان URL صالح",
++ "linkmodal.url.label": "عنوان URL",
++ "linkmodal.url.placeholder": "",
++ "linkmodal.url.required": "مطلوب عنوان URL",
"menu.administration": "آلإدارة",
"menu.mysettings": "إعداداتي",
"menu.signout": "تسجيل الخروج",
@@@ -223,5 -204,13 +235,5 @@@
"signin.message.socialbutton.intro": "تسجيل الدخول بواسطة",
"validation.custom.maxattachments": "يُسمح بحد أقصى {number} من المرفقات.",
"validation.custom.maximagesize": "يجب أن يكون حجم الصورة أصغر من {kilobytes}KB.",
- "{count, plural, one {# tag} other {# tags}}": "{count, plural, zero {}one {# وسم} two {# وسوم} few {# وسوم} many {# وسوم} other {# وسوم}}",
- "linkmodal.insert": "إدراج الرابط",
- "linkmodal.text.label": "النص المراد عرضه",
- "linkmodal.text.placeholder": "أدخل نص الرابط",
- "linkmodal.text.required": "النص مطلوب",
- "linkmodal.title": "إدراج الرابط",
- "linkmodal.url.invalid": "الرجاء إدخال عنوان URL صالح",
- "linkmodal.url.label": "عنوان URL",
- "linkmodal.url.required": "مطلوب عنوان URL"
+ "{count, plural, one {# tag} other {# tags}}": "{count, plural, zero {}one {# وسم} two {# وسوم} few {# وسوم} many {# وسوم} other {# وسوم}}"
- }
+ }
diff --cc locale/cs/client.json
index 7a2f747ad,a9b072828..f0525c1fd
--- a/locale/cs/client.json
+++ b/locale/cs/client.json
@@@ -197,4 -197,19 +197,19 @@@
"validation.custom.maxattachments": "Maximální povolený počet příloh je {number}.",
"validation.custom.maximagesize": "Velikost obrázku musí být menší než {kilobytes}KB.",
"modal.rss.description": "Chcete-li se přihlásit k odběru tohoto kanálu ATOM, zkopírujte a vložte tuto URL adresu do své čtečky RSS/ATOM.",
- "modal.rss.title": "Přihlásit se k odběru kanálu ATOM"
+ "modal.rss.title": "Přihlásit se k odběru kanálu ATOM",
+ "home.postfilter.label.myactivity": "Vlastní",
+ "home.postfilter.label.status": "Postavení",
+ "home.postfilter.option.myposts": "Moje příspěvky",
+ "home.postfilter.option.notags": "Neoznačeno",
+ "linkmodal.insert": "Vložit odkaz",
+ "linkmodal.text.label": "Text k zobrazení",
+ "linkmodal.text.placeholder": "Zadejte text odkazu",
+ "linkmodal.text.required": "Je vyžadován text",
+ "linkmodal.title": "Vložit odkaz",
+ "linkmodal.url.invalid": "Zadejte prosím platnou URL adresu",
+ "linkmodal.url.required": "URL je povinná",
+ "page.pendingactivation.didntreceive": "Neobdrželi jste e-mail?",
+ "page.pendingactivation.resend": "Znovu odeslat ověřovací e-mail",
+ "page.pendingactivation.resending": "Znovu odesílám..."
-}
++}
diff --cc locale/de/client.json
index ed384f073,5c3cb12f4..e4d2ff9d0
--- a/locale/de/client.json
+++ b/locale/de/client.json
@@@ -99,6 -96,6 +99,15 @@@
"legal.notice": "Mit der Anmeldung stimmst du den <2/><0/> und <1/> zu.",
"legal.privacypolicy": "Datenschutzerklärung",
"legal.termsofservice": "Nutzungsbedingungen",
++ "linkmodal.insert": "Link einfügen",
++ "linkmodal.text.label": "Anzuzeigender Text",
++ "linkmodal.text.placeholder": "Linktext eingeben",
++ "linkmodal.text.required": "Text ist erforderlich",
++ "linkmodal.title": "Link einfügen",
++ "linkmodal.url.invalid": "Bitte geben Sie eine gültige URL ein",
++ "linkmodal.url.label": "",
++ "linkmodal.url.placeholder": "",
++ "linkmodal.url.required": "URL ist erforderlich",
"menu.administration": "Verwaltung",
"menu.mysettings": "Meine Einstellungen",
"menu.signout": "Abmelden",
@@@ -223,5 -204,12 +235,5 @@@
"signin.message.socialbutton.intro": "Einloggen mit",
"validation.custom.maxattachments": "Es sind maximal {number} Anhänge zulässig.",
"validation.custom.maximagesize": "Die Bildgröße muss kleiner als {kilobytes}KB sein.",
- "{count, plural, one {# tag} other {# tags}}": "{count, plural, one {# Tag} other {# Tags}}",
- "linkmodal.insert": "Link einfügen",
- "linkmodal.text.label": "Anzuzeigender Text",
- "linkmodal.text.placeholder": "Linktext eingeben",
- "linkmodal.text.required": "Text ist erforderlich",
- "linkmodal.title": "Link einfügen",
- "linkmodal.url.invalid": "Bitte geben Sie eine gültige URL ein",
- "linkmodal.url.required": "URL ist erforderlich"
+ "{count, plural, one {# tag} other {# tags}}": "{count, plural, one {# Tag} other {# Tags}}"
- }
+ }
diff --cc locale/el/client.json
index 1dffde81e,c239e8227..a40d719b3
--- a/locale/el/client.json
+++ b/locale/el/client.json
@@@ -99,6 -96,6 +99,15 @@@
"legal.notice": "Με την είσοδο, συμφωνείτε με το <2/><0/> και <1/>.",
"legal.privacypolicy": "Πολιτική Απορρήτου",
"legal.termsofservice": "Όροι χρήσης",
++ "linkmodal.insert": "Εισαγωγή συνδέσμου",
++ "linkmodal.text.label": "Κείμενο προς εμφάνιση",
++ "linkmodal.text.placeholder": "Εισαγάγετε κείμενο συνδέσμου",
++ "linkmodal.text.required": "Απαιτείται κείμενο",
++ "linkmodal.title": "Εισαγωγή συνδέσμου",
++ "linkmodal.url.invalid": "Παρακαλώ εισάγετε μια έγκυρη διεύθυνση URL",
++ "linkmodal.url.label": "",
++ "linkmodal.url.placeholder": "",
++ "linkmodal.url.required": "Απαιτείται διεύθυνση URL",
"menu.administration": "Διαχείριση",
"menu.mysettings": "Οι Ρυθμίσεις Μου",
"menu.signout": "Αποσύνδεση",
@@@ -223,5 -204,12 +235,5 @@@
"signin.message.socialbutton.intro": "Συνδεθείτε με",
"validation.custom.maxattachments": "Επιτρέπονται έως {number} συνημμένα.",
"validation.custom.maximagesize": "Το μέγεθος της εικόνας πρέπει να είναι μικρότερο από {kilobytes}KB.",
- "{count, plural, one {# tag} other {# tags}}": "{count, plural, one {# ετικέτα} other {# ετικέτες}}",
- "linkmodal.insert": "Εισαγωγή συνδέσμου",
- "linkmodal.text.label": "Κείμενο προς εμφάνιση",
- "linkmodal.text.placeholder": "Εισαγάγετε κείμενο συνδέσμου",
- "linkmodal.text.required": "Απαιτείται κείμενο",
- "linkmodal.title": "Εισαγωγή συνδέσμου",
- "linkmodal.url.invalid": "Παρακαλώ εισάγετε μια έγκυρη διεύθυνση URL",
- "linkmodal.url.required": "Απαιτείται διεύθυνση URL"
+ "{count, plural, one {# tag} other {# tags}}": "{count, plural, one {# ετικέτα} other {# ετικέτες}}"
- }
+ }
diff --cc locale/en/client.json
index ffed99a47,7df12f02f..546b9c871
--- a/locale/en/client.json
+++ b/locale/en/client.json
@@@ -94,10 -91,19 +94,19 @@@
"label.voters": "Voters",
"labels.notagsavailable": "No tags available",
"labels.notagsselected": "No tags selected",
+ "legal.agreement": "I have read and agree to the <0/> and <1/>.",
+ "legal.notice": "By signing in, you agree to the <2/><0/> and <1/>.",
+ "legal.privacypolicy": "Privacy Policy",
+ "legal.termsofservice": "Terms of Service",
+ "linkmodal.insert": "Insert Link",
+ "linkmodal.text.label": "Text to display",
+ "linkmodal.text.placeholder": "Enter link text",
+ "linkmodal.text.required": "Text is required",
+ "linkmodal.title": "Insert Link",
+ "linkmodal.url.invalid": "Please enter a valid URL",
+ "linkmodal.url.label": "URL",
+ "linkmodal.url.placeholder": "https://example.com",
+ "linkmodal.url.required": "URL is required",
- "legal.agreement": "I have read and agree to the <0/> and <1/>.",
- "legal.notice": "By signing in, you agree to the <2/><0/> and <1/>.",
- "legal.privacypolicy": "Privacy Policy",
- "legal.termsofservice": "Terms of Service",
"menu.administration": "Administration",
"menu.mysettings": "My Settings",
"menu.signout": "Sign out",
diff --cc locale/es-ES/client.json
index 519529613,12adde04b..3065bc053
--- a/locale/es-ES/client.json
+++ b/locale/es-ES/client.json
@@@ -95,10 -92,19 +95,19 @@@
"label.voters": "Votantes",
"labels.notagsavailable": "No hay etiquetas disponibles",
"labels.notagsselected": "No hay etiquetas seleccionadas",
+ "legal.agreement": "He leído y acepto los <0/> y <1/>.",
+ "legal.notice": "Al iniciar sesión, aceptas los <2/><0/> y <1/>.",
+ "legal.privacypolicy": "Política de Privacidad",
+ "legal.termsofservice": "Términos del servicio",
+ "linkmodal.insert": "Insertar un enlace",
+ "linkmodal.text.label": "Texto a mostrar",
+ "linkmodal.text.placeholder": "Ingresa el texto del enlace",
+ "linkmodal.text.required": "El texto es requerido",
+ "linkmodal.title": "Insertar un enlace",
+ "linkmodal.url.invalid": "Por favor ingresa una URL válida",
+ "linkmodal.url.label": "URL",
+ "linkmodal.url.placeholder": "https://example.com",
+ "linkmodal.url.required": "La URL es requerida",
- "legal.agreement": "He leído y acepto los <0/> y <1/>.",
- "legal.notice": "Al iniciar sesión, aceptas los <2/><0/> y <1/>.",
- "legal.privacypolicy": "Política de Privacidad",
- "legal.termsofservice": "Términos del servicio",
"menu.administration": "Administración",
"menu.mysettings": "Mis ajustes",
"menu.signout": "Cerrar sesión",
diff --cc locale/fa/client.json
index b29208a64,c819e501f..739a414e1
--- a/locale/fa/client.json
+++ b/locale/fa/client.json
@@@ -3,10 -2,9 +3,10 @@@
"action.cancel": "لغو",
"action.change": "تغییر",
"action.close": "بستن",
- "action.commentsfeed": "",
+ "action.commentsfeed": "فید نظرات",
"action.confirm": "تأیید",
"action.copylink": "کپی لینک",
+ "action.decline": "",
"action.delete": "حذف",
"action.edit": "ویرایش",
"action.markallasread": "علامت‌گذاری همه به‌عنوان خوانده‌شده",
@@@ -99,6 -96,6 +99,15 @@@
"legal.notice": "با ورود، شما با <2/><0/> و <1/> موافقید.",
"legal.privacypolicy": "سیاست حفظ حریم خصوصی",
"legal.termsofservice": "شرایط خدمات",
++ "linkmodal.insert": "درج لینک",
++ "linkmodal.text.label": "متن برای نمایش",
++ "linkmodal.text.placeholder": "متن لینک را وارد کنید",
++ "linkmodal.text.required": "متن الزامی است",
++ "linkmodal.title": "درج لینک",
++ "linkmodal.url.invalid": "لطفا یک URL معتبر وارد کنید",
++ "linkmodal.url.label": "آدرس اینترنتی",
++ "linkmodal.url.placeholder": "",
++ "linkmodal.url.required": "آدرس اینترنتی (URL) الزامی است",
"menu.administration": "مدیریت",
"menu.mysettings": "تنظیمات من",
"menu.signout": "خروج",
@@@ -159,12 -156,11 +168,13 @@@
"mysettings.notification.title": "رویدادهایی را که می‌خواهید اعلان دریافت کنید انتخاب کنید",
"mysettings.page.subtitle": "تنظیمات پروفایل خود را مدیریت کنید",
"mysettings.page.title": "تنظیمات",
- "newpost.modal.description.placeholder": "",
- "newpost.modal.submit": "",
- "newpost.modal.title": "",
- "newpost.modal.title.label": "",
- "newpost.modal.title.placeholder": "",
++ "newpost.modal.addimage": "اضافه کردن تصاویر",
+ "newpost.modal.description.placeholder": "در موردش به ما بگو. کامل توضیح بده، دریغ نکن، هر چه اطلاعات بیشتر، بهتر.",
+ "newpost.modal.submit": "ایده خود را ثبت کنید",
+ "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": "دعوت نشده",
@@@ -220,7 -201,16 +233,7 @@@
"signin.message.private.text": "اگر حساب یا دعوت‌نامه دارید، از گزینه‌های زیر برای ورود استفاده کنید.",
"signin.message.private.title": "<0>{0}</0> یک فضای خصوصی است؛ برای مشارکت باید وارد شوید.",
"signin.message.socialbutton.intro": "ورود با",
- "validation.custom.maxattachments": "",
- "validation.custom.maximagesize": "",
+ "validation.custom.maxattachments": "حداکثر تعداد {number} پیوست مجاز است.",
+ "validation.custom.maximagesize": "حجم تصویر باید کمتر از {kilobytes}KB باشد.",
- "{count, plural, one {# tag} other {# tags}}": "{count, plural, one {# برچسب} other {# برچسب}}",
- "linkmodal.insert": "درج لینک",
- "linkmodal.text.label": "متن برای نمایش",
- "linkmodal.text.placeholder": "متن لینک را وارد کنید",
- "linkmodal.text.required": "متن الزامی است",
- "linkmodal.title": "درج لینک",
- "linkmodal.url.invalid": "لطفا یک URL معتبر وارد کنید",
- "linkmodal.url.label": "آدرس اینترنتی",
- "linkmodal.url.required": "آدرس اینترنتی (URL) الزامی است",
- "newpost.modal.addimage": "اضافه کردن تصاویر"
+ "{count, plural, one {# tag} other {# tags}}": "{count, plural, one {# برچسب} other {# برچسب}}"
- }
+ }
diff --cc locale/fr/client.json
index 3002540f5,a7664d9af..68e4c82d4
--- a/locale/fr/client.json
+++ b/locale/fr/client.json
@@@ -99,6 -96,6 +99,15 @@@
"legal.notice": "En vous connectant, vous acceptez les <2/><0/> et <1/>.",
"legal.privacypolicy": "Politique de confidentialité",
"legal.termsofservice": "Conditions générales d’utilisation",
++ "linkmodal.insert": "Insérer un lien",
++ "linkmodal.text.label": "Texte à afficher",
++ "linkmodal.text.placeholder": "Entrez le texte du lien",
++ "linkmodal.text.required": "Le texte est obligatoire",
++ "linkmodal.title": "Insérer un lien",
++ "linkmodal.url.invalid": "Veuillez saisir une URL valide",
++ "linkmodal.url.label": "",
++ "linkmodal.url.placeholder": "https://exemple.com",
++ "linkmodal.url.required": "L'URL est requise",
"menu.administration": "Administration",
"menu.mysettings": "Mes paramètres",
"menu.signout": "Se déconnecter",
@@@ -223,5 -204,13 +235,5 @@@
"signin.message.socialbutton.intro": "Se connecter avec",
"validation.custom.maxattachments": "Un maximum de {number} pièces jointes est autorisé.",
"validation.custom.maximagesize": "La taille de l'image doit être inférieure à {kilobytes}KB.",
- "{count, plural, one {# tag} other {# tags}}": "{count, plural, one {# tag} other {# tags}}",
- "linkmodal.insert": "Insérer un lien",
- "linkmodal.text.label": "Texte à afficher",
- "linkmodal.text.placeholder": "Entrez le texte du lien",
- "linkmodal.text.required": "Le texte est obligatoire",
- "linkmodal.title": "Insérer un lien",
- "linkmodal.url.invalid": "Veuillez saisir une URL valide",
- "linkmodal.url.placeholder": "https://exemple.com",
- "linkmodal.url.required": "L'URL est requise"
+ "{count, plural, one {# tag} other {# tags}}": "{count, plural, one {# tag} other {# tags}}"
- }
+ }
diff --cc locale/it/client.json
index e22b37fb9,6a5178133..89043d9bd
--- a/locale/it/client.json
+++ b/locale/it/client.json
@@@ -99,6 -96,6 +99,15 @@@
"legal.notice": "Accedendo, accetti i <2/><0/> e <1/>.",
"legal.privacypolicy": "Informativa sulla privacy",
"legal.termsofservice": "Termini di servizio",
++ "linkmodal.insert": "Inserisci collegamento",
++ "linkmodal.text.label": "Testo da visualizzare",
++ "linkmodal.text.placeholder": "Inserisci il testo del collegamento",
++ "linkmodal.text.required": "Il testo è obbligatorio",
++ "linkmodal.title": "Inserisci collegamento",
++ "linkmodal.url.invalid": "Inserisci un URL valido",
++ "linkmodal.url.label": "",
++ "linkmodal.url.placeholder": "https://esempio.com",
++ "linkmodal.url.required": "L'URL è obbligatorio",
"menu.administration": "Amministrazione",
"menu.mysettings": "Le mie preferenze",
"menu.signout": "Disconnettersi",
@@@ -223,5 -204,13 +235,5 @@@
"signin.message.socialbutton.intro": "Accedi con",
"validation.custom.maxattachments": "Sono consentiti al massimo {number} allegati.",
"validation.custom.maximagesize": "La dimensione dell'immagine deve essere inferiore a {kilobytes}KB.",
- "{count, plural, one {# tag} other {# tags}}": "{count, plural, one {# tag} other {# tags}}",
- "linkmodal.insert": "Inserisci collegamento",
- "linkmodal.text.label": "Testo da visualizzare",
- "linkmodal.text.placeholder": "Inserisci il testo del collegamento",
- "linkmodal.text.required": "Il testo è obbligatorio",
- "linkmodal.title": "Inserisci collegamento",
- "linkmodal.url.invalid": "Inserisci un URL valido",
- "linkmodal.url.placeholder": "https://esempio.com",
- "linkmodal.url.required": "L'URL è obbligatorio"
+ "{count, plural, one {# tag} other {# tags}}": "{count, plural, one {# tag} other {# tags}}"
- }
+ }
diff --cc locale/ja/client.json
index 885a759b3,46b3089d1..a2340a4b1
--- a/locale/ja/client.json
+++ b/locale/ja/client.json
@@@ -99,6 -96,6 +99,15 @@@
"legal.notice": "サインインすると、<2/><0/> および <1/> に同意したことになります。",
"legal.privacypolicy": "プライバシーポリシー",
"legal.termsofservice": "サービス利用規約",
++ "linkmodal.insert": "リンクを挿入",
++ "linkmodal.text.label": "表示するテキスト",
++ "linkmodal.text.placeholder": "リンクテキストを入力",
++ "linkmodal.text.required": "テキストは必須です",
++ "linkmodal.title": "リンクを挿入",
++ "linkmodal.url.invalid": "有効なURLを入力してください",
++ "linkmodal.url.label": "",
++ "linkmodal.url.placeholder": "",
++ "linkmodal.url.required": "URLは必須です",
"menu.administration": "管理",
"menu.mysettings": "ユーザー設定",
"menu.signout": "ログアウト",
@@@ -223,5 -204,12 +235,5 @@@
"signin.message.socialbutton.intro": "ログイン",
"validation.custom.maxattachments": "最大 {number} 個の添付ファイルが許可されます。",
"validation.custom.maximagesize": "画像サイズは{kilobytes}KB未満である必要があります。",
- "{count, plural, one {# tag} other {# tags}}": "{count, plural, one {# tag} other {# tags}}",
- "linkmodal.insert": "リンクを挿入",
- "linkmodal.text.label": "表示するテキスト",
- "linkmodal.text.placeholder": "リンクテキストを入力",
- "linkmodal.text.required": "テキストは必須です",
- "linkmodal.title": "リンクを挿入",
- "linkmodal.url.invalid": "有効なURLを入力してください",
- "linkmodal.url.required": "URLは必須です"
+ "{count, plural, one {# tag} other {# tags}}": "{count, plural, one {# tag} other {# tags}}"
- }
+ }
diff --cc locale/ko/client.json
index 9e9cae482,e490c435b..45e4e0d0a
--- a/locale/ko/client.json
+++ b/locale/ko/client.json
@@@ -197,4 -197,19 +197,19 @@@
"validation.custom.maxattachments": "최대 {number}개의 첨부 파일이 허용됩니다.",
"validation.custom.maximagesize": "이미지 크기는 {kilobytes}KB보다 작아야 합니다.",
"modal.rss.description": "이 ATOM 피드를 구독하려면 이 URL을 복사하여 RSS/ATOM 리더에 붙여넣으세요.",
- "modal.rss.title": "ATOM 피드 구독하기"
+ "modal.rss.title": "ATOM 피드 구독하기",
+ "home.postfilter.label.myactivity": "소유하다",
+ "home.postfilter.label.status": "상태",
+ "home.postfilter.option.myposts": "내 게시물",
+ "home.postfilter.option.notags": "태그 없음",
+ "linkmodal.insert": "링크 삽입",
+ "linkmodal.text.label": "표시할 텍스트",
+ "linkmodal.text.placeholder": "링크 텍스트 입력",
+ "linkmodal.text.required": "텍스트가 필요합니다",
+ "linkmodal.title": "링크 삽입",
+ "linkmodal.url.invalid": "유효한 URL을 입력하세요",
+ "linkmodal.url.required": "URL이 필요합니다",
+ "page.pendingactivation.didntreceive": "이메일을 받지 못하셨나요?",
+ "page.pendingactivation.resend": "인증 이메일 재전송",
+ "page.pendingactivation.resending": "다시 보내는 중..."
-}
++}
diff --cc locale/nl/client.json
index c51a654b3,4d93764bc..a655644a5
--- a/locale/nl/client.json
+++ b/locale/nl/client.json
@@@ -99,6 -96,6 +99,15 @@@
"legal.notice": "Door in te loggen, ga je akkoord met de <2/><0/> en <1/>.",
"legal.privacypolicy": "Privacybeleid",
"legal.termsofservice": "Algemene voorwaarden",
++ "linkmodal.insert": "Link invoegen",
++ "linkmodal.text.label": "Weer te geven tekst",
++ "linkmodal.text.placeholder": "Voer linktekst in",
++ "linkmodal.text.required": "Tekst is vereist",
++ "linkmodal.title": "Link invoegen",
++ "linkmodal.url.invalid": "Voer een geldige URL in",
++ "linkmodal.url.label": "",
++ "linkmodal.url.placeholder": "https://voorbeeld.com",
++ "linkmodal.url.required": "URL is vereist",
"menu.administration": "Beheer",
"menu.mysettings": "Mijn instellingen",
"menu.signout": "Uitloggen",
@@@ -223,5 -204,13 +235,5 @@@
"signin.message.socialbutton.intro": "Inloggen met",
"validation.custom.maxattachments": "Er zijn maximaal {number} bijlagen toegestaan.",
"validation.custom.maximagesize": "De afbeeldingsgrootte moet kleiner zijn dan {kilobytes}KB.",
- "{count, plural, one {# tag} other {# tags}}": "{count, plural, one {# tag} other {# tags}}",
- "linkmodal.insert": "Link invoegen",
- "linkmodal.text.label": "Weer te geven tekst",
- "linkmodal.text.placeholder": "Voer linktekst in",
- "linkmodal.text.required": "Tekst is vereist",
- "linkmodal.title": "Link invoegen",
- "linkmodal.url.invalid": "Voer een geldige URL in",
- "linkmodal.url.placeholder": "https://voorbeeld.com",
- "linkmodal.url.required": "URL is vereist"
+ "{count, plural, one {# tag} other {# tags}}": "{count, plural, one {# tag} other {# tags}}"
- }
+ }
diff --cc locale/pl/client.json
index b1451bbd0,2de7df8c2..c9f34ca37
--- a/locale/pl/client.json
+++ b/locale/pl/client.json
@@@ -99,6 -96,6 +99,15 @@@
"legal.notice": "Logując się, akceptujesz <2/><0/> i <1/>.",
"legal.privacypolicy": "Polityka Prywatności",
"legal.termsofservice": "Warunki Świadczenia Usług",
++ "linkmodal.insert": "Wstaw link",
++ "linkmodal.text.label": "Tekst do wyświetlenia",
++ "linkmodal.text.placeholder": "Wprowadź tekst linku",
++ "linkmodal.text.required": "Tekst jest wymagany",
++ "linkmodal.title": "Wstaw link",
++ "linkmodal.url.invalid": "Proszę podać prawidłowy adres URL",
++ "linkmodal.url.label": "Adres URL",
++ "linkmodal.url.placeholder": "",
++ "linkmodal.url.required": "Adres URL jest wymagany",
"menu.administration": "Administracja",
"menu.mysettings": "Moje Ustawienia",
"menu.signout": "Wyloguj się",
@@@ -223,5 -204,13 +235,5 @@@
"signin.message.socialbutton.intro": "Zaloguj się za pomocą",
"validation.custom.maxattachments": "Maksymalna liczba załączników to {number}.",
"validation.custom.maximagesize": "Rozmiar obrazu musi być mniejszy niż {kilobytes}KB.",
- "{count, plural, one {# tag} other {# tags}}": "{count, plural, one {# tag} few {# tagów} many {# tagów} other {# tagi}}",
- "linkmodal.insert": "Wstaw link",
- "linkmodal.text.label": "Tekst do wyświetlenia",
- "linkmodal.text.placeholder": "Wprowadź tekst linku",
- "linkmodal.text.required": "Tekst jest wymagany",
- "linkmodal.title": "Wstaw link",
- "linkmodal.url.invalid": "Proszę podać prawidłowy adres URL",
- "linkmodal.url.label": "Adres URL",
- "linkmodal.url.required": "Adres URL jest wymagany"
+ "{count, plural, one {# tag} other {# tags}}": "{count, plural, one {# tag} few {# tagów} many {# tagów} other {# tagi}}"
- }
+ }
diff --cc locale/pt-BR/client.json
index 29bd8f315,3b317e1d2..eca8cff70
--- a/locale/pt-BR/client.json
+++ b/locale/pt-BR/client.json
@@@ -99,6 -96,6 +99,15 @@@
"legal.notice": "Ao fazer o login, você concorda com os <2/><0/> e <1/>.",
"legal.privacypolicy": "Política de Privacidade",
"legal.termsofservice": "Termos do Serviço",
++ "linkmodal.insert": "Inserir link",
++ "linkmodal.text.label": "Texto para exibir",
++ "linkmodal.text.placeholder": "Insira o texto do link",
++ "linkmodal.text.required": "Texto é obrigatório",
++ "linkmodal.title": "Inserir link",
++ "linkmodal.url.invalid": "Por favor, insira um URL válido",
++ "linkmodal.url.label": "",
++ "linkmodal.url.placeholder": "",
++ "linkmodal.url.required": "URL é obrigatório",
"menu.administration": "Administração",
"menu.mysettings": "Minhas Configurações",
"menu.signout": "Finalizar sessão",
@@@ -223,5 -204,12 +235,5 @@@
"signin.message.socialbutton.intro": "Fazer login com",
"validation.custom.maxattachments": "São permitidos no máximo {number} anexos.",
"validation.custom.maximagesize": "O tamanho da imagem deve ser menor que {kilobytes}KB.",
- "{count, plural, one {# tag} other {# tags}}": "{count, plural, one {# tag} other {# tags}}",
- "linkmodal.insert": "Inserir link",
- "linkmodal.text.label": "Texto para exibir",
- "linkmodal.text.placeholder": "Insira o texto do link",
- "linkmodal.text.required": "Texto é obrigatório",
- "linkmodal.title": "Inserir link",
- "linkmodal.url.invalid": "Por favor, insira um URL válido",
- "linkmodal.url.required": "URL é obrigatório"
+ "{count, plural, one {# tag} other {# tags}}": "{count, plural, one {# tag} other {# tags}}"
- }
+ }
diff --cc locale/ru/client.json
index caf97e13b,9bc4bcf3e..371c1d91f
--- a/locale/ru/client.json
+++ b/locale/ru/client.json
@@@ -99,6 -96,6 +99,15 @@@
"legal.notice": "Войдя в систему, вы соглашаетесь с <2/><0/> и <1/>.",
"legal.privacypolicy": "Политика Конфиденциальности",
"legal.termsofservice": "Условия Использования",
++ "linkmodal.insert": "Вставить ссылку",
++ "linkmodal.text.label": "Текст для отображения",
++ "linkmodal.text.placeholder": "Введите текст ссылки",
++ "linkmodal.text.required": "Текст обязателен",
++ "linkmodal.title": "Вставить ссылку",
++ "linkmodal.url.invalid": "Пожалуйста, введите действительный URL-адрес",
++ "linkmodal.url.label": "",
++ "linkmodal.url.placeholder": "",
++ "linkmodal.url.required": "URL-адрес обязателен",
"menu.administration": "Администрирование",
"menu.mysettings": "Мой аккаунт",
"menu.signout": "Выйти",
@@@ -223,5 -204,12 +235,5 @@@
"signin.message.socialbutton.intro": "Войти с помощью",
"validation.custom.maxattachments": "Разрешено максимум {number} вложений.",
"validation.custom.maximagesize": "Размер изображения должен быть меньше {kilobytes}КБ.",
- "{count, plural, one {# tag} other {# tags}}": "{count, plural, one {# tag} other {# tags}}",
- "linkmodal.insert": "Вставить ссылку",
- "linkmodal.text.label": "Текст для отображения",
- "linkmodal.text.placeholder": "Введите текст ссылки",
- "linkmodal.text.required": "Текст обязателен",
- "linkmodal.title": "Вставить ссылку",
- "linkmodal.url.invalid": "Пожалуйста, введите действительный URL-адрес",
- "linkmodal.url.required": "URL-адрес обязателен"
+ "{count, plural, one {# tag} other {# tags}}": "{count, plural, one {# tag} other {# tags}}"
- }
+ }
diff --cc locale/si-LK/client.json
index d51881086,d2e7f1844..7047d198c
--- a/locale/si-LK/client.json
+++ b/locale/si-LK/client.json
@@@ -197,4 -197,20 +197,20 @@@
"validation.custom.maxattachments": "උපරිම වශයෙන් ඇමුණුම් {number} ක් සඳහා අවසර ඇත.",
"validation.custom.maximagesize": "රූපයේ ප්‍රමාණය {kilobytes}KB ට වඩා කුඩා විය යුතුය.",
"modal.rss.description": "මෙම ATOM සංග්‍රහයට දායක වීමට, මෙම URL එක පිටපත් කර ඔබගේ RSS/ATOM කියවනයට අලවන්න.",
- "modal.rss.title": "ATOM සංග්‍රහයට දායක වන්න"
+ "modal.rss.title": "ATOM සංග්‍රහයට දායක වන්න",
+ "home.postfilter.label.myactivity": "අයිති",
+ "home.postfilter.label.status": "තත්ත්වය",
+ "home.postfilter.option.myposts": "මගේ සටහන්",
+ "home.postfilter.option.notags": "ටැග් නොකළ",
+ "linkmodal.insert": "සබැඳිය ඇතුළු කරන්න",
+ "linkmodal.text.label": "පෙන්වීමට පෙළ",
+ "linkmodal.text.placeholder": "සබැඳි පෙළ ඇතුළත් කරන්න",
+ "linkmodal.text.required": "පෙළ අවශ්‍යයි",
+ "linkmodal.title": "සබැඳිය ඇතුළු කරන්න",
+ "linkmodal.url.invalid": "කරුණාකර වලංගු URL එකක් ඇතුළත් කරන්න.",
+ "linkmodal.url.label": "URL එක",
+ "linkmodal.url.required": "URL එක අවශ්‍යයි",
+ "page.pendingactivation.didntreceive": "ඊමේල් එක ලැබුනේ නැද්ද?",
+ "page.pendingactivation.resend": "සත්‍යාපන ඊමේල් නැවත යවන්න",
+ "page.pendingactivation.resending": "නැවත යවමින්..."
-}
++}
diff --cc locale/sk/client.json
index 3f749efc9,4af08fec9..fd24b2f43
--- a/locale/sk/client.json
+++ b/locale/sk/client.json
@@@ -99,6 -96,6 +99,15 @@@
"legal.notice": "Prihlásením súhlasíte s <2/><0/> a <1/>.",
"legal.privacypolicy": "Zásady ochrany osobných údajov",
"legal.termsofservice": "Podmienky služby",
++ "linkmodal.insert": "Vložiť odkaz",
++ "linkmodal.text.label": "Text na zobrazenie",
++ "linkmodal.text.placeholder": "Zadajte text odkazu",
++ "linkmodal.text.required": "Vyžaduje sa text",
++ "linkmodal.title": "Vložiť odkaz",
++ "linkmodal.url.invalid": "Zadajte platnú URL adresu",
++ "linkmodal.url.label": "",
++ "linkmodal.url.placeholder": "",
++ "linkmodal.url.required": "URL adresa je povinná",
"menu.administration": "Administrácia",
"menu.mysettings": "Moje nastavenia",
"menu.signout": "Odhlásiť sa",
@@@ -223,5 -204,12 +235,5 @@@
"signin.message.socialbutton.intro": "Prihlásiť sa pomocou",
"validation.custom.maxattachments": "Maximálny počet príloh je {number}.",
"validation.custom.maximagesize": "Veľkosť obrázka musí byť menšia ako {kilobytes}KB.",
- "{count, plural, one {# tag} other {# tags}}": "{count, plural, one {# tag} other {# tags}}",
- "linkmodal.insert": "Vložiť odkaz",
- "linkmodal.text.label": "Text na zobrazenie",
- "linkmodal.text.placeholder": "Zadajte text odkazu",
- "linkmodal.text.required": "Vyžaduje sa text",
- "linkmodal.title": "Vložiť odkaz",
- "linkmodal.url.invalid": "Zadajte platnú URL adresu",
- "linkmodal.url.required": "URL adresa je povinná"
+ "{count, plural, one {# tag} other {# tags}}": "{count, plural, one {# tag} other {# tags}}"
- }
+ }
diff --cc locale/sv-SE/client.json
index 36a3594b4,afd19a2e7..6e2f940cd
--- a/locale/sv-SE/client.json
+++ b/locale/sv-SE/client.json
@@@ -99,6 -96,6 +99,15 @@@
"legal.notice": "Genom att logga in godkänner du <2/><0/> och <1/>.",
"legal.privacypolicy": "Integritetspolicy",
"legal.termsofservice": "Användarvillkor",
++ "linkmodal.insert": "Infoga länk",
++ "linkmodal.text.label": "Text att visa",
++ "linkmodal.text.placeholder": "Ange länktext",
++ "linkmodal.text.required": "Text krävs",
++ "linkmodal.title": "Infoga länk",
++ "linkmodal.url.invalid": "Ange en giltig URL",
++ "linkmodal.url.label": "",
++ "linkmodal.url.placeholder": "",
++ "linkmodal.url.required": "URL krävs",
"menu.administration": "Administration",
"menu.mysettings": "Mina Inställningar",
"menu.signout": "Logga ut",
@@@ -223,5 -204,12 +235,5 @@@
"signin.message.socialbutton.intro": "Logga in med",
"validation.custom.maxattachments": "Maximalt {number} bilagor är tillåtna.",
"validation.custom.maximagesize": "Bildstorleken måste vara mindre än {kilobytes}KB.",
- "{count, plural, one {# tag} other {# tags}}": "{count, plural, =1 {# etikett} other {# etiketter}}",
- "linkmodal.insert": "Infoga länk",
- "linkmodal.text.label": "Text att visa",
- "linkmodal.text.placeholder": "Ange länktext",
- "linkmodal.text.required": "Text krävs",
- "linkmodal.title": "Infoga länk",
- "linkmodal.url.invalid": "Ange en giltig URL",
- "linkmodal.url.required": "URL krävs"
+ "{count, plural, one {# tag} other {# tags}}": "{count, plural, =1 {# etikett} other {# etiketter}}"
- }
+ }
diff --cc locale/tr/client.json
index 876035d17,25ffe8345..4d685afc9
--- a/locale/tr/client.json
+++ b/locale/tr/client.json
@@@ -99,6 -96,6 +99,15 @@@
"legal.notice": "Giriş yaparak <2/><0/> ve <1/> maddelerini kabul etmiş olursunuz.",
"legal.privacypolicy": "Gizlilik Politikası",
"legal.termsofservice": "Hizmet Koşulları",
++ "linkmodal.insert": "Bağlantı Ekle",
++ "linkmodal.text.label": "Görüntülenecek metin",
++ "linkmodal.text.placeholder": "Bağlantı metnini girin",
++ "linkmodal.text.required": "Metin gereklidir",
++ "linkmodal.title": "Bağlantı Ekle",
++ "linkmodal.url.invalid": "Lütfen geçerli bir URL girin",
++ "linkmodal.url.label": "",
++ "linkmodal.url.placeholder": "",
++ "linkmodal.url.required": "URL gerekli",
"menu.administration": "Yönetim",
"menu.mysettings": "Ayarlarım",
"menu.signout": "Çıkış yap",
@@@ -223,5 -204,12 +235,5 @@@
"signin.message.socialbutton.intro": "İle giriş yapın",
"validation.custom.maxattachments": "En fazla {number} ek dosyaya izin verilir.",
"validation.custom.maximagesize": "Resim boyutu {kilobytes}KB'den küçük olmalıdır.",
- "{count, plural, one {# tag} other {# tags}}": "{count, plural, one {# etiket} other {# etiket}}",
- "linkmodal.insert": "Bağlantı Ekle",
- "linkmodal.text.label": "Görüntülenecek metin",
- "linkmodal.text.placeholder": "Bağlantı metnini girin",
- "linkmodal.text.required": "Metin gereklidir",
- "linkmodal.title": "Bağlantı Ekle",
- "linkmodal.url.invalid": "Lütfen geçerli bir URL girin",
- "linkmodal.url.required": "URL gerekli"
+ "{count, plural, one {# tag} other {# tags}}": "{count, plural, one {# etiket} other {# etiket}}"
- }
+ }
diff --cc locale/zh-CN/client.json
index d6ff0be24,263649983..276a182dd
--- a/locale/zh-CN/client.json
+++ b/locale/zh-CN/client.json
@@@ -99,6 -96,6 +99,15 @@@
"legal.notice": "在签署时,您同意<2/><0/>和<1/>。",
"legal.privacypolicy": "隐私政策",
"legal.termsofservice": "服务条款",
++ "linkmodal.insert": "插入链接",
++ "linkmodal.text.label": "要显示的文本",
++ "linkmodal.text.placeholder": "输入链接文本",
++ "linkmodal.text.required": "文本为必填项",
++ "linkmodal.title": "插入链接",
++ "linkmodal.url.invalid": "请输入有效的 URL",
++ "linkmodal.url.label": "网址",
++ "linkmodal.url.placeholder": "",
++ "linkmodal.url.required": "需要 URL",
"menu.administration": "管理",
"menu.mysettings": "我的设置",
"menu.signout": "退出",
@@@ -223,5 -204,13 +235,5 @@@
"signin.message.socialbutton.intro": "使用以下方式登录",
"validation.custom.maxattachments": "最多允许 {number} 个附件。",
"validation.custom.maximagesize": "图像大小必须小于{kilobytes}KB。",
- "{count, plural, one {# tag} other {# tags}}": "{count, plural, one {# tag} other {# tags}}",
- "linkmodal.insert": "插入链接",
- "linkmodal.text.label": "要显示的文本",
- "linkmodal.text.placeholder": "输入链接文本",
- "linkmodal.text.required": "文本为必填项",
- "linkmodal.title": "插入链接",
- "linkmodal.url.invalid": "请输入有效的 URL",
- "linkmodal.url.label": "网址",
- "linkmodal.url.required": "需要 URL"
+ "{count, plural, one {# tag} other {# tags}}": "{count, plural, one {# tag} other {# tags}}"
- }
+ }
diff --cc public/pages/Home/components/ShareFeedback.tsx
index 2ce56816c,7b453e532..f064027a9
--- a/public/pages/Home/components/ShareFeedback.tsx
+++ b/public/pages/Home/components/ShareFeedback.tsx
@@@ -5,7 -5,8 +5,8 @@@ import { SignInControl } from "@fider/c
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 { plainText } from "@fider/services/markdown"
import { i18n } from "@lingui/core"
import { Tag } from "@fider/models"
import { SimilarPosts } from "../components/SimilarPosts"