This commit is contained in:
Felix Ableitner 2024-10-02 14:35:32 +02:00
parent bb892571cb
commit 3e1d2a1d4a
19 changed files with 689 additions and 673 deletions

View File

@ -48,12 +48,16 @@ pub fn ArticleNav(article: Resource<Option<String>, ArticleView>) -> impl IntoVi
}>
<A href=format!("{article_link}/edit")>"Edit"</A>
</Show>
<Show when=move || global_state.with(|state| state.my_profile.is_some())>
<Show when=move || {
global_state.with(|state| state.my_profile.is_some())
}>
<A href=format!("{article_link_}/actions")>"Actions"</A>
{instance
.get()
.map(|i| {
view! { <InstanceFollowButton instance=i.instance.clone()/> }
view! {
<InstanceFollowButton instance=i.instance.clone() />
}
})}
</Show>

View File

@ -63,8 +63,7 @@ pub fn CreateArticle() -> impl IntoView {
let val = event_target_value(&ev);
set_text.update(|p| *p = val);
}
>
</textarea>
></textarea>
<div>
<a href="https://commonmark.org/help/" target="blank_">
Markdown
@ -90,7 +89,9 @@ pub fn CreateArticle() -> impl IntoView {
<button
prop:disabled=move || button_is_disabled.get()
on:click=move |_| submit_action.dispatch((title.get(), text.get(), summary.get()))
on:click=move |_| {
submit_action.dispatch((title.get(), text.get(), summary.get()))
}
>
Submit
</button>

View File

@ -25,7 +25,9 @@ pub fn ReadArticle() -> impl IntoView {
view! {
<div class="item-view">
<h1>{article_title(&article.article)}</h1>
<div inner_html=parser.parse(&article.article.text).render()></div>
<div inner_html=parser
.parse(&article.article.text)
.render()></div>
</div>
}
})

View File

@ -18,10 +18,16 @@ pub fn Conflicts() -> impl IntoView {
.map(|c| {
c.into_iter()
.map(|c| {
let link = format!("{}/edit/{}", article_link(&c.article), c.id);
let link = format!(
"{}/edit/{}",
article_link(&c.article),
c.id,
);
view! {
<li>
<a href=link>{article_title(&c.article)} " - " {c.summary}</a>
<a href=link>
{article_title(&c.article)} " - " {c.summary}
</a>
</li>
}
})

View File

@ -31,10 +31,14 @@ pub fn InstanceDetails() -> impl IntoView {
view! {
<h1>{instance.domain}</h1>
<Show when=move || global_state.with(|state| state.my_profile.is_some())>
<Show when=move || {
global_state.with(|state| state.my_profile.is_some())
}>
<InstanceFollowButton instance=instance_.clone() />
</Show>
<p>Follow the instance so that new edits are federated to your instance.</p>
<p>
Follow the instance so that new edits are federated to your instance.
</p>
<p>
"TODO: show a list of articles from the instance. For now you can use the "
<a href="/article/list">Article list</a>.

View File

@ -93,8 +93,7 @@ pub fn Search() -> impl IntoView {
]
} else {
vec![]
}}
// render articles from resolve/search
}} // render articles from resolve/search
{search_results
.articles
.iter()