1
0
Fork 0
mirror of https://github.com/Nutomic/ibis.git synced 2024-12-23 23:01:23 +00:00
This commit is contained in:
Felix Ableitner 2024-10-18 11:58:08 +02:00
parent 68f7f31b8e
commit f2e2f88dad
5 changed files with 32 additions and 19 deletions

View file

@ -88,13 +88,18 @@ pub fn ArticleNav(
</Show>
</div>
<div class="flex flex-row">
<h1 class="text-4xl font-bold font-serif my-4 grow max-w-fit">{title}</h1>
<Show when=move || protected>
<span title="Article can only be edited by local admins">
"Protected"
</span>
</Show>
</div>
<h1 class="text-4xl font-bold font-serif my-6 grow flex-auto">
{title}
</h1>
<Show when=move || protected>
<span
class="place-self-center"
title="Article can only be edited by local admins"
>
"Protected"
</span>
</Show>
</div>
}
})
}}

View file

@ -18,8 +18,8 @@ pub fn CredentialsForm(
});
view! {
<form on:submit=|ev| ev.prevent_default()>
<p>{title}</p>
<form class="form-control max-w-80" on:submit=|ev| ev.prevent_default()>
<h1 class="text-4xl font-bold font-serif my-4 grow max-w-fit">{title}</h1>
{move || {
error
.get()
@ -44,7 +44,7 @@ pub fn CredentialsForm(
set_username.update(|v| *v = val);
}
/>
<div class="h-2"></div>
<input
type="password"
class="input"
@ -71,7 +71,7 @@ pub fn CredentialsForm(
<div>
<button
class="btn"
class="btn btn-primary my-2"
prop:disabled=move || button_is_disabled.get()
on:click=move |_| dispatch_action()
>

View file

@ -23,15 +23,21 @@ pub fn ListArticles() -> impl IntoView {
view! {
<h1 class="text-4xl font-bold font-serif my-4">Most recently edited Articles</h1>
<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 is_local_only = val == "only-local";
set_only_local.update(|p| *p = is_local_only);
}>
<input type="radio" name="listing-type" class="radio radio-primary" />
<label for="only-local">Only Local</label>
<input type="radio" name="listing-type" class="radio radio-primary" checked />
<label for="all">All</label>
<label class="label cursor-pointer max-w-32">
<span>Only Local</span>
<input type="radio" name="listing-type" class="radio checked:bg-primary" />
</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>
<ul class="list-disc">
{move || {
@ -42,7 +48,9 @@ pub fn ListArticles() -> impl IntoView {
.map(|a| {
view! {
<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>
}
})

View file

@ -43,7 +43,7 @@ pub fn Login() -> impl IntoView {
fallback=move || {
view! {
<CredentialsForm
title="Please enter the desired credentials"
title="Login"
action_label="Login"
action=login_action
error=login_error.into()

View file

@ -44,7 +44,7 @@ pub fn Register() -> impl IntoView {
fallback=move || {
view! {
<CredentialsForm
title="Please enter the desired credentials"
title="Register"
action_label="Register"
action=register_action
error=register_error.into()