Display the ingredient form in shopping list

This commit is contained in:
Jeremy Wall 2022-02-14 16:06:05 -05:00
parent a609db119a
commit 256719a42d

View File

@ -86,12 +86,14 @@ fn shopping_list() -> View<G> {
iterable: ingredients, iterable: ingredients,
template: |(_k, i)| { template: |(_k, i)| {
let amt = Signal::new(format!("{}", i.amt.normalize())); let amt = Signal::new(format!("{}", i.amt.normalize()));
let name = i.name;
let form = i.form.map(|form| format!("({})", form)).unwrap_or_default();
view! { view! {
tr { tr {
// TODO(jwall): What is the mechanism for deleting ingredients // TODO(jwall): What is the mechanism for deleting ingredients
// from the list? // from the list?
td { input(bind:value=amt.clone(), type="text") } td { input(bind:value=amt.clone(), type="text") }
td { (i.name) } td { (name) " " (form) }
} }
} }
}, },