diff --git a/crates/app/src/assets.rs b/crates/app/src/assets.rs index 27f8400..4fb39c8 100644 --- a/crates/app/src/assets.rs +++ b/crates/app/src/assets.rs @@ -36,6 +36,9 @@ pub const AUTH_BASE: &str = include_str!("./public/html/auth/base.html"); pub const AUTH_LOGIN: &str = include_str!("./public/html/auth/login.html"); pub const AUTH_REGISTER: &str = include_str!("./public/html/auth/register.html"); +pub const PROFILE_BASE: &str = include_str!("./public/html/profile/base.html"); +pub const PROFILE_POSTS: &str = include_str!("./public/html/profile/posts.html"); + // langs pub const LANG_EN_US: &str = include_str!("./langs/en-US.toml"); @@ -137,6 +140,9 @@ pub(crate) async fn write_assets(config: &Config) -> PathBufD { write_template!(html_path->"auth/login.html"(crate::assets::AUTH_LOGIN) --config=config); write_template!(html_path->"auth/register.html"(crate::assets::AUTH_REGISTER) --config=config); + write_template!(html_path->"profile/base.html"(crate::assets::PROFILE_BASE) -d "profile" --config=config); + write_template!(html_path->"profile/posts.html"(crate::assets::PROFILE_POSTS) --config=config); + html_path } diff --git a/crates/app/src/langs/en-US.toml b/crates/app/src/langs/en-US.toml index 17279ec..192da93 100644 --- a/crates/app/src/langs/en-US.toml +++ b/crates/app/src/langs/en-US.toml @@ -15,3 +15,6 @@ version = "1.0.0" "auth:action.logout" = "Logout" "auth:link.my_profile" = "My profile" "auth:link.settings" = "Settings" +"auth:label.followers" = "Followers" +"auth:label.following" = "Following" +"auth:label.joined_journals" = "Joined Journals" diff --git a/crates/app/src/public/css/style.css b/crates/app/src/public/css/style.css index ef37f2c..574e165 100644 --- a/crates/app/src/public/css/style.css +++ b/crates/app/src/public/css/style.css @@ -88,6 +88,10 @@ footer { padding: 0.75rem 1rem; } +article { + margin-top: 1rem; +} + @media screen and (max-width: 900px) { main, article, @@ -96,6 +100,10 @@ footer { footer { width: 100%; } + + article { + margin-top: 0; + } } .content_container { @@ -135,6 +143,8 @@ footer { svg.icon { stroke: currentColor; width: 18px; + width: 1em; + height: 1em; } svg.icon.filled { @@ -360,6 +370,14 @@ button, font-weight: 600; } +button.small, +.button.small { + min-height: max-content; + padding: 0.25rem; + height: 24px; + font-size: 16px; +} + button:hover, .button:hover { background: var(--color-primary-lowered); @@ -490,6 +508,15 @@ select:focus { padding: 0; } +/* chip */ +.chip { + background: var(--color-primary); + color: var(--color-text-primary); + font-weight: 600; + border-radius: var(--circle); + padding: 0.05rem 0.75rem; +} + /* nav */ nav { background: var(--color-primary); @@ -1041,6 +1068,7 @@ details.accordion .inner { .sm\:w-full { width: 100% !important; + min-width: 100% !important; } .sm\:mt-2 { diff --git a/crates/app/src/public/html/macros.html b/crates/app/src/public/html/macros.html index c7b70cc..7708677 100644 --- a/crates/app/src/public/html/macros.html +++ b/crates/app/src/public/html/macros.html @@ -33,7 +33,7 @@
{{ user.username }} - + {{ icon "book-heart" }} {{ text "auth:link.my_profile" }} diff --git a/crates/app/src/public/html/misc/index.html b/crates/app/src/public/html/misc/index.html index e89bf38..7bc5ead 100644 --- a/crates/app/src/public/html/misc/index.html +++ b/crates/app/src/public/html/misc/index.html @@ -1,6 +1,5 @@ {% import "macros.html" as macros %} {% extends "root.html" %} {% block body %} {{ macros::nav(selected="home") }} -
diff --git a/crates/app/src/public/html/profile/base.html b/crates/app/src/public/html/profile/base.html new file mode 100644 index 0000000..dc37db5 --- /dev/null +++ b/crates/app/src/public/html/profile/base.html @@ -0,0 +1,80 @@ +{% import "macros.html" as macros %} {% extends "root.html" %} {% block head %} +{{ profile.username }} - {{ config.name }} +{% endblock %} {% block body %} {{ macros::nav() }} +
+
+
+
+
+
+ {{ macros::avatar(username=profile.username,size="72px") + }} +
+

+ {% if profile.settings.display_name %} {{ + profile.settings.display_name }} {% else %} {{ + profile.username }} {% endif %} +

+ + {{ profile.username }} +
+
+ +
+
+

{{ profile.follower_count }}

+ {{ text "auth:label.followers" }} +
+
+

{{ profile.following_count }}

+ {{ text "auth:label.following" }} +
+
+
+ +
+
+ {{ profile.settings.biography }} +
+ +
+
+ ID + +
+ +
+ Joined + {{ profile.created }} +
+
+
+ +
+
+ {{ icon "users-round" }} + {{ text "auth:label.joined_journals" }} +
+ +
+
+
+ +
{% block content %}{% endblock %}
+
+
+
+{% endblock %} diff --git a/crates/app/src/public/html/profile/posts.html b/crates/app/src/public/html/profile/posts.html new file mode 100644 index 0000000..43b93eb --- /dev/null +++ b/crates/app/src/public/html/profile/posts.html @@ -0,0 +1,2 @@ +{% import "macros.html" as macros %} {% extends "profile/base.html" %} {% block +content %}{% endblock %} diff --git a/crates/app/src/public/html/root.html b/crates/app/src/public/html/root.html index c6183d1..a32ed39 100644 --- a/crates/app/src/public/html/root.html +++ b/crates/app/src/public/html/root.html @@ -56,7 +56,9 @@
- {% block body %}{% endblock %} +
+ {% block body %}{% endblock %} +