diff --git a/Cargo.lock b/Cargo.lock index 64f33fa..987204c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -122,12 +122,6 @@ version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dde20b3d026af13f561bdd0f15edf01fc734f0dafcedbaf42bba506a9517f223" -[[package]] -name = "arc-swap" -version = "1.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" - [[package]] name = "arg_enum_proc_macro" version = "0.3.4" @@ -2852,11 +2846,10 @@ dependencies = [ [[package]] name = "redis" -version = "0.30.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "438a4e5f8e9aa246d6f3666d6978441bf1b37d5f417b50c4dd220be09f5fcc17" +checksum = "0bc1ea653e0b2e097db3ebb5b7f678be339620b8041f66b30a308c1d45d36a7f" dependencies = [ - "arc-swap", "bytes", "cfg-if", "combine", diff --git a/crates/app/Cargo.toml b/crates/app/Cargo.toml index 6a459a8..9c92d8c 100644 --- a/crates/app/Cargo.toml +++ b/crates/app/Cargo.toml @@ -15,7 +15,7 @@ serde = { version = "1.0.219", features = ["derive"] } tera = "1.20.0" tracing = "0.1.41" tracing-subscriber = { version = "0.3.19", features = ["env-filter"] } -tower-http = { version = "0.6.3", features = ["trace", "fs", "catch-panic"] } +tower-http = { version = "0.6.2", features = ["trace", "fs", "catch-panic"] } axum = { version = "0.8.4", features = ["macros", "ws"] } tokio = { version = "1.45.0", features = ["macros", "rt-multi-thread"] } axum-extra = { version = "0.10.1", features = ["cookie", "multipart"] } @@ -35,7 +35,7 @@ cf-turnstile = "0.2.0" contrasted = "0.1.2" futures-util = "0.3.31" -redis = { version = "0.30.0", features = [ +redis = { version = "0.31.0", features = [ "aio", "tokio-comp", ], optional = true } diff --git a/crates/app/src/langs/en-US.toml b/crates/app/src/langs/en-US.toml index dfffe98..f043a73 100644 --- a/crates/app/src/langs/en-US.toml +++ b/crates/app/src/langs/en-US.toml @@ -33,6 +33,9 @@ version = "1.0.0" "general:label.account_banned_body" = "Your account has been banned for violating our policies." "general:label.better_with_account" = "It's better with an account! Login or sign up to explore more." +"general:label.supporter_motivation" = "Become a supporter!" +"general:action.become_supporter" = "Become supporter" + "dialog:action.okay" = "Ok" "dialog:action.continue" = "Continue" "dialog:action.cancel" = "Cancel" @@ -136,6 +139,11 @@ version = "1.0.0" "settings:label.theme_lit" = "Theme lit" "settings:label.import" = "Import" "settings:label.export" = "Export" +"settings:label.manage_blocks" = "Manage blocks" +"settings:label.users" = "Users" +"settings:tab.security" = "Security" +"settings:tab.blocks" = "Blocks" +"settings:tab.billing" = "Billing" "mod_panel:label.open_reported_content" = "Open reported content" "mod_panel:label.manage_profile" = "Manage profile" diff --git a/crates/app/src/public/css/style.css b/crates/app/src/public/css/style.css index 8abff45..4d26a28 100644 --- a/crates/app/src/public/css/style.css +++ b/crates/app/src/public/css/style.css @@ -461,6 +461,39 @@ table ol { border-top-right-radius: 0; } +/* supporter card */ +@property --border-angle { + syntax: ""; + initial-value: 0deg; + inherits: false; +} + +.supporter_ad { + --border-angle: 0deg; + padding: 2px; + background-image: + linear-gradient(var(--color-raised), var(--color-raised)), + repeating-conic-gradient( + from var(--border-angle), + var(--color-primary) 0%, + var(--color-primary-lowered) 50% + ); + background-origin: border-box; + background-clip: content-box, border-box; + animation: 10s rotate_angle linear infinite; + cursor: pointer; +} + +@keyframes rotate_angle { + from { + --border-angle: 0deg; + } + + to { + --border-angle: 360deg; + } +} + /* buttons */ button, .button { diff --git a/crates/app/src/public/html/communities/list.html b/crates/app/src/public/html/communities/list.html index ee15f87..feb2183 100644 --- a/crates/app/src/public/html/communities/list.html +++ b/crates/app/src/public/html/communities/list.html @@ -30,7 +30,9 @@ - {% endif %} + + {% if list|length >= 4 %} {{ components::supporter_ad(body="Become a + supporter to create up to 10 communities!") }} {% endif %} {% endif %}
diff --git a/crates/app/src/public/html/components.html b/crates/app/src/public/html/components.html index c077c5e..0663a7b 100644 --- a/crates/app/src/public/html/components.html +++ b/crates/app/src/public/html/components.html @@ -1242,4 +1242,24 @@ show_kick=false, secondary=false) -%}
+{% endif %} {%- endmacro %} {% macro supporter_ad(body="") -%} {% if +config.stripe and not is_supporter %} +
+
+ {% if body %} + {{ body }} + {% else %} + {{ text "general:label.supporter_motivation" }} + {% endif %} + + + {{ icon "heart" }} + {{ text "general:action.become_supporter" }} + +
+
{% endif %} {%- endmacro %} diff --git a/crates/app/src/public/html/profile/settings.html b/crates/app/src/public/html/profile/settings.html index c267ec7..94872d1 100644 --- a/crates/app/src/public/html/profile/settings.html +++ b/crates/app/src/public/html/profile/settings.html @@ -38,36 +38,24 @@
- {% if config.stripe %} -
-
- {{ icon "star" }} - Supporter status -
+
+ + {{ icon "user-lock" }} + {{ text "settings:tab.security" }} + -
- {% if is_supporter %} -

You are a supporter! Thank you for all that you do. You can manage your billing information below. Please use your email address you supplied when paying to login to the billing portal.

- Manage billing - {% else %} -

You're not currently a supporter! No pressure, but it helps us do some pretty cool things! As a supporter, you'll get:

+ + {{ icon "shield" }} + {{ text "settings:tab.blocks" }} + -
    -
  • Vanity badge on profile
  • -
  • Ability to upload gif avatars/banners
  • -
  • Be an admin/owner of up to 10 communities
  • -
  • Use custom CSS on your profile
  • -
  • Ability to use community emojis outside of their community (soon)
  • -
  • Ability to upload and use gif emojis (soon)
  • -
  • Create infinite stack timelines
  • -
- - Become a supporter - Please use your real email when completing payment. It is required to manage your billing settings. - {% endif %} -
+ {% if config.stripe %} + + {{ icon "credit-card" }} + {{ text "settings:tab.billing" }} + + {% endif %}
- {% endif %}
@@ -153,62 +141,22 @@
- Notifications require you to keep {{ config.name }} open in your browser for real-time updates. This setting does not sync across browsers. + Notifications require you to keep {{ config.name }} + open in your browser for real-time updates. This setting + does not sync across browsers.
-
-
- {{ text "settings:label.change_password" }} -
- -
-
- - -
- -
- - -
- - -
-
-
{{ text "settings:label.change_username" }} @@ -238,63 +186,9 @@
- -
-
- {{ text "settings:label.two_factor_authentication" }} -
- -
- {% if profile.totp|length == 0 %} - - - - {% else %} - - -
- - - -
- {% endif %} -
-
-
+
{{ icon "skull" }} {{ text "settings:label.delete_account" }} @@ -332,8 +226,262 @@
+
+
+ + {{ icon "arrow-left" }} + {{ text "general:action.back" }} + + +
+
+ {{ icon "user-lock" }} + {{ text "settings:tab.security" }} +
+ +
+
+
+ {{ text + "settings:label.two_factor_authentication" }} +
+ +
+ {% if profile.totp|length == 0 %} + + + + {% else %} + + +
+ + + +
+ {% endif %} +
+
+ +
+
+ {{ text "settings:label.change_password" }} +
+ +
+
+ + +
+ +
+ + +
+ + +
+
+
+
+
+
+ +
+
+ + {{ icon "arrow-left" }} + {{ text "general:action.back" }} + + +
+
+ {{ icon "users-round" }} + {{ text "settings:label.users" }} +
+ +
+ {% for user in blocks %} +
+
+ {{ components::avatar(username=user.username) }} {{ + components::full_username(user=user) }} +
+ + + {{ icon "external-link" }} + {{ text "requests:action.view_profile" }} + +
+ {% endfor %} +
+
+
+
+ +
+
+ + {{ icon "arrow-left" }} + {{ text "general:action.back" }} + + +
+
+ {{ icon "credit-card" }} + {{ text "settings:tab.billing" }} +
+ +
+ {% if config.stripe %} +
+
+ {{ icon "star" }} + Supporter status +
+ +
+ {% if is_supporter %} +

+ You are a supporter! Thank you for all + that you do. You can manage your billing + information below. + Please use your email address you supplied + when paying to login to the billing + portal. +

+ Manage billing + {% else %} +

+ You're not currently a supporter! No + pressure, but it helps us do some pretty cool + things! As a supporter, you'll get: +

+ +
    +
  • Vanity badge on profile
  • +
  • No more supporter ads (duh)
  • +
  • Ability to upload gif avatars/banners
  • +
  • + Be an admin/owner of up to 10 communities +
  • +
  • Use custom CSS on your profile
  • +
  • + Ability to use community emojis outside of + their community (soon) +
  • +
  • + Ability to upload and use gif emojis + (soon) +
  • +
  • Create infinite stack timelines
  • +
+ + Become a supporter + + Please use your real email when + completing payment. It is required to manage + your billing settings. + {% endif %} +
+
+ {% endif %} +
+
+
+
+