diff --git a/crates/app/src/assets.rs b/crates/app/src/assets.rs index bdbd1ba..6263118 100644 --- a/crates/app/src/assets.rs +++ b/crates/app/src/assets.rs @@ -40,6 +40,8 @@ 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"); +pub const COMMUNITIES_LIST: &str = include_str!("./public/html/communities/list.html"); + // langs pub const LANG_EN_US: &str = include_str!("./langs/en-US.toml"); @@ -145,6 +147,8 @@ pub(crate) async fn write_assets(config: &Config) -> PathBufD { 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); + write_template!(html_path->"communities/list.html"(crate::assets::COMMUNITIES_LIST) -d "communities" --config=config); + html_path } @@ -179,7 +183,11 @@ pub(crate) async fn init_dirs(config: &Config) { pub(crate) static CACHE_BREAKER: LazyLock = LazyLock::new(|| salt()); /// Create the initial template context. -pub(crate) fn initial_context(config: &Config, lang: &LangFile, user: &Option) -> Context { +pub(crate) async fn initial_context( + config: &Config, + lang: &LangFile, + user: &Option, +) -> Context { let mut ctx = Context::new(); ctx.insert("config", &config); ctx.insert("user", &user); diff --git a/crates/app/src/langs/en-US.toml b/crates/app/src/langs/en-US.toml index 192da93..d34aee8 100644 --- a/crates/app/src/langs/en-US.toml +++ b/crates/app/src/langs/en-US.toml @@ -3,6 +3,7 @@ version = "1.0.0" [data] "general:link.home" = "Home" +"general:link.communities" = "Communities" "dialog:action.okay" = "Ok" "dialog:action.continue" = "Continue" @@ -13,8 +14,14 @@ version = "1.0.0" "auth:action.login" = "Login" "auth:action.register" = "Register" "auth:action.logout" = "Logout" +"auto:action.follow" = "Follow" +"auto:action.unfollow" = "Unfollow" "auth:link.my_profile" = "My profile" "auth:link.settings" = "Settings" "auth:label.followers" = "Followers" "auth:label.following" = "Following" "auth:label.joined_journals" = "Joined Journals" + +"communities:action.create" = "Create" +"communities:label.create_new" = "Create new community" +"communities:label.name" = "Name" diff --git a/crates/app/src/public/html/communities/list.html b/crates/app/src/public/html/communities/list.html new file mode 100644 index 0000000..9b04419 --- /dev/null +++ b/crates/app/src/public/html/communities/list.html @@ -0,0 +1,30 @@ +{% import "macros.html" as macros %} {% extends "root.html" %} {% block head %} +My communities - {{ config.name }} +{% endblock %} {% block body %} {{ macros::nav(selected="communities") }} +
+
+
+ {{ text "communities:label.create_new" }} +
+ +
+
+ + +
+ + +
+
+
+{% endblock %} diff --git a/crates/app/src/public/html/macros.html b/crates/app/src/public/html/macros.html index 7708677..591ed39 100644 --- a/crates/app/src/public/html/macros.html +++ b/crates/app/src/public/html/macros.html @@ -14,11 +14,29 @@ {{ icon "house" }} {{ text "general:link.home" }} + + + {{ icon "book-heart" }} + {{ text "general:link.communities" }} + {% endif %}