Skip to content

Commit

Permalink
Add ID to ingredient table
Browse files Browse the repository at this point in the history
  • Loading branch information
T3C42 committed Jul 17, 2024
1 parent ad07ba3 commit c2a0ae5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions backend/src/frontend/ingredients_tab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,10 @@ pub async fn ingredients_view(State(state): State<MyAppState>) -> Markup {

table class="table-fixed"{
thead { tr class="p-2" {
th class="w-1/12" { "ID" }
th class="w-1/4" { "Name" }
th class="w-1/8" { "Energy" }
th class="w-1/4" { "Comment" }
th class="w-1/8" { "Comment" }
th {}
th {}
th class="w-1/6" {}
Expand Down Expand Up @@ -359,8 +360,9 @@ fn format_ingredient_source(
fn format_ingredient(ingredient: &Ingredient) -> Markup {
html! {
tr id=(format!("ingredient-{}", ingredient.ingredient_id)) {
td { (ingredient.name) }
td { (ingredient.energy) }
td class="text-center opacity-70" { (ingredient.ingredient_id) }
td class="text-center" { (ingredient.name) }
td class="text-center" { (ingredient.energy) }
td class="text-center" { (ingredient.comment.as_ref().unwrap_or(&String::new())) }
td {
button class="btn btn-primary"
Expand Down

0 comments on commit c2a0ae5

Please sign in to comment.