diff --git a/crates/app/src/public/html/profile/posts.html b/crates/app/src/public/html/profile/posts.html
index 7a4f3ed..23d7a6c 100644
--- a/crates/app/src/public/html/profile/posts.html
+++ b/crates/app/src/public/html/profile/posts.html
@@ -1,5 +1,73 @@
{% import "macros.html" as macros %} {% extends "profile/base.html" %} {% block
-content %}
+content %} {% if config.town_square %}
+
{{ icon "clock" }}
diff --git a/crates/app/src/public/html/root.html b/crates/app/src/public/html/root.html
index ff0fe51..7693306 100644
--- a/crates/app/src/public/html/root.html
+++ b/crates/app/src/public/html/root.html
@@ -95,6 +95,7 @@
const atto = ns("atto");
atto.disconnect_observers();
+ atto.remove_false_options();
atto.clean_date_codes();
atto.link_filter();
diff --git a/crates/app/src/public/js/atto.js b/crates/app/src/public/js/atto.js
index 0e3f751..aec59eb 100644
--- a/crates/app/src/public/js/atto.js
+++ b/crates/app/src/public/js/atto.js
@@ -36,10 +36,6 @@ media_theme_pref();
(() => {
const self = reg_ns("atto");
- for (const element of document.querySelectorAll('[selected="false"]')) {
- element.removeAttribute("selected");
- }
-
// init
use("me", () => {});
@@ -74,6 +70,12 @@ media_theme_pref();
});
});
+ self.define("remove_false_options", () => {
+ for (const element of document.querySelectorAll('[selected="false"]')) {
+ element.removeAttribute("selected");
+ }
+ });
+
self.define("rel_date", (_, date) => {
// stolen and slightly modified because js dates suck
const diff = (new Date().getTime() - date.getTime()) / 1000;
diff --git a/crates/core/src/config.rs b/crates/core/src/config.rs
index 36a4917..1b0e5de 100644
--- a/crates/core/src/config.rs
+++ b/crates/core/src/config.rs
@@ -187,6 +187,12 @@ pub struct Config {
/// Configuration for Cloudflare Turnstile.
#[serde(default = "default_turnstile")]
pub turnstile: TurnstileConfig,
+ /// The ID of the "town square" community. This community is required to allow
+ /// people to post from their profiles.
+ ///
+ /// This community **must** have open write access.
+ #[serde(default)]
+ pub town_square: String,
}
fn default_name() -> String {
@@ -261,6 +267,7 @@ impl Default for Config {
banned_usernames: default_banned_usernames(),
policies: default_policies(),
turnstile: default_turnstile(),
+ town_square: String::new(),
}
}
}
diff --git a/example/tetratto.toml b/example/tetratto.toml
index 3f74b30..1ecc882 100644
--- a/example/tetratto.toml
+++ b/example/tetratto.toml
@@ -15,6 +15,7 @@ banned_usernames = [
"post",
"void",
]
+town_square = "166340372315581657"
[security]
registration_enabled = true