1
0
Fork 0
mirror of https://github.com/Nutomic/ibis.git synced 2024-11-22 09:21:09 +00:00

Another run.

This commit is contained in:
Dessalines 2024-03-29 09:51:52 -04:00
parent 804d64f0a2
commit f35a8d2592
8 changed files with 20 additions and 9 deletions

View file

@ -55,6 +55,7 @@ pub fn Nav() -> impl IntoView {
set_search_query.update(|v| *v = val); set_search_query.update(|v| *v = val);
} }
/> />
<button>Go</button> <button>Go</button>
</form> </form>
</li> </li>

View file

@ -95,12 +95,14 @@ pub fn ArticleActions() -> impl IntoView {
set_new_title.update(|v| *v = val); set_new_title.update(|v| *v = val);
} }
/> />
<button <button
disabled=move || new_title.get().is_empty() disabled=move || new_title.get().is_empty()
on:click=move |_| { on:click=move |_| {
fork_action.dispatch((article.article.id, new_title.get())) fork_action.dispatch((article.article.id, new_title.get()))
} }
> >
Fork Article Fork Article
</button> </button>
<p> <p>

View file

@ -63,7 +63,8 @@ pub fn CreateArticle() -> impl IntoView {
let val = event_target_value(&ev); let val = event_target_value(&ev);
set_text.update(|p| *p = val); set_text.update(|p| *p = val);
} }
></textarea> >
</textarea>
<div> <div>
<a href="https://commonmark.org/help/" target="blank_"> <a href="https://commonmark.org/help/" target="blank_">
Markdown Markdown
@ -86,6 +87,7 @@ pub fn CreateArticle() -> impl IntoView {
set_summary.update(|p| *p = val); set_summary.update(|p| *p = val);
} }
/> />
<button <button
prop:disabled=move || button_is_disabled.get() 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()))
@ -96,6 +98,7 @@ pub fn CreateArticle() -> impl IntoView {
} }
} }
> >
<Redirect path=format!("/article/{}", title.get().replace(' ', "_"))/> <Redirect path=format!("/article/{}", title.get().replace(' ', "_"))/>
</Show> </Show>
} }

View file

@ -149,6 +149,7 @@ pub fn EditArticle() -> impl IntoView {
set_summary.update(|p| *p = val); set_summary.update(|p| *p = val);
} }
/> />
<button <button
prop:disabled=move || button_is_disabled.get() prop:disabled=move || button_is_disabled.get()
on:click=move |_| { on:click=move |_| {
@ -161,6 +162,7 @@ pub fn EditArticle() -> impl IntoView {
)) ))
} }
> >
Submit Submit
</button> </button>
</div> </div>
@ -172,6 +174,7 @@ pub fn EditArticle() -> impl IntoView {
} }
} }
> >
Edit successful! Edit successful!
</Show> </Show>
} }

View file

@ -38,8 +38,7 @@ pub fn ListArticles() -> impl IntoView {
articles articles
.get() .get()
.map(|a| { .map(|a| {
a a.into_iter()
.into_iter()
.map(|a| { .map(|a| {
view! { view! {
<li> <li>
@ -50,6 +49,7 @@ pub fn ListArticles() -> impl IntoView {
.collect::<Vec<_>>() .collect::<Vec<_>>()
}) })
}} }}
</ul> </ul>
</Suspense> </Suspense>
} }

View file

@ -15,6 +15,7 @@ pub fn ReadArticle() -> impl IntoView {
<Suspense fallback=|| { <Suspense fallback=|| {
view! { "Loading..." } view! { "Loading..." }
}> }>
{ {
let parser = markdown_parser(); let parser = markdown_parser();
move || { move || {

View file

@ -16,8 +16,7 @@ pub fn Conflicts() -> impl IntoView {
conflicts conflicts
.get() .get()
.map(|c| { .map(|c| {
c c.into_iter()
.into_iter()
.map(|c| { .map(|c| {
let link = format!("{}/edit/{}", article_link(&c.article), c.id); let link = format!("{}/edit/{}", article_link(&c.article), c.id);
view! { view! {
@ -29,6 +28,7 @@ pub fn Conflicts() -> impl IntoView {
.collect::<Vec<_>>() .collect::<Vec<_>>()
}) })
}} }}
</ul> </ul>
</Suspense> </Suspense>
} }

View file

@ -78,10 +78,11 @@ pub fn Search() -> impl IntoView {
} }
} }
> >
<ul> <ul>
{// render resolved instance // render resolved instance
if let Some(instance) = &search_results.instance { {if let Some(instance) = &search_results.instance {
let domain = &instance.domain; let domain = &instance.domain;
vec![ vec![
view! { view! {
@ -93,8 +94,8 @@ pub fn Search() -> impl IntoView {
} else { } else {
vec![] vec![]
}} }}
{// render articles from resolve/search // render articles from resolve/search
search_results {search_results
.articles .articles
.iter() .iter()
.map(|a| { .map(|a| {