From df436c286c33536cf3c87a78a18666e2e4cfcc96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Veikko=20Lintuj=C3=A4rvi?= Date: Mon, 3 Jul 2023 17:43:02 +0300 Subject: [PATCH] New plants --- lib/osuuspuutarha/harvest/parser.ex | 32 +++++++++++++++++++ lib/osuuspuutarha/harvest/yield.ex | 10 +++++- .../live/yield_live/form_component.html.heex | 11 ++++++- 3 files changed, 51 insertions(+), 2 deletions(-) diff --git a/lib/osuuspuutarha/harvest/parser.ex b/lib/osuuspuutarha/harvest/parser.ex index 7dcf946..238452c 100644 --- a/lib/osuuspuutarha/harvest/parser.ex +++ b/lib/osuuspuutarha/harvest/parser.ex @@ -11,6 +11,14 @@ defmodule Osuuspuutarha.Harvest.Parser do "Cabbage" end + def parse_plant(:white_cabbage) do + "White Cabbage" + end + + def parse_plant(:red_cabbage) do + "Red Cabbage" + end + def parse_plant(:pumpkin) do "Pumpkin" end @@ -46,4 +54,28 @@ defmodule Osuuspuutarha.Harvest.Parser do def parse_plant(:beetroot) do "Beetroot" end + + def parse_plant(:rhubarb) do + "Rhubarb" + end + + def parse_plant(:kale) do + "Kale" + end + + def parse_plant(:cauliflower) do + "Cauliflower" + end + + def parse_plant(:broccoli) do + "Broccoli" + end + + def parse_plant(:portulak) do + "Portulak" + end + + def parse_plant(:green_onions) do + "Green Onions" + end end diff --git a/lib/osuuspuutarha/harvest/yield.ex b/lib/osuuspuutarha/harvest/yield.ex index 4a0ffbe..91259bc 100644 --- a/lib/osuuspuutarha/harvest/yield.ex +++ b/lib/osuuspuutarha/harvest/yield.ex @@ -11,6 +11,8 @@ defmodule Osuuspuutarha.Harvest.Yield do :lettuce, :tomato, :cabbage, + :white_cabbage, + :red_cabbage, :pumpkin, :zucchini, :cucumber, @@ -19,7 +21,13 @@ defmodule Osuuspuutarha.Harvest.Yield do :bean, :parsnip, :carrot, - :beetroot + :beetroot, + :rhubarb, + :kale, + :cauliflower, + :broccoli, + :portulak, + :green_onions ] 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 03d19db..d7e90f2 100644 --- a/lib/osuuspuutarha_web/live/yield_live/form_component.html.heex +++ b/lib/osuuspuutarha_web/live/yield_live/form_component.html.heex @@ -23,6 +23,8 @@ "Lettuce": :lettuce, "Tomato": :tomato, "Cabbage": :cabbage, + "White Cabbage": :white_cabbage, + "Red Cabbage": :red_cabbage, "Pumpkin": :pumpkin, "Zucchini": :zucchini, "Cucumber": :cucumber, @@ -31,7 +33,14 @@ "Bean": :bean, "Parsnip": :parsnip, "Carrot": :carrot, - "Beetroot": :beetroot + "Beetroot": :beetroot, + "Rhubarb": :rhubarb, + "Kale": :kale, + "Cauliflower": :cauliflower, + "Broccoli": :broccoli, + "Portulak": :portulak, + "Green Onions": :green_onions + ], prompt: "Choose a value" %> <%= error_tag f, :plant %>