-
{article_title(&article.article)}
-
-
- })
+ move || {
+ article
+ .get()
+ .map(|article| {
+ view! {
+
+
{article_title(&article.article)}
+
+
+ }
+ })
+ }
}
-
+
+
}
}
diff --git a/src/frontend/pages/conflicts.rs b/src/frontend/pages/conflicts.rs
index f162a1b..7412b1b 100644
--- a/src/frontend/pages/conflicts.rs
+++ b/src/frontend/pages/conflicts.rs
@@ -9,16 +9,27 @@ pub fn Conflicts() -> impl IntoView {
);
view! {
-
Your unresolved edit conflicts
-
-
-
+
Your unresolved edit conflicts
+
+
+ {move || {
+ conflicts
+ .get()
+ .map(|c| {
+ c.into_iter()
+ .map(|c| {
+ let link = format!("{}/edit/{}", article_link(&c.article), c.id);
+ view! {
+ -
+ {article_title(&c.article)} " - " {c.summary}
+
+ }
+ })
+ .collect::>()
+ })
+ }}
+
+
+
}
}
diff --git a/src/frontend/pages/diff.rs b/src/frontend/pages/diff.rs
index 6f0dcac..5adae3b 100644
--- a/src/frontend/pages/diff.rs
+++ b/src/frontend/pages/diff.rs
@@ -8,26 +8,36 @@ pub fn EditDiff() -> impl IntoView {
let article = article_resource();
view! {
-
- {
- move || article.get().map(|article| {
- let hash = params
- .get_untracked()
- .get("hash")
- .cloned().unwrap();
- let edit = article.edits.iter().find(|e| e.edit.hash.0.to_string() == hash).unwrap();
- let label = format!("{} ({})", edit.edit.summary, edit.edit.created.to_rfc2822());
-
- view! {
-
+
+
+ {move || {
+ article
+ .get()
+ .map(|article| {
+ let hash = params.get_untracked().get("hash").cloned().unwrap();
+ let edit = article
+ .edits
+ .iter()
+ .find(|e| e.edit.hash.0.to_string() == hash)
+ .unwrap();
+ let label = format!(
+ "{} ({})",
+ edit.edit.summary,
+ edit.edit.created.to_rfc2822(),
+ );
+ view! {
+
{article.article.title.replace('_', " ")}
{label}
-
"by "{user_link(&edit.creator)}
+
"by " {user_link(&edit.creator)}
{edit.edit.diff.clone()}
-
- }
- })
- }
-
+
+ }
+ })
+ }}
+
+
}
}
diff --git a/src/frontend/pages/instance_details.rs b/src/frontend/pages/instance_details.rs
index f23f187..6c57bc6 100644
--- a/src/frontend/pages/instance_details.rs
+++ b/src/frontend/pages/instance_details.rs
@@ -20,22 +20,32 @@ pub fn InstanceDetails() -> impl IntoView {
});
view! {
- {
- move || instance_profile.get().map(|instance: DbInstance| {
- let instance_ = instance.clone();
- view! {
- {instance.domain}
+
+ {move || {
+ instance_profile
+ .get()
+ .map(|instance: DbInstance| {
+ let instance_ = instance.clone();
+ view! {
+ {instance.domain}
-
-
-
- Follow the instance so that new edits are federated to your instance.
- "TODO: show a list of articles from the instance. For now you can use the "Article list.
-
- "Description:"
- {instance.description}
- }
- })
- }
+
+
+
+ Follow the instance so that new edits are federated to your instance.
+
+ "TODO: show a list of articles from the instance. For now you can use the "
+ Article list .
+
+
+ "Description:"
+ {instance.description}
+ }
+ })
+ }}
+
+
}
}
diff --git a/src/frontend/pages/login.rs b/src/frontend/pages/login.rs
index 08385d3..d8a28f6 100644
--- a/src/frontend/pages/login.rs
+++ b/src/frontend/pages/login.rs
@@ -38,21 +38,22 @@ pub fn Login() -> impl IntoView {
let disabled = Signal::derive(move || wait_for_response.get());
view! {
-
- }
+
}
- >
-
-
+ }
+ >
+
+
+
}
}
diff --git a/src/frontend/pages/register.rs b/src/frontend/pages/register.rs
index 9735814..4eed653 100644
--- a/src/frontend/pages/register.rs
+++ b/src/frontend/pages/register.rs
@@ -39,21 +39,22 @@ pub fn Register() -> impl IntoView {
let disabled = Signal::derive(move || wait_for_response.get());
view! {
-
- }
+
}
- >
- "You have successfully registered."
-
+ }
+ >
+
+ "You have successfully registered."
+
}
}
diff --git a/src/frontend/pages/search.rs b/src/frontend/pages/search.rs
index a470ae9..eccdf2a 100644
--- a/src/frontend/pages/search.rs
+++ b/src/frontend/pages/search.rs
@@ -52,45 +52,67 @@ pub fn Search() -> impl IntoView {
});
view! {
- "Search results for "{query}
- {
- move || search_results.get().map(move |search_results| {
- let is_empty = search_results.is_empty();
- view! {
- {err} }
- })
- };
+ "Search results for " {query}
+
+ {move || {
+ search_results
+ .get()
+ .map(move |search_results| {
+ let is_empty = search_results.is_empty();
view! {
- {error_view}
- No results found
- }}>
-
- {
- // render resolved instance
- if let Some(instance) = &search_results.instance {
- let domain = &instance.domain;
- vec![view! { -
- {domain}
-
}]
- } else { vec![] }
+ {err} }
+ })
+ };
+ view! {
+ {error_view}
+ No results found
+ }
}
- {
- // render articles from resolve/search
- search_results.articles
- .iter()
- .map(|a| view! { -
- {article_title(a)}
-
})
- .collect::>()
- }
-
-
- }})
- }
-
+ >
+
+
+
+ // render resolved instance
+ {if let Some(instance) = &search_results.instance {
+ let domain = &instance.domain;
+ vec![
+ view! {
+ -
+ {domain}
+
+ },
+ ]
+ } else {
+ vec![]
+ }}
+ // render articles from resolve/search
+ {search_results
+ .articles
+ .iter()
+ .map(|a| {
+ view! {
+ -
+ {article_title(a)}
+
+ }
+ })
+ .collect::>()}
+
+
+
+ }
+ })
+ }}
+
+
}
}
diff --git a/src/frontend/pages/user_profile.rs b/src/frontend/pages/user_profile.rs
index 2e940da..ca7a36e 100644
--- a/src/frontend/pages/user_profile.rs
+++ b/src/frontend/pages/user_profile.rs
@@ -22,20 +22,28 @@ pub fn UserProfile() -> impl IntoView {
});
view! {
+ {move || {
+ error
+ .get()
+ .map(|err| {
+ view! { {err}
}
+ })
+ }}
+
+
{move || {
- error
+ user_profile
.get()
- .map(|err| {
- view! { {err}
}
+ .map(|person: DbPerson| {
+ view! {
+ {user_title(&person)}
+ TODO: create actual user profile
+ }
})
}}
- {
- move || user_profile.get().map(|person: DbPerson| {
- view! {
- {user_title(&person)}
- TODO: create actual user profile
- }
- })
- }
+
+
}
}
diff --git a/src/main.rs b/src/main.rs
index f010d12..b4a3743 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -28,6 +28,6 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once();
mount_to_body(|| {
- view! { }
+ view! { }
});
}