diff --git a/assets/css/live/form.css b/assets/css/live/form.css index 81a08aa..a4ce62d 100644 --- a/assets/css/live/form.css +++ b/assets/css/live/form.css @@ -7,6 +7,13 @@ margin-right: 1rem; } +.checkbox-container { + display: flex; + align-items: baseline; + margin-top: 1rem; + margin-bottom: 1rem; +} + .privacy-checkbox-container { display: flex; align-items: baseline; diff --git a/lib/osuuspuutarha_web/live/order_live/form_component.html.heex b/lib/osuuspuutarha_web/live/order_live/form_component.html.heex index 5155f25..18eb5c7 100644 --- a/lib/osuuspuutarha_web/live/order_live/form_component.html.heex +++ b/lib/osuuspuutarha_web/live/order_live/form_component.html.heex @@ -13,13 +13,20 @@ <%= select f, :order_type, [ - "Koko kausi": "full", - "Joka toinen viikko": "everyother", - "Elotilaus": "elo", - "Viljely-yhteisö": "community" + "Koko kausi": :full, + "Joka toinen viikko": :everyother, + "Elotilaus": :elo, + "Viljely-yhteisö": :community ], prompt: "Ei valintaa" %> + <%= if @action == :edit && @changeset.data.order_type == :everyother do %> +
+ <%= checkbox f, :even_weeks, class: "checkbox" %> + <%= label f, :even_weeks, "Parilliset viikot" %> + <%= error_tag f, :even_weeks %> +
+ <% end %> <%= error_tag f, :order_type %> <%= label f, :location, "Valitse jakopaikka" %> @@ -49,7 +56,7 @@ %> <%= error_tag f, :is_member %> -
+
<%= checkbox f, :split_invoice, class: "checkbox" %> <%= label f, :split_invoice, "Haluan maksaa laskun kahdessa erässä" %> <%= error_tag f, :split_invoice %>