Open platform to collect and prioritize feedback
A11Y and filter improvements (#1346)
JimKnoxx10c2730508a1
diff --git a/app/actions/post.go b/app/actions/post.goindex 52489faa2..75a4d9e68 100644--- a/app/actions/post.go+++ b/app/actions/post.go@@ -2,6 +2,8 @@ package actionsimport ("context"+ "regexp"+ "strings""time""github.com/getfider/fider/app/models/dto"@@ -64,11 +66,14 @@ func (action *CreateNewPost) IsAuthorized(ctx context.Context, user *entity.Userfunc (action *CreateNewPost) Validate(ctx context.Context, user *entity.User) *validate.Result {result := validate.Success()- if action.Title == "" {+ re := regexp.MustCompile(`\s+`)+ normalizedTitle := strings.TrimSpace(re.ReplaceAllString(action.Title, " "))++ if normalizedTitle == "" {result.AddFieldFailure("title", propertyIsRequired(ctx, "title"))- } else if len(action.Title) < 10 {+ } else if len(normalizedTitle) < 10 {result.AddFieldFailure("title", i18n.T(ctx, "validation.custom.descriptivetitle"))- } else if len(action.Title) > 100 {+ } else if len(normalizedTitle) > 100 {result.AddFieldFailure("title", propertyMaxStringLen(ctx, "title", 100))} else if env.Config.PostCreationWithTagsEnabled && len(action.TagSlugs) != len(action.Tags) {result.AddFieldFailure("tags", propertyIsInvalid(ctx, "tags"))diff --git a/app/handlers/apiv1/post.go b/app/handlers/apiv1/post.goindex fa1134c7f..a82f59538 100644--- a/app/handlers/apiv1/post.go+++ b/app/handlers/apiv1/post.go@@ -29,6 +29,12 @@ func SearchPosts() web.HandlerFunc {if myVotesOnly, err := c.QueryParamAsBool("myvotes"); err == nil {searchPosts.MyVotesOnly = myVotesOnly}+ if noTagsOnly, err := c.QueryParamAsBool("notags"); err == nil {+ searchPosts.NoTagsOnly = noTagsOnly+ }+ if myPostsOnly, err := c.QueryParamAsBool("myposts"); err == nil {+ searchPosts.MyPostsOnly = myPostsOnly+ }searchPosts.SetStatusesFromStrings(c.QueryParamAsArray("statuses"))if err := bus.Dispatch(c, searchPosts); err != nil {diff --git a/app/handlers/post.go b/app/handlers/post.goindex f2b7ea41f..ced787e70 100644--- a/app/handlers/post.go+++ b/app/handlers/post.go@@ -28,6 +28,14 @@ func Index() web.HandlerFunc {searchPosts.MyVotesOnly = myVotesOnly}+ if noTagsOnly, err := c.QueryParamAsBool("notags"); err == nil {+ searchPosts.NoTagsOnly = noTagsOnly+ }++ if myPostsOnly, err := c.QueryParamAsBool("myposts"); err == nil {+ searchPosts.MyPostsOnly = myPostsOnly+ }+searchPosts.SetStatusesFromStrings(c.QueryParamAsArray("statuses"))getAllTags := &query.GetAllTags{}countPerStatus := &query.CountPostPerStatus{}diff --git a/app/models/query/post.go b/app/models/query/post.goindex 99d423649..5e9dde5fb 100644--- a/app/models/query/post.go+++ b/app/models/query/post.go@@ -40,6 +40,8 @@ type SearchPosts struct {Statuses []enum.PostStatusTags []stringMyVotesOnly bool+ NoTagsOnly bool+ MyPostsOnly boolResult []*entity.Post}diff --git a/app/services/sqlstore/postgres/common.go b/app/services/sqlstore/postgres/common.goindex ce6d15c1f..28b781638 100644--- a/app/services/sqlstore/postgres/common.go+++ b/app/services/sqlstore/postgres/common.go@@ -87,6 +87,10 @@ func getViewData(query query.SearchPosts) (string, []enum.PostStatus, string) {sort = "((COALESCE(recent_votes_count, 0)*5 + COALESCE(recent_comments_count, 0) *3)-1) / pow((EXTRACT(EPOCH FROM current_timestamp - created_at)/3600) + 2, 1.4)"}+ if query.NoTagsOnly {+ condition += " AND tags = '{}'"+ }+if len(query.Tags) > 0 {condition += " AND tags && $3"}diff --git a/app/services/sqlstore/postgres/post.go b/app/services/sqlstore/postgres/post.goindex 9b12dc05d..001dcc182 100644--- a/app/services/sqlstore/postgres/post.go+++ b/app/services/sqlstore/postgres/post.go@@ -466,6 +466,12 @@ func searchPosts(ctx context.Context, q *query.SearchPosts) error {}), ToTSQuery(q.Query), SanitizeString(q.Query))} else {condition, statuses, sort := getViewData(*q)++ if q.MyPostsOnly {+ condition += " AND user_id = " + strconv.Itoa(user.ID)++ }+sql := fmt.Sprintf(`SELECT * FROM (%s) AS qWHERE 1 = 1 %sdiff --git a/locale/ar/client.json b/locale/ar/client.jsonindex 40b96252d..0a702aa51 100644--- a/locale/ar/client.json+++ b/locale/ar/client.json@@ -44,10 +44,14 @@"home.form.defaultwelcomemessage": "يسعدنا سماع أفكارك.\n\nكيف يمكننا أن نكون أفضل؟ هذا هو المكان المناسب للتصويت والمناقشة ومشاركة الأفكار.","home.lonely.suggestion": "ننصح بإنشاء <0>٣ اقتراحات على الأقل</0> قبل مشاركة هذا الموقع. المحتوى المبدئي مهم لجذب جمهورك.","home.lonely.text": "لم يتم إنشاء منشورات بعد.",+ "home.postfilter.label.myactivity": "",+ "home.postfilter.label.status": "","home.postfilter.label.view": "عرض","home.postfilter.option.mostdiscussed": "الأكثر مناقشة","home.postfilter.option.mostwanted": "الأكثر طلبا",+ "home.postfilter.option.myposts": "","home.postfilter.option.myvotes": "تصويتي",+ "home.postfilter.option.notags": "","home.postfilter.option.recent": "الأحدث","home.postfilter.option.trending": "الشائع","home.postinput.description.placeholder": "صف اقتراحك (اختياري)",@@ -158,6 +162,7 @@"newpost.modal.title": "شارك بفكرتك...","newpost.modal.title.label": "أعط فكرتك عنوانًا","newpost.modal.title.placeholder": "شيء قصير وموجز، لخصه في بضع كلمات",+ "pDgeaz": "","page.backhome": "خذني إلى <0>{0}</0> الصفحة الرئيسية.","page.notinvited.text": "لم نتمكن من العثور على حساب لعنوان بريدك الإلكتروني.","page.notinvited.title": "لم تتم دعوتك",@@ -198,4 +203,4 @@"validation.custom.maxattachments": "يُسمح بحد أقصى {number} من المرفقات.","validation.custom.maximagesize": "يجب أن يكون حجم الصورة أصغر من {kilobytes}KB.","{count, plural, one {# tag} other {# tags}}": "{count, plural, zero {}one {# وسم} two {# وسوم} few {# وسوم} many {# وسوم} other {# وسوم}}"-}\ No newline at end of file+}diff --git a/locale/de/client.json b/locale/de/client.jsonindex 490a58d4a..98d4f8461 100644--- a/locale/de/client.json+++ b/locale/de/client.json@@ -44,10 +44,14 @@"home.form.defaultwelcomemessage": "Wir würden gerne erfahren, worüber Du nachdenkst.\n\nWas können wir verbessern? Hier kannst Du abstimmen, diskutieren und neue Ideen vorschlagen.","home.lonely.suggestion": "Es wird empfohlen, dass du <0>mindestens 3</0> Vorschläge hier erstellst, bevor du diese Seite teilst. Der anfängliche Inhalt ist wichtig, um die Interaktion mit deiner Zielgruppe zu fördern.","home.lonely.text": "Es wurden noch keine Beiträge erstellt.",+ "home.postfilter.label.myactivity": "Meine Aktivität",+ "home.postfilter.label.status": "Status","home.postfilter.label.view": "Anzeigen","home.postfilter.option.mostdiscussed": "Am häufigsten diskutiert","home.postfilter.option.mostwanted": "Meist gefragt",+ "home.postfilter.option.myposts": "Meine Beiträge","home.postfilter.option.myvotes": "Meine Stimmen",+ "home.postfilter.option.notags": "Nicht getaggt","home.postfilter.option.recent": "Neueste","home.postfilter.option.trending": "Beliebt","home.postinput.description.placeholder": "Beschreibe deinen Vorschlag (optional)",@@ -158,6 +162,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",+ "pDgeaz": "","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",@@ -198,4 +203,4 @@"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}}"-}\ No newline at end of file+}diff --git a/locale/el/client.json b/locale/el/client.jsonindex 285154b93..0ba0e2b31 100644--- a/locale/el/client.json+++ b/locale/el/client.json@@ -44,10 +44,14 @@"home.form.defaultwelcomemessage": "Θα θέλαμε πολύ να ακούσουμε τι σκέφτεστε.\n\nΤι μπορούμε να κάνουμε καλύτερα; Αυτό είναι το μέρος για να ψηφίσετε, να συζητήσετε και να μοιραστείτε ιδέες.","home.lonely.suggestion": "Συνιστάται να δημιουργείσετε εδώ <0>τουλάχιστον 3</0> προτάσεις πριν από την κοινή χρήση αυτής της ιστοσελίδας. Το αρχικό περιεχόμενο είναι σημαντικό να αρχίσετε να προσελκύετε το κοινό σας.","home.lonely.text": "Δεν έχουν δημιουργηθεί αναρτήσεις ακόμα.",+ "home.postfilter.label.myactivity": "",+ "home.postfilter.label.status": "","home.postfilter.label.view": "Προβολή","home.postfilter.option.mostdiscussed": "Πιο συζητημένα","home.postfilter.option.mostwanted": "Πιο ενδιαφέροντα",+ "home.postfilter.option.myposts": "","home.postfilter.option.myvotes": "Οι Ψήφοι Μου",+ "home.postfilter.option.notags": "","home.postfilter.option.recent": "Πρόσφατα","home.postfilter.option.trending": "Δημοφιλή","home.postinput.description.placeholder": "Περιγράψτε την πρότασή σας (προαιρετικό)",@@ -158,6 +162,7 @@"newpost.modal.title": "Μοιραστείτε την ιδέα σας...","newpost.modal.title.label": "Δώστε έναν τίτλο στην ιδέα σας","newpost.modal.title.placeholder": "Κάτι σύντομο και περιεκτικό, συνοψίστε το σε λίγες λέξεις",+ "pDgeaz": "","page.backhome": "Επιστρέψτε με στην αρχική σελίδα <0>{0}</0>.","page.notinvited.text": "Δεν μπορέσαμε να βρούμε λογαριασμό για τη διεύθυνση email σας.","page.notinvited.title": "Δεν έχει προσκληθεί",@@ -198,4 +203,4 @@"validation.custom.maxattachments": "Επιτρέπονται έως {number} συνημμένα.","validation.custom.maximagesize": "Το μέγεθος της εικόνας πρέπει να είναι μικρότερο από {kilobytes}KB.","{count, plural, one {# tag} other {# tags}}": "{count, plural, one {# ετικέτα} other {# ετικέτες}}"-}\ No newline at end of file+}diff --git a/locale/en/client.json b/locale/en/client.jsonindex abf3194b4..1c938f094 100644--- a/locale/en/client.json+++ b/locale/en/client.json@@ -44,10 +44,14 @@"home.form.defaultwelcomemessage": "We'd love to hear what you're thinking about.\n\nWhat can we do better? This is the place for you to vote, discuss and share ideas.","home.lonely.suggestion": "It's recommended that you create <0>at least 3</0> suggestions here before sharing this site. The initial content is important to start engaging your audience.","home.lonely.text": "No posts have been created yet.",+ "home.postfilter.label.myactivity": "Own",+ "home.postfilter.label.status": "Status","home.postfilter.label.view": "View","home.postfilter.option.mostdiscussed": "Most Discussed","home.postfilter.option.mostwanted": "Most Wanted",+ "home.postfilter.option.myposts": "My Posts","home.postfilter.option.myvotes": "My Votes",+ "home.postfilter.option.notags": "Untagged","home.postfilter.option.recent": "Recent","home.postfilter.option.trending": "Trending","home.postinput.description.placeholder": "Describe your suggestion (optional)",@@ -157,6 +161,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",+ "pDgeaz": "{title}","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",diff --git a/locale/es-ES/client.json b/locale/es-ES/client.jsonindex 03ad16bfa..f2279f5fd 100644--- a/locale/es-ES/client.json+++ b/locale/es-ES/client.json@@ -44,10 +44,14 @@"home.form.defaultwelcomemessage": "Nos encantaría escuchar lo que estás pensando.\n\n¿Qué podemos hacer mejor? Este es el lugar para que votes, discutas y compartas ideas.","home.lonely.suggestion": "Se recomienda que cree <0>al menos 3</0> sugerencias aquí antes de compartir este sitio. El contenido inicial es importante para empezar a atraer a su audiencia.","home.lonely.text": "No se han creado publicaciones todavía.",+ "home.postfilter.label.myactivity": "",+ "home.postfilter.label.status": "","home.postfilter.label.view": "Vista","home.postfilter.option.mostdiscussed": "Más Discutidos","home.postfilter.option.mostwanted": "Más Deseados",+ "home.postfilter.option.myposts": "","home.postfilter.option.myvotes": "Mis Votos",+ "home.postfilter.option.notags": "","home.postfilter.option.recent": "Reciente","home.postfilter.option.trending": "Populares","home.postinput.description.placeholder": "Describe tu sugerencia (opcional)",@@ -158,6 +162,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.",+ "pDgeaz": "","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",@@ -198,4 +203,4 @@"validation.custom.maxattachments": "Se permite un máximo de {number} archivos adjuntos.","validation.custom.maximagesize": "El tamaño de la imagen debe ser menor que {kilobytes}KB.","{count, plural, one {# tag} other {# tags}}": "{count, plural, one {# etiqueta} other {# etiquetas}}"-}\ No newline at end of file+}diff --git a/locale/fa/client.json b/locale/fa/client.jsonindex 0cca0c3a7..3a6ba1e36 100644--- a/locale/fa/client.json+++ b/locale/fa/client.json@@ -2,12 +2,14 @@"action.cancel": "لغو","action.change": "تغییر","action.close": "بستن",+ "action.commentsfeed": "","action.confirm": "تأیید","action.copylink": "کپی لینک","action.delete": "حذف","action.edit": "ویرایش","action.markallasread": "علامتگذاری همه بهعنوان خواندهشده","action.ok": "باشه",+ "action.postsfeed": "","action.respond": "پاسخ","action.save": "ذخیره","action.signin": "ورود",@@ -42,10 +44,14 @@"home.form.defaultwelcomemessage": "مایلیم بدانیم به چه میاندیشید.\n\nچه کاری میتوانیم بهتر انجام دهیم؟ اینجا جایی است برای رأی دادن، بحث و بهاشتراکگذاری ایدهها.","home.lonely.suggestion": "توصیه میشود قبل از بهاشتراکگذاری این سایت، <0>حداقل ۳</0> پیشنهاد ایجاد کنید. محتوای اولیه برای جذب مخاطبان شما مهم است.","home.lonely.text": "هنوز هیچ پستی ایجاد نشده است.",+ "home.postfilter.label.myactivity": "",+ "home.postfilter.label.status": "","home.postfilter.label.view": "نمایش","home.postfilter.option.mostdiscussed": "بیشترین بحث","home.postfilter.option.mostwanted": "بیشترین خواسته",+ "home.postfilter.option.myposts": "","home.postfilter.option.myvotes": "رأیهای من",+ "home.postfilter.option.notags": "","home.postfilter.option.recent": "جدیدترین","home.postfilter.option.trending": "داغترین","home.postinput.description.placeholder": "پیشنهاد خود را توضیح دهید (اختیاری)",@@ -58,6 +64,7 @@"home.tagsfilter.label.with": "دارای","home.tagsfilter.selected.none": "هر برچسب","label.actions": "اقدامات",+ "label.addtags": "","label.avatar": "آواتار","label.custom": "سفارشی","label.description": "توضیحات",@@ -75,6 +82,7 @@"label.notagsselected": "برچسبی انتخاب نشده است","label.notifications": "اعلانها","label.or": "یا",+ "label.searchtags": "","label.selecttags": "برچسبها را انتخاب کنید...","label.subscribe": "اشتراک","label.tags": "برچسبها",@@ -104,6 +112,8 @@"modal.notifications.nonew": "اعلان جدیدی نیست","modal.notifications.previous": "اعلانهای قبلی","modal.notifications.unread": "اعلانهای خواندهنشده",+ "modal.rss.description": "",+ "modal.rss.title": "","modal.showvotes.message.zeromatches": "کاربری با <0>{0}</0> یافت نشد.","modal.showvotes.query.placeholder": "جستجوی کاربر بر اساس نام...","modal.signin.header": "بازخورد خود را ارسال کنید",@@ -135,6 +145,7 @@"mysettings.notification.event.newpost": "پست جدید","mysettings.notification.event.newpost.staff": "پستهای جدید این سایت","mysettings.notification.event.newpost.visitors": "پستهای جدید این سایت",+ "mysettings.notification.event.newpostcreated": "","mysettings.notification.event.statuschanged": "تغییر وضعیت","mysettings.notification.event.statuschanged.staff": "تغییر وضعیت همهٔ پستها مگر اینکه لغو اشتراک شده باشد","mysettings.notification.event.statuschanged.visitors": "تغییر وضعیت پستهایی که مشترک هستید",@@ -145,6 +156,12 @@"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": "",+ "pDgeaz": "","page.backhome": "بازگشت به صفحهٔ اصلی <0>{0}</0>","page.notinvited.text": "ما حسابی برای آدرس ایمیل شما پیدا نکردیم.","page.notinvited.title": "دعوت نشده",@@ -182,5 +199,7 @@"signin.message.private.text": "اگر حساب یا دعوتنامه دارید، از گزینههای زیر برای ورود استفاده کنید.","signin.message.private.title": "<0>{0}</0> یک فضای خصوصی است؛ برای مشارکت باید وارد شوید.","signin.message.socialbutton.intro": "ورود با",+ "validation.custom.maxattachments": "",+ "validation.custom.maximagesize": "","{count, plural, one {# tag} other {# tags}}": "{count, plural, one {# برچسب} other {# برچسب}}"-}\ No newline at end of file+}diff --git a/locale/fr/client.json b/locale/fr/client.jsonindex a523c0309..7e711513d 100644--- a/locale/fr/client.json+++ b/locale/fr/client.json@@ -44,10 +44,14 @@"home.form.defaultwelcomemessage": "Nous aimerions savoir ce que vous pensez.\n\nQue pouvons-nous faire de mieux ? C'est ici que vous pouvez voter, discuter et partager vos idées.","home.lonely.suggestion": "Il est recommandé de créer <0>au moins 3</0> suggestions avant de partager ce site. Le contenu initial est important pour commencer à engager votre public.","home.lonely.text": "Aucun message n'a encore été créé.",+ "home.postfilter.label.myactivity": "",+ "home.postfilter.label.status": "","home.postfilter.label.view": "Afficher","home.postfilter.option.mostdiscussed": "Les plus discutés","home.postfilter.option.mostwanted": "Les plus votées",+ "home.postfilter.option.myposts": "","home.postfilter.option.myvotes": "Mes votes",+ "home.postfilter.option.notags": "","home.postfilter.option.recent": "Récent","home.postfilter.option.trending": "Populaire","home.postinput.description.placeholder": "Décrivez votre suggestion (facultatif)",@@ -158,6 +162,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",+ "pDgeaz": "","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é",@@ -198,4 +203,4 @@"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}}"-}\ No newline at end of file+}diff --git a/locale/it/client.json b/locale/it/client.jsonindex 7ae0a96c6..5a579c052 100644--- a/locale/it/client.json+++ b/locale/it/client.json@@ -44,10 +44,14 @@"home.form.defaultwelcomemessage": "Ci piacerebbe sentire quello che stai pensando.\n\nChe cosa possiamo fare meglio? Questo è il posto per voi per votare, discutere e condividere idee.","home.lonely.suggestion": "Si consiglia di creare <0>almeno 3</0> suggerimenti qui prima di condividere questo sito. Il contenuto iniziale è importante per iniziare ad coinvolgere il pubblico.","home.lonely.text": "Non sono stati inviati messaggi.",+ "home.postfilter.label.myactivity": "",+ "home.postfilter.label.status": "","home.postfilter.label.view": "Visualizza","home.postfilter.option.mostdiscussed": "Più discussi","home.postfilter.option.mostwanted": "I più votati",+ "home.postfilter.option.myposts": "","home.postfilter.option.myvotes": "I miei voti",+ "home.postfilter.option.notags": "","home.postfilter.option.recent": "Recenti","home.postfilter.option.trending": "Di tendenza","home.postinput.description.placeholder": "Descrivere il tuo suggerimento (opzionale)",@@ -158,6 +162,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",+ "pDgeaz": "","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",@@ -198,4 +203,4 @@"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}}"-}\ No newline at end of file+}diff --git a/locale/ja/client.json b/locale/ja/client.jsonindex f1bc26cdb..39b02499d 100644--- a/locale/ja/client.json+++ b/locale/ja/client.json@@ -44,10 +44,14 @@"home.form.defaultwelcomemessage": "皆さんが考えていることをお聞きかせください。\n\nどう改善できますでしょうか? ここでは、あなたが投票、議論、アイデアを共有する場所です。","home.lonely.suggestion": "このサイトを共有する前に、<0>少なくとも3</0>の提案をここで作成することをお勧めします。最初のコンテンツは、ユーザーを引き付けるために重要です。","home.lonely.text": "投稿がまだ作成されていません。",+ "home.postfilter.label.myactivity": "",+ "home.postfilter.label.status": "","home.postfilter.label.view": "表示","home.postfilter.option.mostdiscussed": "最も議論されたもの","home.postfilter.option.mostwanted": "最も人気のあるもの",+ "home.postfilter.option.myposts": "","home.postfilter.option.myvotes": "自分の投票",+ "home.postfilter.option.notags": "","home.postfilter.option.recent": "新着","home.postfilter.option.trending": "トレンド","home.postinput.description.placeholder": "提案を説明してください(オプション)",@@ -158,6 +162,7 @@"newpost.modal.title": "あなたのアイデアを共有してください...","newpost.modal.title.label": "アイデアにタイトルをつける","newpost.modal.title.placeholder": "短くて簡潔なもの、一言でまとめましょう",+ "pDgeaz": "","page.backhome": "<0>{0}</0>のホームページに戻ります。","page.notinvited.text": "あなたのメールアドレスのアカウントが見つかりませんでした","page.notinvited.title": "未招待",@@ -198,4 +203,4 @@"validation.custom.maxattachments": "最大 {number} 個の添付ファイルが許可されます。","validation.custom.maximagesize": "画像サイズは{kilobytes}KB未満である必要があります。","{count, plural, one {# tag} other {# tags}}": "{count, plural, one {# tag} other {# tags}}"-}\ No newline at end of file+}diff --git a/locale/nl/client.json b/locale/nl/client.jsonindex b2bca7d40..920e41ebd 100644--- a/locale/nl/client.json+++ b/locale/nl/client.json@@ -44,10 +44,14 @@"home.form.defaultwelcomemessage": "We horen graag waar je aan denkt.\n\nWat kunnen we beter doen? Dit is de plek waar je op ideeën kunt stemmen en reageren, en ook je eigen ideeën kunt delen.","home.lonely.suggestion": "Het is aanbevolen om <0>tenminste 3 ideeën</0> aan te maken voor het delen van de site. De initiële inhoud is belangrijk om jouw publiek te motiveren om deel te nemen.","home.lonely.text": "Er zijn nog geen berichten aangemaakt.",+ "home.postfilter.label.myactivity": "",+ "home.postfilter.label.status": "","home.postfilter.label.view": "Bekijk","home.postfilter.option.mostdiscussed": "Meest besproken","home.postfilter.option.mostwanted": "Meeste stemmen",+ "home.postfilter.option.myposts": "","home.postfilter.option.myvotes": "Mijn stemmen",+ "home.postfilter.option.notags": "","home.postfilter.option.recent": "Recent","home.postfilter.option.trending": "Trending","home.postinput.description.placeholder": "Beschrijf jouw suggestie (optioneel)",@@ -158,6 +162,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",+ "pDgeaz": "","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",@@ -198,4 +203,4 @@"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}}"-}\ No newline at end of file+}diff --git a/locale/pl/client.json b/locale/pl/client.jsonindex 9d4a8ac22..044d9f5a4 100644--- a/locale/pl/client.json+++ b/locale/pl/client.json@@ -44,10 +44,14 @@"home.form.defaultwelcomemessage": "Chcemy się dowiedzieć o czym myślisz.\n\nCo możemy poprawić? To jest miejsce, w którym możesz głosować, dyskutować i dzielić się pomysłami.","home.lonely.suggestion": "Zaleca się stworzenie tutaj <0>co najmniej 3</0> sugestii przed udostępnieniem tej witryny. Początkowa zawartość jest ważna do zaangażowania swoich odbiorców.","home.lonely.text": "Nie stworzono jeszcze żadnych postów.",+ "home.postfilter.label.myactivity": "",+ "home.postfilter.label.status": "","home.postfilter.label.view": "Widok","home.postfilter.option.mostdiscussed": "Najczęściej dyskutowane","home.postfilter.option.mostwanted": "Najbardziej Pożądane",+ "home.postfilter.option.myposts": "","home.postfilter.option.myvotes": "Moje Głosy",+ "home.postfilter.option.notags": "","home.postfilter.option.recent": "Niedawne","home.postfilter.option.trending": "Popularne","home.postinput.description.placeholder": "Opisz swoją sugestię (opcjonalnie)",@@ -158,6 +162,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",+ "pDgeaz": "","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",@@ -198,4 +203,4 @@"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}}"-}\ No newline at end of file+}diff --git a/locale/pt-BR/client.json b/locale/pt-BR/client.jsonindex deedbc39c..62c1442d1 100644--- a/locale/pt-BR/client.json+++ b/locale/pt-BR/client.json@@ -44,10 +44,14 @@"home.form.defaultwelcomemessage": "Gostaríamos de ouvir sobre o que você está pensando.\n\nO que podemos fazer melhor? Este é o lugar para você votar, discutir e compartilhar ideias.","home.lonely.suggestion": "É recomendável que você crie <0>pelo menos 3</0> sugestões aqui antes de compartilhar este site. O conteúdo inicial é importante para começar a engajar seu público.","home.lonely.text": "Nenhuma postagem foi criada ainda.",+ "home.postfilter.label.myactivity": "",+ "home.postfilter.label.status": "","home.postfilter.label.view": "Visualizar","home.postfilter.option.mostdiscussed": "Mais Discutidos","home.postfilter.option.mostwanted": "Mais Desejados",+ "home.postfilter.option.myposts": "","home.postfilter.option.myvotes": "Meus Votos",+ "home.postfilter.option.notags": "","home.postfilter.option.recent": "Recentes","home.postfilter.option.trending": "Popular","home.postinput.description.placeholder": "Descreva sua sugestão (opcional)",@@ -158,6 +162,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",+ "pDgeaz": "","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",@@ -198,4 +203,4 @@"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}}"-}\ No newline at end of file+}diff --git a/locale/ru/client.json b/locale/ru/client.jsonindex 95705f6f1..a7a5cd5ab 100644--- a/locale/ru/client.json+++ b/locale/ru/client.json@@ -44,10 +44,14 @@"home.form.defaultwelcomemessage": "Мы хотели бы услышать ваше мнение. \n\nКак мы можем улучшиться? Здесь можно голосовать, обсуждать и делиться идеями.","home.lonely.suggestion": "Советуем создать <0>хотя бы 3</0> предложения перед публикацией этого сайта. Это важно для большего вовлечения аудитории.","home.lonely.text": "Здесь пока нет постов.",+ "home.postfilter.label.myactivity": "",+ "home.postfilter.label.status": "","home.postfilter.label.view": "Просмотреть","home.postfilter.option.mostdiscussed": "Наиболее обсуждаемые","home.postfilter.option.mostwanted": "Наиболее востребованные",+ "home.postfilter.option.myposts": "","home.postfilter.option.myvotes": "Мои голоса",+ "home.postfilter.option.notags": "","home.postfilter.option.recent": "Недавние","home.postfilter.option.trending": "В тренде","home.postinput.description.placeholder": "Опишите своё предложение (по желанию)",@@ -158,6 +162,7 @@"newpost.modal.title": "Поделитесь своей идеей...","newpost.modal.title.label": "Дайте название своей идее","newpost.modal.title.placeholder": "Что-то короткое и емкое, изложите это в нескольких словах.",+ "pDgeaz": "","page.backhome": "Верните меня на домашнюю страницу <0>{0}</0>.","page.notinvited.text": "Мы не смогли найти аккаунт, соответствующий этому адресу электронной почты.","page.notinvited.title": "Не приглашён",@@ -198,4 +203,4 @@"validation.custom.maxattachments": "Разрешено максимум {number} вложений.","validation.custom.maximagesize": "Размер изображения должен быть меньше {kilobytes}КБ.","{count, plural, one {# tag} other {# tags}}": "{count, plural, one {# tag} other {# tags}}"-}\ No newline at end of file+}diff --git a/locale/sk/client.json b/locale/sk/client.jsonindex 7b51921ec..104fc8960 100644--- a/locale/sk/client.json+++ b/locale/sk/client.json@@ -44,10 +44,14 @@"home.form.defaultwelcomemessage": "Radi by sme počuli, čo máte na mysli.\n\nČo môžeme urobiť lepšie? Tu môžete hlasovať, diskutovať a zdieľať nápady.","home.lonely.suggestion": "Pred zdieľaním tejto stránky tu odporúčame vytvoriť <0> aspoň 3 </0> návrhy. Počiatočný obsah je dôležitý, aby ste mohli zaujať publikum.","home.lonely.text": "Zatiaľ neboli vytvorené žiadne príspevky.",+ "home.postfilter.label.myactivity": "",+ "home.postfilter.label.status": "","home.postfilter.label.view": "Prehľad","home.postfilter.option.mostdiscussed": "Najviac diskutované","home.postfilter.option.mostwanted": "Najhľadanejšie",+ "home.postfilter.option.myposts": "","home.postfilter.option.myvotes": "Moje hlasy",+ "home.postfilter.option.notags": "","home.postfilter.option.recent": "Nedávne","home.postfilter.option.trending": "Trendy","home.postinput.description.placeholder": "Popíšte svoj návrh (voliteľné)",@@ -158,6 +162,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",+ "pDgeaz": "","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ý",@@ -198,4 +203,4 @@"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}}"-}\ No newline at end of file+}diff --git a/locale/sv-SE/client.json b/locale/sv-SE/client.jsonindex ebdd5a2a9..f89fc901f 100644--- a/locale/sv-SE/client.json+++ b/locale/sv-SE/client.json@@ -44,10 +44,14 @@"home.form.defaultwelcomemessage": "Vi vill gärna höra vad du tänker på.\n\nVad kan vi göra bättre? Detta är platsen för dig att rösta, diskutera och dela idéer.","home.lonely.suggestion": "Vi rekommenderar att du skapar <0>minst 3</0> förslag här innan du börjar dela den här webbplatsen. Det initiala innehållet är viktigt för att engagera dina besökare.","home.lonely.text": "Det finns inte några inlägg ännu.",+ "home.postfilter.label.myactivity": "",+ "home.postfilter.label.status": "","home.postfilter.label.view": "Visa","home.postfilter.option.mostdiscussed": "Mest diskuterade","home.postfilter.option.mostwanted": "Mest önskade",+ "home.postfilter.option.myposts": "","home.postfilter.option.myvotes": "Mina röster",+ "home.postfilter.option.notags": "","home.postfilter.option.recent": "Senaste","home.postfilter.option.trending": "Trendar","home.postinput.description.placeholder": "Beskriv ditt förslag (frivilligt)",@@ -158,6 +162,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",+ "pDgeaz": "","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",@@ -198,4 +203,4 @@"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}}"-}\ No newline at end of file+}diff --git a/locale/tr/client.json b/locale/tr/client.jsonindex a7f8d39e8..5c8232f19 100644--- a/locale/tr/client.json+++ b/locale/tr/client.json@@ -44,10 +44,14 @@"home.form.defaultwelcomemessage": "Ne düşündüğünüzü öğrenmeyi çok isteriz.\n\nKendimizi nasıl geliştirebiliriz? Burada önerileri oylayabilir, tartışabilir ya da paylaşabilirsiniz.","home.lonely.suggestion": "Siteyi paylaşmadan önce buraya <0>en az 3</0> öneri girmenizi tavsiye ederiz. İlk içerikler, hedef kitlenizin etkileşime geçmesi için önemlidir.","home.lonely.text": "Henüz hiç öneri oluşturulmadı.",+ "home.postfilter.label.myactivity": "",+ "home.postfilter.label.status": "","home.postfilter.label.view": "Görünüm","home.postfilter.option.mostdiscussed": "En Tartışılan","home.postfilter.option.mostwanted": "En Talep Edilen",+ "home.postfilter.option.myposts": "","home.postfilter.option.myvotes": "Oyladıklarım",+ "home.postfilter.option.notags": "","home.postfilter.option.recent": "En Son","home.postfilter.option.trending": "Öne Çıkanlar","home.postinput.description.placeholder": "Önerinizin detaylarını açıklayın (isteğe bağlı)",@@ -158,6 +162,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",+ "pDgeaz": "","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ş",@@ -198,4 +203,4 @@"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}}"-}\ No newline at end of file+}diff --git a/locale/zh-CN/client.json b/locale/zh-CN/client.jsonindex 3e14f306a..271e04255 100644--- a/locale/zh-CN/client.json+++ b/locale/zh-CN/client.json@@ -44,10 +44,14 @@"home.form.defaultwelcomemessage": "我们很想听听你在想什么。\n\n我们能做得更好吗?这是您投票、讨论和分享想法的地方.","home.lonely.suggestion": "建议您在共享此网站之前,在此处创建<0>至少3个</0>建议。初始内容对于开始吸引观众很重要.","home.lonely.text": "尚未创建任何帖子.",+ "home.postfilter.label.myactivity": "",+ "home.postfilter.label.status": "","home.postfilter.label.view": "看板","home.postfilter.option.mostdiscussed": "讨论最多","home.postfilter.option.mostwanted": "投票最多",+ "home.postfilter.option.myposts": "","home.postfilter.option.myvotes": "我的投票",+ "home.postfilter.option.notags": "","home.postfilter.option.recent": "最近","home.postfilter.option.trending": "趋势","home.postinput.description.placeholder": "描述你的建议(可选)",@@ -158,6 +162,7 @@"newpost.modal.title": "分享你的想法...","newpost.modal.title.label": "给你的想法起个标题","newpost.modal.title.placeholder": "简短而活泼,用几句话概括",+ "pDgeaz": "","page.backhome": "带我回到<0>{0}</0>主页.","page.notinvited.text": "我们找不到您电子邮件地址的帐户.","page.notinvited.title": "未被邀请",@@ -198,4 +203,4 @@"validation.custom.maxattachments": "最多允许 {number} 个附件。","validation.custom.maximagesize": "图像大小必须小于{kilobytes}KB。","{count, plural, one {# tag} other {# tags}}": "{count, plural, one {# tag} other {# tags}}"-}\ No newline at end of file+}diff --git a/public/assets/styles/utility/text.scss b/public/assets/styles/utility/text.scssindex 7225d322a..78597f895 100644--- a/public/assets/styles/utility/text.scss+++ b/public/assets/styles/utility/text.scss@@ -65,7 +65,7 @@ pre:last-child {.text-category {font-size: get("font.size.xs");font-weight: get("font.weight.semibold");- color: var(--colors-gray-600);+ color: var(--colors-gray-700);text-transform: uppercase;}diff --git a/public/assets/styles/variables/_dark-colors.scss b/public/assets/styles/variables/_dark-colors.scssindex 685f18364..962275435 100644--- a/public/assets/styles/variables/_dark-colors.scss+++ b/public/assets/styles/variables/_dark-colors.scss@@ -6,7 +6,7 @@ $dark-colors: ("400": #545454,"500": #616161,"600": #838383,- "700": #929292,+ "700": #a0a0a0,"800": #c1c1c1,"900": #fefefe,"50": #1a1a1a,diff --git a/public/components/Header.tsx b/public/components/Header.tsxindex 4629bf58c..ac2545127 100644--- a/public/components/Header.tsx+++ b/public/components/Header.tsx@@ -6,7 +6,11 @@ import { Trans } from "@lingui/react/macro"import { i18n } from "@lingui/core"import IconRss from "@fider/assets/images/heroicons-rss.svg"-export const Header = () => {+interface HeaderProps {+ hasInert?: boolean+}++export const Header = (props: HeaderProps) => {const fider = useFider()const [isSignInModalOpen, setIsSignInModalOpen] = useState(false)const [isRSSModalOpen, setIsRSSModalOpen] = useState(false)@@ -26,7 +30,7 @@ export const Header = () => {const hideRSSModal = () => setIsRSSModalOpen(false)return (- <div id="c-header" className="bg-white">+ <div id="c-header" className="bg-white" {...(props.hasInert && { inert: "true" })}><SignInModal isOpen={isSignInModalOpen} onClose={hideSignInModal} /><RSSModal isOpen={isRSSModalOpen} onClose={hideRSSModal} url={`${fider.settings.baseURL}/feed/global.atom`} /><HStack className="c-menu shadow p-4 w-full">diff --git a/public/components/VoteCounter.scss b/public/components/VoteCounter.scssindex a21da5be1..d2a9af321 100644--- a/public/components/VoteCounter.scss+++ b/public/components/VoteCounter.scss@@ -4,8 +4,8 @@&__button {font-size: get("font.size.lg");// border: none;- width: sizing(11);- font-weight: get("font.weight.bold");+ width: sizing(12);+ height: sizing(12);cursor: pointer;// background-color: transparent;text-align: center;@@ -17,10 +17,16 @@align-items: center;svg {- color: var(--colors-gray-400);+ color: var(--colors-gray-700);margin-bottom: -2px;}+ &--voted {+ justify-content: center;+ padding: 0;+ font-weight: get("font.weight.bold");+ }+&--voted,&:hover {color: var(--colors-primary-base);@@ -30,6 +36,8 @@}&--disabled {+ justify-content: center;+ padding: 0;@include disabled();}}diff --git a/public/components/VoteCounter.tsx b/public/components/VoteCounter.tsxindex bab60a2ee..5604e153b 100644--- a/public/components/VoteCounter.tsx+++ b/public/components/VoteCounter.tsx@@ -46,14 +46,14 @@ export const VoteCounter = (props: VoteCounterProps) => {const vote = (<button className={className} onClick={voteOrUndo}>- <Icon sprite={FaCaretUp} height="16" width="16" />+ {!hasVoted && <Icon sprite={FaCaretUp} height="16" width="16" />}{votesCount}</button>)const disabled = (<button className={className}>- <Icon sprite={FaCaretUp} height="16" width="16" />+ {!hasVoted && <Icon sprite={FaCaretUp} height="16" width="16" />}{votesCount}</button>)diff --git a/public/components/common/Markdown.scss b/public/components/common/Markdown.scssindex 1f71c2d66..09464f5f8 100644--- a/public/components/common/Markdown.scss+++ b/public/components/common/Markdown.scss@@ -6,10 +6,26 @@word-break: break-word;blockquote {- padding: 0 spacing(2);+ padding: spacing(2);color: var(--colors-gray-900);border-inline-start: 4px solid var(--colors-gray-300);- margin: spacing(1) 0;+ margin: spacing(1) 0 spacing(1) spacing(4);+ background-color: var(--colors-gray-200);+ border-radius: 4px;+ }++ .mention {+ background-color: var(--colors-blue-100);+ border-radius: get("border.radius.medium");+ box-decoration-break: clone;+ color: var(--colors-blue-600);+ padding-inline-start: spacing(1);+ padding-inline-end: spacing(1);+ padding-top: 4px;+ padding-bottom: 4px;+ &::after {+ content: "\200B";+ }}h1 {diff --git a/public/components/common/Modal.scss b/public/components/common/Modal.scssindex 0d9ad1a9c..793ce936b 100644--- a/public/components/common/Modal.scss+++ b/public/components/common/Modal.scss@@ -108,7 +108,7 @@ $c-modal-dimmer-padding: 1em;}.c-modal-closeicon {- color: get("colors.gray.400");+ color: var(--colors-gray-700);cursor: pointer;transition: color 0.2s ease;diff --git a/public/components/common/Modal.tsx b/public/components/common/Modal.tsxindex bb84e1148..c378709fb 100644--- a/public/components/common/Modal.tsx+++ b/public/components/common/Modal.tsx@@ -39,8 +39,7 @@ const ModalWindow: React.FunctionComponent<ModalWindowProps> = ({ size = "small"}const keyDown = (event: KeyboardEvent) => {- if (event.keyCode === 27) {- // ESC+ if (event.code === "Escape") {close()}}diff --git a/public/components/common/TagsSelect.tsx b/public/components/common/TagsSelect.tsxindex ff577fb9b..8e9749d3a 100644--- a/public/components/common/TagsSelect.tsx+++ b/public/components/common/TagsSelect.tsx@@ -74,6 +74,8 @@ export const TagsSelect = (props: TagsSelectProps) => {return}+ event.stopPropagation()+setIsEditing(false)}@@ -86,10 +88,8 @@ export const TagsSelect = (props: TagsSelectProps) => {}document.addEventListener("mousedown", handleClickOutside)- document.addEventListener("keydown", handleEsc)return () => {document.removeEventListener("mousedown", handleClickOutside)- document.addEventListener("keydown", handleEsc)}}, [])@@ -120,7 +120,7 @@ export const TagsSelect = (props: TagsSelectProps) => {// Dynamic multiselect dropdown for tags selectionconst editTagsList = props.tags.length > 0 && (- <div className="c-tags-select__container" ref={dropdownRef} onClick={props.canEdit && !isEditing ? onSubtitleClick : undefined}>+ <div className="c-tags-select__container" ref={dropdownRef} onKeyDown={handleEsc} onClick={props.canEdit && !isEditing ? onSubtitleClick : undefined}><div className="c-tags-select__selected-container">{props.selected.length === 0 && props.canEdit && (<Button className="text-gray-600" variant={"link"} size={"no-padding"} onClick={onSubtitleClick}>diff --git a/public/components/common/form/CommentEditor.scss b/public/components/common/form/CommentEditor.scssindex 5c1a9a0b0..ae33d3b62 100644--- a/public/components/common/form/CommentEditor.scss+++ b/public/components/common/form/CommentEditor.scss@@ -93,7 +93,7 @@}.mention {- background-color: var(--colors-blue-200);+ background-color: var(--colors-blue-100);border-radius: get("border.radius.medium");box-decoration-break: clone;color: var(--colors-blue-600);@@ -127,7 +127,7 @@// Placeholderp.tiptap-is-empty:first-child::before {- color: var(--colors-gray-600);+ color: var(--colors-gray-700);content: attr(data-placeholder);float: left;height: 0;diff --git a/public/components/common/form/Input.scss b/public/components/common/form/Input.scssindex 79f1723bb..d020e6d90 100644--- a/public/components/common/form/Input.scss+++ b/public/components/common/form/Input.scss@@ -16,7 +16,7 @@}&::placeholder {- color: var(--colors-gray-600);+ color: var(--colors-gray-700);}& + svg,diff --git a/public/components/common/form/Input.tsx b/public/components/common/form/Input.tsxindex 931859e2e..eb77ecb8b 100644--- a/public/components/common/form/Input.tsx+++ b/public/components/common/form/Input.tsx@@ -26,6 +26,7 @@ interface InputProps {onFocus?: () => voidinputRef?: React.MutableRefObject<any>onChange?: (value: string) => void+ onKeyDown?: (e: KeyboardEvent) => void}export const Input: React.FunctionComponent<InputProps> = (props) => {@@ -43,6 +44,12 @@ export const Input: React.FunctionComponent<InputProps> = (props) => {}}+ const onKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {+ if (props.onKeyDown) {+ props.onKeyDown(e.nativeEvent)+ }+ }+const suffix = typeof props.suffix === "string" ? <span className="c-input__suffix">{props.suffix}</span> : props.suffixconst icon = props.icon ? <Icon sprite={props.icon} onClick={props.onIconClick} className={classSet({ clickable: !!props.onIconClick })} /> : undefined@@ -90,6 +97,7 @@ export const Input: React.FunctionComponent<InputProps> = (props) => {// Call the original onChange handleronChange(e)}}+ onKeyDown={(e) => onKeyDown(e)}/>{icon}{suffix}diff --git a/public/pages/Home/Home.page.tsx b/public/pages/Home/Home.page.tsxindex 2f1d1a827..f7a30b6af 100644--- a/public/pages/Home/Home.page.tsx+++ b/public/pages/Home/Home.page.tsx@@ -92,8 +92,8 @@ What can we do better? This is the place for you to vote, discuss and share ideaisOpen={isShareFeedbackOpen && !fider.isReadOnly}onClose={() => setIsShareFeedbackOpen(false)}/>- <Header />- <div id="p-home" className="page container">+ <Header hasInert={isShareFeedbackOpen && !fider.isReadOnly} />+ <div id="p-home" className="page container" {...(isShareFeedbackOpen && !fider.isReadOnly && { inert: "true" })}><div className="p-home__welcome-col"><VStack spacing={2} className="p-4"><Markdown text={fider.session.tenant.welcomeMessage || defaultWelcomeMessage} style="full" />diff --git a/public/pages/Home/components/PostFilter.tsx b/public/pages/Home/components/PostFilter.tsxindex 5a42fe6f6..af612ae95 100644--- a/public/pages/Home/components/PostFilter.tsx+++ b/public/pages/Home/components/PostFilter.tsx@@ -8,8 +8,9 @@ import { i18n } from "@lingui/core"import { FilterState } from "./PostsContainer"import "./PostFilter.scss"+import { Trans } from "@lingui/react/macro"-type FilterType = "tag" | "status" | "myVotes"+type FilterType = "tag" | "status" | "myVotes" | "noTags" | "myPosts"interface OptionItem {value: string | boolean@@ -41,11 +42,17 @@ const FilterStateToFilterItems = (filterState: FilterState): FilterItem[] => {if (filterState.myVotes) {filterItems.push({ type: "myVotes", value: true })}+ if (filterState.noTags) {+ filterItems.push({ type: "noTags", value: true })+ }+ if (filterState.myPosts) {+ filterItems.push({ type: "myPosts", value: true })+ }return filterItems}const FilterItemsToFilterState = (filterItems: FilterItem[]): FilterState => {- const filterState: FilterState = { tags: [], statuses: [], myVotes: false }+ const filterState: FilterState = { tags: [], statuses: [], myVotes: false, noTags: false, myPosts: false }filterItems.forEach((i) => {if (i.type === "tag") {filterState.tags.push(i.value as string)@@ -53,6 +60,10 @@ const FilterItemsToFilterState = (filterItems: FilterItem[]): FilterState => {filterState.statuses.push(i.value as string)} else if (i.type === "myVotes") {filterState.myVotes = true+ } else if (i.type === "noTags") {+ filterState.noTags = true+ } else if (i.type === "myPosts") {+ filterState.myPosts = true}})return filterState@@ -77,6 +88,7 @@ export const PostFilter = (props: PostFilterProps) => {if (fider.session.isAuthenticated) {options.push({ value: true, label: i18n._({ id: "home.postfilter.option.myvotes", message: "My Votes" }), type: "myVotes" })+ options.push({ value: true, label: i18n._({ id: "home.postfilter.option.myposts", message: "My Posts" }), type: "myPosts" })}PostStatus.All.filter((s) => s.filterable && props.countPerStatus[s.value]).forEach((s) => {@@ -89,17 +101,52 @@ export const PostFilter = (props: PostFilterProps) => {})})- props.tags.forEach((t) => {+ if (props.tags.length > 0) {options.push({- label: t.name,- value: t.slug,- type: "tag",+ value: true,+ label: i18n._({ id: "home.postfilter.option.notags", message: "Untagged" }),+ type: "noTags",})- })++ props.tags.forEach((t) => {+ options.push({+ label: t.name,+ value: t.slug,+ type: "tag",+ })+ })+ }const filterCount = filterItems.lengthconst filteredOptions = options.filter((option) => option.label.toLowerCase().includes(query.toLowerCase()))+ const FilterGroupSection = ({ title, type, titleId }: { title: string; type: string[]; titleId?: string }) => {+ const options = filteredOptions.filter((o) => type.includes(o.type))++ if (options.length === 0) return null++ return (+ <>+ <div className="p-2 text-medium uppercase">{titleId ? <Trans id={titleId}>{title}</Trans> : title}</div>++ {options.map((o) => {+ const isChecked = filterItems.some((f) => f.type === o.type && f.value === o.value)++ return (+ <Dropdown.ListItem onClick={handleChangeFilter(o)} key={o.value.toString()}>+ <Checkbox field={o.value.toString()} checked={isChecked}>+ <HStack spacing={2}>+ <span className={isChecked ? "text-semibold" : ""}>{o.label}</span>+ {o.count && o.count > 0 && <span className="bg-gray-200 inline-block rounded-full px-1 w-min-4 text-2xs text-center">{o.count}</span>}+ </HStack>+ </Checkbox>+ </Dropdown.ListItem>+ )+ })}+ </>+ )+ }+return (<HStack className="mr-4"><Dropdown@@ -119,22 +166,12 @@ export const PostFilter = (props: PostFilterProps) => {className="c-input filter-input"placeholder={i18n._({ id: "home.filter.search.label", message: "Search in filters..." })}/>- {filteredOptions.map((o) => {- const isChecked = filterItems.find((f) => f.type === o.type && f.value === o.value) !== undefined- return (- <Dropdown.ListItem onClick={handleChangeFilter(o)} key={o.value.toString()}>- <Checkbox field={o.value.toString()} checked={isChecked}>- <HStack spacing={2}>- <span className={isChecked ? "text-semibold" : ""}>{o.label}</span>- <div className="">- {o.count && o.count > 0 && <span className="bg-gray-200 inline-block rounded-full px-1 w-min-4 text-2xs text-center">{o.count}</span>}- </div>- </HStack>- </Checkbox>- </Dropdown.ListItem>- )- })}+ <FilterGroupSection title="My activity" type={["myVotes", "myPosts"]} titleId="home.postfilter.label.myactivity" />++ <FilterGroupSection title="Status" type={["status"]} titleId="home.postfilter.label.status" />++ <FilterGroupSection title="Tags" type={["noTags", "tag"]} titleId="label.tags" /></Dropdown></HStack>)diff --git a/public/pages/Home/components/PostsContainer.tsx b/public/pages/Home/components/PostsContainer.tsxindex ccf822963..405930ecc 100644--- a/public/pages/Home/components/PostsContainer.tsx+++ b/public/pages/Home/components/PostsContainer.tsx@@ -33,6 +33,8 @@ export interface FilterState {tags: string[]statuses: string[]myVotes: boolean+ myPosts: boolean+ noTags: boolean}export class PostsContainer extends React.Component<PostsContainerProps, PostsContainerState> {@@ -46,7 +48,13 @@ export class PostsContainer extends React.Component<PostsContainerProps, PostsColoading: false,view,query: querystring.get("query"),- filterState: { tags: querystring.getArray("tags"), statuses: querystring.getArray("statuses"), myVotes: querystring.get("myvotes") === "true" },+ filterState: {+ tags: querystring.getArray("tags"),+ statuses: querystring.getArray("statuses"),+ myVotes: querystring.get("myvotes") === "true",+ myPosts: querystring.get("myposts") === "true",+ noTags: querystring.get("notags") === "true",+ },limit: querystring.getNumber("limit"),}}@@ -59,6 +67,8 @@ export class PostsContainer extends React.Component<PostsContainerProps, PostsCostatuses: this.state.filterState.statuses,tags: this.state.filterState.tags,myvotes: this.state.filterState.myVotes ? "true" : undefined,+ myposts: this.state.filterState.myPosts ? "true" : undefined,+ notags: this.state.filterState.noTags ? "true" : undefined,query,view: this.state.view,limit: this.state.limit,@@ -72,17 +82,29 @@ export class PostsContainer extends React.Component<PostsContainerProps, PostsCothis.state.filterState.tags,this.state.filterState.statuses,this.state.filterState.myVotes,+ this.state.filterState.myPosts,+ this.state.filterState.noTags,reset)})}private timer?: number- private async searchPosts(query: string, view: string, limit: number | undefined, tags: string[], statuses: string[], myVotes: boolean, reset: boolean) {+ private async searchPosts(+ query: string,+ view: string,+ limit: number | undefined,+ tags: string[],+ statuses: string[],+ myVotes: boolean,+ myPosts: boolean,+ noTags: boolean,+ reset: boolean+ ) {window.clearTimeout(this.timer)this.setState({ posts: reset ? undefined : this.state.posts, loading: true })this.timer = window.setTimeout(() => {- actions.searchPosts({ query, view: view, limit, tags, statuses, myVotes }).then((response) => {+ actions.searchPosts({ query, view: view, limit, tags, statuses, myVotes, noTags }).then((response) => {if (response.ok && this.state.loading) {this.setState({ loading: false, posts: response.data })}diff --git a/public/pages/Home/components/ShareFeedback.tsx b/public/pages/Home/components/ShareFeedback.tsxindex 67e655da9..20168232d 100644--- a/public/pages/Home/components/ShareFeedback.tsx+++ b/public/pages/Home/components/ShareFeedback.tsx@@ -144,6 +144,12 @@ export const ShareFeedback: React.FC<ShareFeedbackProps> = (props) => {}}+ const handleKeyDown = (e: KeyboardEvent) => {+ if (e.key === "Enter") {+ e.preventDefault()+ }+ }+const handleTagsChanged = (newTags: Tag[]) => {setCachedTags(newTags.map((tag) => tag.slug))setTags(newTags)@@ -240,6 +246,7 @@ export const ShareFeedback: React.FC<ShareFeedbackProps> = (props) => {value={title}disabled={fider.isReadOnly}onChange={handleTitleChange}+ onKeyDown={handleKeyDown}placeholder={i18n._({ id: "newpost.modal.title.placeholder", message: "Something short and snappy, sum it up in a few words" })}/>{canEditTags && (@@ -273,7 +280,7 @@ export const ShareFeedback: React.FC<ShareFeedbackProps> = (props) => {</div>) : (/* For authenticated users, only show the submit button container when title is long enough */- title.length > 9 && (+ title.replace(/\s+/g, " ").trim().length > 9 && (<div className="c-share-feedback__content animate-fade-in"><div className="c-share-feedback-signin"><div className="flex justify-center">diff --git a/public/pages/Home/components/SimilarPosts.tsx b/public/pages/Home/components/SimilarPosts.tsxindex 7b3650fee..7a1afde66 100644--- a/public/pages/Home/components/SimilarPosts.tsx+++ b/public/pages/Home/components/SimilarPosts.tsx@@ -81,7 +81,7 @@ export const SimilarPosts: React.FC<SimilarPostsProps> = (props) => {return (<>- <div className={`similar-posts-container overflow-auto ${animationClass}`}>+ <div className={`similar-posts-container overflow-auto ${animationClass}`} {...(!isVisible && { inert: "true" })}><div className="mb-4 text-gray-700">{title_text}</div><div className="mb-6"><ListPosts posts={posts} tags={props.tags} emptyText="" minimalView={true} />diff --git a/public/services/actions/post.ts b/public/services/actions/post.tsindex 18a5e43d1..5d48116c0 100644--- a/public/services/actions/post.ts+++ b/public/services/actions/post.ts@@ -11,6 +11,8 @@ export interface SearchPostsParams {limit?: numbertags?: string[]myVotes?: boolean+ noTags?: boolean+ myPosts?: booleanstatuses?: string[]}@@ -25,6 +27,12 @@ export const searchPosts = async (params: SearchPostsParams): Promise<Result<Posif (params.myVotes) {qsParams += `&myvotes=true`}+ if (params.noTags) {+ qsParams += `¬ags=true`+ }+ if (params.myPosts) {+ qsParams += `&myposts=true`+ }return await http.get<Post[]>(`/api/v1/posts${qsParams}`)}diff --git a/public/services/markdown.ts b/public/services/markdown.tsindex 32817fccd..92c186a1c 100644--- a/public/services/markdown.ts+++ b/public/services/markdown.ts@@ -52,7 +52,7 @@ fullRenderer.link = linkfullRenderer.text = (text: string) => {// Handling mention links (they're in the format @[name])return text.replace(/@\[(.*?)\]/g, (match, name) => {- return `<span class="text-blue-600">@${name}</span>`+ return `<span class="mention">@${name}</span>`})}