From 4b9f9ba0b4995d8280b74b015438df7f4757445d Mon Sep 17 00:00:00 2001
From: alemi
Date: Sun, 21 Jul 2024 15:06:22 +0200
Subject: [PATCH] feat(web): user fields
not ultra pretty but at least they show now
---
web/Cargo.toml | 2 +-
web/index.html | 7 +++++++
web/src/actors/header.rs | 11 +++++++++++
3 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/web/Cargo.toml b/web/Cargo.toml
index 229de4c..98c45b2 100644
--- a/web/Cargo.toml
+++ b/web/Cargo.toml
@@ -28,7 +28,7 @@ leptos = { version = "0.6", features = ["csr", "tracing"] }
leptos_router = { version = "0.6", features = ["csr"] }
leptos-use = { version = "0.10", features = ["serde"] }
reqwest = { version = "0.12", features = ["json"] }
-apb = { path = "../apb", features = ["unstructured", "activitypub-fe", "activitypub-counters", "litepub"] }
+apb = { path = "../apb", features = ["unstructured", "activitypub-fe", "activitypub-counters", "litepub", "did-core"] }
uriproxy = { path = "../utils/uriproxy/" }
mdhtml = { path = "../utils/mdhtml/" }
futures = "0.3.30"
diff --git a/web/index.html b/web/index.html
index eeadde5..71343af 100644
--- a/web/index.html
+++ b/web/index.html
@@ -103,6 +103,13 @@
table.align {
max-width: 100%;
}
+ table.fields,
+ table.fields tr,
+ table.fields td
+ {
+ border: 1px solid var(--background-dim);
+ word-wrap: break-word;
+ }
span.footer {
padding: .1em;
font-size: .6em;
diff --git a/web/src/actors/header.rs b/web/src/actors/header.rs
index f5282f0..ecb739f 100644
--- a/web/src/actors/header.rs
+++ b/web/src/actors/header.rs
@@ -46,6 +46,14 @@ pub fn ActorHeader() -> impl IntoView {
let actor_type_tag = if actor_type == apb::ActorType::Person { None } else {
Some(view! { "["{actor_type.as_ref().to_lowercase()}"]" } )
};
+ let fields = actor.attachment()
+ .map(|x| view! {
+
+ {x.name().str().unwrap_or_default()} |
+ |
+
+ })
+ .collect_view();
let uid = actor.id().unwrap_or_default().to_string();
let web_path = Uri::web(U::Actor, &uid);
let _uid = uid.clone();
@@ -105,6 +113,9 @@ pub fn ActorHeader() -> impl IntoView {
+
+
+
}.into_view()