Masque le choix d'icône à la création d'un article

Un nouvel article prend le panier ; l'icône reste modifiable depuis
l'éditeur de l'article.

Closes #4

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Romulus21andClaude Opus 5.5 committed 2026-11-01 16:14:41 +01:00
1 parent a34e86dea6
commit 444319f9a5
1 file changed
+39 -33
+39 -33
View File
@@ -184,39 +184,45 @@ fn ItemForm(editor: ItemEditor, list_id: i64) -> impl IntoView {
</div> </div>
</fieldset> </fieldset>
<fieldset class="flex flex-col gap-1.5"> // New items keep the basket: the icon can be changed when editing.
<legend class="mb-1.5 font-mono text-xs tracking-[0.2em] text-ink/60 uppercase"> {item_id
"Icône" .map(|_| {
</legend> view! {
<div class="grid grid-cols-6 gap-2"> <fieldset class="flex flex-col gap-1.5">
{Icon::ALL <legend class="mb-1.5 font-mono text-xs tracking-[0.2em] text-ink/60 uppercase">
.iter() "Icône"
.map(|&i| { </legend>
view! { <div class="grid grid-cols-6 gap-2">
<button {Icon::ALL
type="button" .iter()
class=move || { .map(|&i| {
format!( view! {
"grid aspect-square place-items-center rounded-xl border-2 {}", <button
if icon.get() == i { type="button"
"border-ink bg-lime" class=move || {
} else { format!(
"border-ink/10 bg-mist" "grid aspect-square place-items-center rounded-xl border-2 {}",
}, if icon.get() == i {
) "border-ink bg-lime"
} } else {
title=icon_label(i) "border-ink/10 bg-mist"
aria-label=icon_label(i) },
aria-pressed=move || (icon.get() == i).to_string() )
on:click=move |_| icon.set(i) }
> title=icon_label(i)
<IconSvg icon=i class="size-7" /> aria-label=icon_label(i)
</button> aria-pressed=move || (icon.get() == i).to_string()
} on:click=move |_| icon.set(i)
}) >
.collect_view()} <IconSvg icon=i class="size-7" />
</div> </button>
</fieldset> }
})
.collect_view()}
</div>
</fieldset>
}
})}
<div class="flex gap-3"> <div class="flex gap-3">
{item_id {item_id