From 077e9252e3ad3e07700f1685130df28483948f39 Mon Sep 17 00:00:00 2001 From: trisua Date: Fri, 8 Aug 2025 21:05:56 -0400 Subject: [PATCH] add: hide_username_badges --- crates/app/src/public/html/components.lisp | 4 ++-- crates/app/src/public/html/economy/wallet.lisp | 8 +++++++- crates/app/src/public/html/profile/settings.lisp | 8 ++++++++ crates/core/src/model/auth.rs | 3 +++ 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/crates/app/src/public/html/components.lisp b/crates/app/src/public/html/components.lisp index f61433e..7115bee 100644 --- a/crates/app/src/public/html/components.lisp +++ b/crates/app/src/public/html/components.lisp @@ -107,7 +107,7 @@ (text "{% else %}") (text "{{ self::username(user=user) }}") (text "{%- endif %}")) - (text "{{ self::online_indicator(user=user) }} {% if user.is_verified -%}") + (text "{{ self::online_indicator(user=user) }} {% if not user.settings.hide_username_badges -%} {% if user.is_verified -%}") (span ("title" "Verified") ("style" "color: var(--color-primary)") @@ -131,7 +131,7 @@ ("style" "color: var(--color-primary);") ("class" "flex items_center") (text "{{ icon \"shield-user\" }}")) - (text "{%- endif %}")) + (text "{%- endif %} {%- endif %}")) (text "{%- endif %} {%- endmacro %} {% macro repost(repost, post, owner, secondary=false, community=false, show_community=true, can_manage_post=false) -%}") (div ("style" "display: contents") diff --git a/crates/app/src/public/html/economy/wallet.lisp b/crates/app/src/public/html/economy/wallet.lisp index 0fb5b92..5458233 100644 --- a/crates/app/src/public/html/economy/wallet.lisp +++ b/crates/app/src/public/html/economy/wallet.lisp @@ -11,7 +11,13 @@ (span ("class" "flex items_center gap_2") (icon (text "piggy-bank")) - (span (str (text "general:link.wallet"))))) + (span (str (text "general:link.wallet")))) + + (button + ("class" "lowered small square tiny big_icon") + ("onclick" "document.getElementById('buy_dialog').showModal()") + ("title" "Buy coins") + (icon (text "plus")))) (div ("class" "card lowered flex flex_col gap_4") (button diff --git a/crates/app/src/public/html/profile/settings.lisp b/crates/app/src/public/html/profile/settings.lisp index 0356283..4150508 100644 --- a/crates/app/src/public/html/profile/settings.lisp +++ b/crates/app/src/public/html/profile/settings.lisp @@ -1906,6 +1906,14 @@ \"{{ profile.settings.hide_social_follows }}\", \"checkbox\", ], + [ + [ + \"hide_username_badges\", + \"Hide badges from your username (outside of your profile)\", + ], + \"{{ profile.settings.hide_username_badges }}\", + \"checkbox\", + ], [[], \"Questions\", \"title\"], [ [ diff --git a/crates/core/src/model/auth.rs b/crates/core/src/model/auth.rs index afd6aa1..f63db1f 100644 --- a/crates/core/src/model/auth.rs +++ b/crates/core/src/model/auth.rs @@ -362,6 +362,9 @@ pub struct UserSettings { /// If your profile has the "Shop" tab enabled. #[serde(default)] pub enable_shop: bool, + /// Hide all badges from your username (everywhere but on profile). + #[serde(default)] + pub hide_username_badges: bool, } fn mime_avif() -> String {