From bafda02b74dea163541d9a4843956171583de57c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Veikko=20Lintuj=C3=A4rvi?= Date: Tue, 11 Jul 2023 12:17:40 +0300 Subject: [PATCH] New plants, Alphapetical order for plant list --- lib/osuuspuutarha/harvest/parser.ex | 12 +++++++ lib/osuuspuutarha/harvest/yield.ex | 5 ++- .../live/yield_live/form_component.html.heex | 36 ++++++++++--------- 3 files changed, 35 insertions(+), 18 deletions(-) diff --git a/lib/osuuspuutarha/harvest/parser.ex b/lib/osuuspuutarha/harvest/parser.ex index 238452c..4fe629f 100644 --- a/lib/osuuspuutarha/harvest/parser.ex +++ b/lib/osuuspuutarha/harvest/parser.ex @@ -78,4 +78,16 @@ defmodule Osuuspuutarha.Harvest.Parser do def parse_plant(:green_onions) do "Green Onions" end + + def parse_plant(:mangold) do + "Mangold" + end + + def parse_plant(:paprika) do + "Paprika" + end + + def parse_plant(:chili) do + "Chili" + end end diff --git a/lib/osuuspuutarha/harvest/yield.ex b/lib/osuuspuutarha/harvest/yield.ex index 91259bc..c4e573c 100644 --- a/lib/osuuspuutarha/harvest/yield.ex +++ b/lib/osuuspuutarha/harvest/yield.ex @@ -27,7 +27,10 @@ defmodule Osuuspuutarha.Harvest.Yield do :cauliflower, :broccoli, :portulak, - :green_onions + :green_onions, + :mangold, + :paprika, + :chili ] field :unit, Ecto.Enum, values: [:kg, :kpl] diff --git a/lib/osuuspuutarha_web/live/yield_live/form_component.html.heex b/lib/osuuspuutarha_web/live/yield_live/form_component.html.heex index d7e90f2..bf877eb 100644 --- a/lib/osuuspuutarha_web/live/yield_live/form_component.html.heex +++ b/lib/osuuspuutarha_web/live/yield_live/form_component.html.heex @@ -20,27 +20,29 @@ <%= label f, :plant %> <%= select f, :plant, [ - "Lettuce": :lettuce, - "Tomato": :tomato, - "Cabbage": :cabbage, - "White Cabbage": :white_cabbage, - "Red Cabbage": :red_cabbage, - "Pumpkin": :pumpkin, - "Zucchini": :zucchini, - "Cucumber": :cucumber, - "Melon": :melon, - "Sweet Corn": :sweet_corn, "Bean": :bean, - "Parsnip": :parsnip, - "Carrot": :carrot, "Beetroot": :beetroot, - "Rhubarb": :rhubarb, - "Kale": :kale, - "Cauliflower": :cauliflower, "Broccoli": :broccoli, + "Cabbage": :cabbage, + "Carrot": :carrot, + "Cauliflower": :cauliflower, + "Chili": :chili, + "Cucumber": :cucumber, + "Green Onions": :green_onions, + "Kale": :kale, + "Lettuce": :lettuce, + "Mangold": :mangold, + "Melon": :melon, + "Paprika": :paprika, + "Parsnip": :parsnip, "Portulak": :portulak, - "Green Onions": :green_onions - + "Pumpkin": :pumpkin, + "Red Cabbage": :red_cabbage, + "Rhubarb": :rhubarb, + "Sweet Corn": :sweet_corn, + "Tomato": :tomato, + "White Cabbage": :white_cabbage, + "Zucchini": :zucchini ], prompt: "Choose a value" %> <%= error_tag f, :plant %>