Make even_weeks editable

This commit is contained in:
2023-03-20 18:11:25 +02:00
parent 76ae3e312b
commit cbb4e13097
2 changed files with 19 additions and 5 deletions

View File

@@ -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;

View File

@@ -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 %>
<div class="checkbox-container">
<%= checkbox f, :even_weeks, class: "checkbox" %>
<%= label f, :even_weeks, "Parilliset viikot" %>
<%= error_tag f, :even_weeks %>
</div>
<% end %>
<%= error_tag f, :order_type %>
<%= label f, :location, "Valitse jakopaikka" %>
@@ -49,7 +56,7 @@
%>
<%= error_tag f, :is_member %>
<div class="privacy-checkbox-container">
<div class="checkbox-container">
<%= checkbox f, :split_invoice, class: "checkbox" %>
<%= label f, :split_invoice, "Haluan maksaa laskun kahdessa erässä" %>
<%= error_tag f, :split_invoice %>