mirror of
https://github.com/Nutomic/ibis.git
synced 2024-11-25 20:11:10 +00:00
wip3
This commit is contained in:
parent
68f7f31b8e
commit
f2e2f88dad
5 changed files with 32 additions and 19 deletions
|
@ -88,13 +88,18 @@ pub fn ArticleNav(
|
||||||
</Show>
|
</Show>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-row">
|
<div class="flex flex-row">
|
||||||
<h1 class="text-4xl font-bold font-serif my-4 grow max-w-fit">{title}</h1>
|
<h1 class="text-4xl font-bold font-serif my-6 grow flex-auto">
|
||||||
<Show when=move || protected>
|
{title}
|
||||||
<span title="Article can only be edited by local admins">
|
</h1>
|
||||||
"Protected"
|
<Show when=move || protected>
|
||||||
</span>
|
<span
|
||||||
</Show>
|
class="place-self-center"
|
||||||
</div>
|
title="Article can only be edited by local admins"
|
||||||
|
>
|
||||||
|
"Protected"
|
||||||
|
</span>
|
||||||
|
</Show>
|
||||||
|
</div>
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}}
|
}}
|
||||||
|
|
|
@ -18,8 +18,8 @@ pub fn CredentialsForm(
|
||||||
});
|
});
|
||||||
|
|
||||||
view! {
|
view! {
|
||||||
<form on:submit=|ev| ev.prevent_default()>
|
<form class="form-control max-w-80" on:submit=|ev| ev.prevent_default()>
|
||||||
<p>{title}</p>
|
<h1 class="text-4xl font-bold font-serif my-4 grow max-w-fit">{title}</h1>
|
||||||
{move || {
|
{move || {
|
||||||
error
|
error
|
||||||
.get()
|
.get()
|
||||||
|
@ -44,7 +44,7 @@ pub fn CredentialsForm(
|
||||||
set_username.update(|v| *v = val);
|
set_username.update(|v| *v = val);
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
<div class="h-2"></div>
|
||||||
<input
|
<input
|
||||||
type="password"
|
type="password"
|
||||||
class="input"
|
class="input"
|
||||||
|
@ -71,7 +71,7 @@ pub fn CredentialsForm(
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button
|
||||||
class="btn"
|
class="btn btn-primary my-2"
|
||||||
prop:disabled=move || button_is_disabled.get()
|
prop:disabled=move || button_is_disabled.get()
|
||||||
on:click=move |_| dispatch_action()
|
on:click=move |_| dispatch_action()
|
||||||
>
|
>
|
||||||
|
|
|
@ -23,15 +23,21 @@ pub fn ListArticles() -> impl IntoView {
|
||||||
view! {
|
view! {
|
||||||
<h1 class="text-4xl font-bold font-serif my-4">Most recently edited Articles</h1>
|
<h1 class="text-4xl font-bold font-serif my-4">Most recently edited Articles</h1>
|
||||||
<Suspense fallback=|| view! { "Loading..." }>
|
<Suspense fallback=|| view! { "Loading..." }>
|
||||||
<fieldset on:input=move |ev| {
|
<fieldset
|
||||||
|
class="flex flex-row"
|
||||||
|
on:input=move |ev| {
|
||||||
let val = ev.target().unwrap().unchecked_into::<web_sys::HtmlInputElement>().id();
|
let val = ev.target().unwrap().unchecked_into::<web_sys::HtmlInputElement>().id();
|
||||||
let is_local_only = val == "only-local";
|
let is_local_only = val == "only-local";
|
||||||
set_only_local.update(|p| *p = is_local_only);
|
set_only_local.update(|p| *p = is_local_only);
|
||||||
}>
|
}>
|
||||||
<input type="radio" name="listing-type" class="radio radio-primary" />
|
<label class="label cursor-pointer max-w-32">
|
||||||
<label for="only-local">Only Local</label>
|
<span>Only Local</span>
|
||||||
<input type="radio" name="listing-type" class="radio radio-primary" checked />
|
<input type="radio" name="listing-type" class="radio checked:bg-primary" />
|
||||||
<label for="all">All</label>
|
</label>
|
||||||
|
<label class="label cursor-pointer max-w-32">
|
||||||
|
<span>All</span>
|
||||||
|
<input type="radio" name="listing-type" class="radio checked:bg-primary" checked="checked" />
|
||||||
|
</label>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<ul class="list-disc">
|
<ul class="list-disc">
|
||||||
{move || {
|
{move || {
|
||||||
|
@ -42,7 +48,9 @@ pub fn ListArticles() -> impl IntoView {
|
||||||
.map(|a| {
|
.map(|a| {
|
||||||
view! {
|
view! {
|
||||||
<li>
|
<li>
|
||||||
<a class="link link-secondary" href=article_link(&a)>{article_title(&a)}</a>
|
<a class="link link-secondary" href=article_link(&a)>
|
||||||
|
{article_title(&a)}
|
||||||
|
</a>
|
||||||
</li>
|
</li>
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -43,7 +43,7 @@ pub fn Login() -> impl IntoView {
|
||||||
fallback=move || {
|
fallback=move || {
|
||||||
view! {
|
view! {
|
||||||
<CredentialsForm
|
<CredentialsForm
|
||||||
title="Please enter the desired credentials"
|
title="Login"
|
||||||
action_label="Login"
|
action_label="Login"
|
||||||
action=login_action
|
action=login_action
|
||||||
error=login_error.into()
|
error=login_error.into()
|
||||||
|
|
|
@ -44,7 +44,7 @@ pub fn Register() -> impl IntoView {
|
||||||
fallback=move || {
|
fallback=move || {
|
||||||
view! {
|
view! {
|
||||||
<CredentialsForm
|
<CredentialsForm
|
||||||
title="Please enter the desired credentials"
|
title="Register"
|
||||||
action_label="Register"
|
action_label="Register"
|
||||||
action=register_action
|
action=register_action
|
||||||
error=register_error.into()
|
error=register_error.into()
|
||||||
|
|
Loading…
Reference in a new issue