From 80fa92dadbe780dd6859998b2052d412f9869f5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Veikko=20Lintuj=C3=A4rvi?= Date: Wed, 26 Jul 2023 10:15:05 +0300 Subject: [PATCH] New plants --- lib/osuuspuutarha/harvest/parser.ex | 16 ++++++++++++++++ lib/osuuspuutarha/harvest/yield.ex | 6 +++++- .../live/yield_live/form_component.html.heex | 4 ++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/lib/osuuspuutarha/harvest/parser.ex b/lib/osuuspuutarha/harvest/parser.ex index dfb0f08..ccb9a79 100644 --- a/lib/osuuspuutarha/harvest/parser.ex +++ b/lib/osuuspuutarha/harvest/parser.ex @@ -94,4 +94,20 @@ defmodule Osuuspuutarha.Harvest.Parser do def parse_plant(:kohlrabi) do "Kohlrabi" end + + def parse_plant(:garlic) do + "Garlic" + end + + def parse_plant(:onion) do + "Onion" + end + + def parse_plant(:spinach) do + "Spinach" + end + + def parse_plant(:parsley) do + "Parsley" + end end diff --git a/lib/osuuspuutarha/harvest/yield.ex b/lib/osuuspuutarha/harvest/yield.ex index 385d67b..3ed9335 100644 --- a/lib/osuuspuutarha/harvest/yield.ex +++ b/lib/osuuspuutarha/harvest/yield.ex @@ -31,7 +31,11 @@ defmodule Osuuspuutarha.Harvest.Yield do :mangold, :paprika, :chili, - :kohlrabi + :kohlrabi, + :garlic, + :onion, + :spinach, + :parsley ] 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 788d505..f20b05e 100644 --- a/lib/osuuspuutarha_web/live/yield_live/form_component.html.heex +++ b/lib/osuuspuutarha_web/live/yield_live/form_component.html.heex @@ -28,18 +28,22 @@ "Cauliflower": :cauliflower, "Chili": :chili, "Cucumber": :cucumber, + "Garlic": :garlic, "Green Onions": :green_onions, "Kale": :kale, "Kohlrabi": :kohlrabi, "Lettuce": :lettuce, "Mangold": :mangold, "Melon": :melon, + "Onion": :onion, "Paprika": :paprika, + "Parsley": :parsley, "Parsnip": :parsnip, "Portulak": :portulak, "Pumpkin": :pumpkin, "Red Cabbage": :red_cabbage, "Rhubarb": :rhubarb, + "Spinach": :spinach, "Sweet Corn": :sweet_corn, "Tomato": :tomato, "White Cabbage": :white_cabbage,