From 41ee7e41255dec44d057d6cb2738f91312dd1a4a Mon Sep 17 00:00:00 2001 From: trisua Date: Wed, 2 Apr 2025 14:19:37 -0400 Subject: [PATCH] add: better profile card ui --- crates/app/src/public/html/components.html | 23 +++++++++++-------- crates/app/src/public/html/profile/base.html | 8 ++++++- .../src/public/html/profile/followers.html | 2 +- .../src/public/html/profile/following.html | 2 +- crates/app/src/routes/pages/profile.rs | 2 ++ 5 files changed, 25 insertions(+), 12 deletions(-) diff --git a/crates/app/src/public/html/components.html b/crates/app/src/public/html/components.html index 47a7589..e2d28ba 100644 --- a/crates/app/src/public/html/components.html +++ b/crates/app/src/public/html/components.html @@ -24,13 +24,15 @@ loading="lazy" style="--size: {{ size }}" /> -{% endif %} {%- endmacro %} {% macro banner(username) -%} +{% endif %} {%- endmacro %} {% macro banner(username, +border_radius="var(--radius)") -%} {%- endmacro %} {% macro community_banner(id, community=false) -%} {% if community %} @@ -252,14 +254,17 @@ show_community=true) -%} {% if community and show_community %} {%- endmacro %} {% macro user_card(user) -%} - - {{ components::avatar(username=user.username, size="48px") }} -
-

{{ components::username(user=user) }}

- {{ user.username }} +
+
+ {{ components::banner(username=user.username, border_radius="0px") }} +
+ +
+ {{ components::avatar(username=user.username, size="48px") }} +
+ {{ components::username(user=user) }} + {{ components::online_indicator(user=user) }} +
{%- endmacro %} {% macro pagination(page=0, items=0) -%} diff --git a/crates/app/src/public/html/profile/base.html b/crates/app/src/public/html/profile/base.html index 036ed2a..3484347 100644 --- a/crates/app/src/public/html/profile/base.html +++ b/crates/app/src/public/html/profile/base.html @@ -77,7 +77,13 @@ or is_helper %}
Last seen - {{ profile.last_seen }} + +
+ {{ components::online_indicator(user=profile) }} + + {{ profile.last_seen }} + +
{% endif %}
diff --git a/crates/app/src/public/html/profile/followers.html b/crates/app/src/public/html/profile/followers.html index e899a34..8e3233a 100644 --- a/crates/app/src/public/html/profile/followers.html +++ b/crates/app/src/public/html/profile/followers.html @@ -16,7 +16,7 @@ content %} {{ components::user_card(user=item[1]) }} - {% endfor %} + {% endfor %} {{ components::pagination(page=page, items=list|length) }} {% endblock %} diff --git a/crates/app/src/public/html/profile/following.html b/crates/app/src/public/html/profile/following.html index 412336f..806c44f 100644 --- a/crates/app/src/public/html/profile/following.html +++ b/crates/app/src/public/html/profile/following.html @@ -16,7 +16,7 @@ content %} {{ components::user_card(user=item[1]) }} - {% endfor %} + {% endfor %} {{ components::pagination(page=page, items=list|length) }} {% endblock %} diff --git a/crates/app/src/routes/pages/profile.rs b/crates/app/src/routes/pages/profile.rs index e9870fd..22e72d7 100644 --- a/crates/app/src/routes/pages/profile.rs +++ b/crates/app/src/routes/pages/profile.rs @@ -324,6 +324,7 @@ pub async fn following_request( }; context.insert("list", &list); + context.insert("page", &props.page); profile_context( &mut context, &other_user, @@ -450,6 +451,7 @@ pub async fn followers_request( }; context.insert("list", &list); + context.insert("page", &props.page); profile_context( &mut context, &other_user,