diff --git a/crates/app/src/assets.rs b/crates/app/src/assets.rs index 98a0479..36b86ec 100644 --- a/crates/app/src/assets.rs +++ b/crates/app/src/assets.rs @@ -200,7 +200,7 @@ pub(crate) async fn init_dirs(config: &Config) { } /// A random ASCII value inserted into the URL of static assets to "break" the cache. Essentially just for cache busting. -pub(crate) static CACHE_BREAKER: LazyLock = LazyLock::new(|| salt()); +pub(crate) static CACHE_BREAKER: LazyLock = LazyLock::new(salt); /// Create the initial template context. pub(crate) async fn initial_context( diff --git a/crates/app/src/langs/en-US.toml b/crates/app/src/langs/en-US.toml index 0527138..3ec9cc4 100644 --- a/crates/app/src/langs/en-US.toml +++ b/crates/app/src/langs/en-US.toml @@ -28,6 +28,7 @@ version = "1.0.0" "auth:label.recent_posts" = "Recent posts" "communities:action.create" = "Create" +"communities:action.select" = "Select" "communities:label.create_new" = "Create new community" "communities:label.name" = "Name" "communities:action.join" = "Join" @@ -39,6 +40,9 @@ version = "1.0.0" "communities:label.create_reply" = "Create reply" "communities:label.replies" = "Replies" "communities:action.continue_thread" = "Continue thread" +"communities:tab.members" = "Members" +"communities:label.select_member" = "Select member" +"communities:label.user_id" = "User ID" "notifs:action.mark_as_read" = "Mark as read" "notifs:action.mark_as_unread" = "Mark as unread" diff --git a/crates/app/src/macros.rs b/crates/app/src/macros.rs index 2c537c2..94c5404 100644 --- a/crates/app/src/macros.rs +++ b/crates/app/src/macros.rs @@ -7,7 +7,7 @@ macro_rules! write_template { ($into:ident->$path:literal($as:expr) --config=$config:ident) => { std::fs::write( $into.join($path), - crate::assets::replace_in_html($as, &$config).await, + $crate::assets::replace_in_html($as, &$config).await, ) .unwrap(); }; @@ -29,7 +29,7 @@ macro_rules! write_template { std::fs::write( $into.join($path), - crate::assets::replace_in_html($as, &$config).await, + $crate::assets::replace_in_html($as, &$config).await, ) .unwrap(); }; diff --git a/crates/app/src/main.rs b/crates/app/src/main.rs index 29def3a..aa351da 100644 --- a/crates/app/src/main.rs +++ b/crates/app/src/main.rs @@ -17,7 +17,7 @@ use tokio::sync::RwLock; pub(crate) type State = Arc>; fn render_markdown(value: &Value, _: &HashMap) -> tera::Result { - Ok(tetratto_shared::markdown::render_markdown(&value.as_str().unwrap()).into()) + Ok(tetratto_shared::markdown::render_markdown(value.as_str().unwrap()).into()) } #[tokio::main] diff --git a/crates/app/src/public/html/communities/base.html b/crates/app/src/public/html/communities/base.html index 2ebbfaa..31b9d33 100644 --- a/crates/app/src/public/html/communities/base.html +++ b/crates/app/src/public/html/communities/base.html @@ -29,16 +29,63 @@ {% if user %}
- {% if not is_owner %} {% if not is_member %} - + + {% else %} - + + {% endif %} {% else %} ID
+
+ Members + {{ community.member_count }} +
+
Score
diff --git a/crates/app/src/public/html/communities/feed.html b/crates/app/src/public/html/communities/feed.html index 9175ef5..4bc2300 100644 --- a/crates/app/src/public/html/communities/feed.html +++ b/crates/app/src/public/html/communities/feed.html @@ -1,7 +1,7 @@ {% import "macros.html" as macros %} {% import "components.html" as components %} {% extends "communities/base.html" %} {% block content %}
- {% if user %} + {% if user and can_post %}
-
-
+
+
Read access @@ -30,7 +34,7 @@
- Write access + Post permission
@@ -42,6 +46,18 @@
+ +
+ + + + {{ icon "arrow-left" }} + {{ text "general:action.back" }} + +
-
- + + +