mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Actually controller is named dependEnt-select
This commit is contained in:
@@ -87,16 +87,16 @@
|
||||
= af.text_field :city, { placeholder: t(:city_placeholder)}
|
||||
.five.columns.omega
|
||||
= af.text_field :zipcode, { placeholder: t(:postcode_placeholder)}
|
||||
%div{"data-controller": "dependant-select", "data-dependant-select-options-value": countries_with_states }
|
||||
%div{"data-controller": "dependent-select", "data-dependent-select-options-value": countries_with_states }
|
||||
.row
|
||||
.three.columns.alpha
|
||||
= af.label :state_id, t(:state)
|
||||
\/
|
||||
= af.label :country_id, t(:country)
|
||||
.four.columns
|
||||
= af.select :country_id, available_countries.map { |c| [c.name, c.id] }, {}, { "data-controller": "tom-select", "data-dependant-select-target": "source", "data-action": "dependant-select#handleSelectChange", class: "primary" }
|
||||
= af.select :country_id, available_countries.map { |c| [c.name, c.id] }, {}, { "data-controller": "tom-select", "data-dependent-select-target": "source", "data-action": "dependent-select#handleSelectChange", class: "primary" }
|
||||
.five.columns.omega
|
||||
= af.select :state_id, @enterprise.address.country.states.map { |s| [s.name, s.id] }, {}, { "data-controller": "tom-select", "data-dependant-select-target": "select", class: "primary" }
|
||||
= af.select :state_id, @enterprise.address.country.states.map { |s| [s.name, s.id] }, {}, { "data-controller": "tom-select", "data-dependent-select-target": "select", class: "primary" }
|
||||
.row
|
||||
.three.columns.alpha
|
||||
= af.label :latitude, t(:latitude)
|
||||
|
||||
@@ -29,11 +29,11 @@
|
||||
= bf.label :country_id, t(:country)
|
||||
\/
|
||||
= bf.label :state_id, t(:state)
|
||||
%div{"data-controller": "dependant-select", "data-dependant-select-options-value": countries_with_states }
|
||||
%div{"data-controller": "dependent-select", "data-dependent-select-options-value": countries_with_states }
|
||||
.four.columns
|
||||
= bf.select :country_id, options_for_select(available_countries.map { |c| [c.name, c.id] }, @enterprise.business_address.country_id), {}, { "data-controller": "tom-select", "data-dependant-select-target": "source", "data-action": "dependant-select#handleSelectChange", class: "primary" }
|
||||
= bf.select :country_id, options_for_select(available_countries.map { |c| [c.name, c.id] }, @enterprise.business_address.country_id), {}, { "data-controller": "tom-select", "data-dependent-select-target": "source", "data-action": "dependent-select#handleSelectChange", class: "primary" }
|
||||
.four.columns.omega
|
||||
= bf.select :state_id, @enterprise.address.country.states.map { |s| [s.name, s.id] }, {}, { "data-controller": "tom-select", "data-dependant-select-target": "select", class: "primary" }
|
||||
= bf.select :state_id, @enterprise.address.country.states.map { |s| [s.name, s.id] }, {}, { "data-controller": "tom-select", "data-dependent-select-target": "select", class: "primary" }
|
||||
|
||||
.row
|
||||
.three.columns.alpha
|
||||
|
||||
@@ -4,6 +4,6 @@
|
||||
|
||||
= form_with url: "/admin/subscriptions/new", method: :get do |f|
|
||||
.text-left.margin-bottom-30
|
||||
= select_tag "subscription[shop_id]", options_from_collection_for_select(@shops, "id", "name"), { "data-controller": "tom-select", "data-dependant-select-target": "source", "data-action": "dependant-select#handleSelectChange", class: "primary" }
|
||||
= select_tag "subscription[shop_id]", options_from_collection_for_select(@shops, "id", "name"), { "data-controller": "tom-select", "data-dependent-select-target": "source", "data-action": "dependent-select#handleSelectChange", class: "primary" }
|
||||
.text-center
|
||||
= f.submit "Continue", class: "button red icon-plus"
|
||||
= f.submit "Continue", class: "button red icon-plus"
|
||||
|
||||
@@ -50,16 +50,16 @@
|
||||
= bill_address.text_field :zipcode, { placeholder: t("split_checkout.step1.address.zipcode.placeholder") }
|
||||
= f.error_message_on "bill_address.zipcode"
|
||||
|
||||
%div{ "data-controller": "dependant-select", "data-dependant-select-options-value": countries_with_states }
|
||||
%div{ "data-controller": "dependent-select", "data-dependent-select-options-value": countries_with_states }
|
||||
- bill_address_country = @order.bill_address.country || DefaultCountry.country
|
||||
|
||||
%div.checkout-input
|
||||
= bill_address.label :country_id, t("split_checkout.step1.address.country_id.label")
|
||||
= bill_address.select :country_id, countries, { selected: bill_address_country.id }, { "data-dependant-select-target": "source", "data-action": "dependant-select#handleSelectChange" }
|
||||
= bill_address.select :country_id, countries, { selected: bill_address_country.id }, { "data-dependent-select-target": "source", "data-action": "dependent-select#handleSelectChange" }
|
||||
|
||||
%div.checkout-input
|
||||
= bill_address.label :state_id, t("split_checkout.step1.address.state_id.label")
|
||||
= bill_address.select :state_id, states_for_country(bill_address_country), { selected: @order.bill_address&.state_id }, { "data-dependant-select-target": "select" }
|
||||
= bill_address.select :state_id, states_for_country(bill_address_country), { selected: @order.bill_address&.state_id }, { "data-dependent-select-target": "select" }
|
||||
|
||||
- if spree_current_user
|
||||
%div.checkout-input
|
||||
@@ -130,16 +130,16 @@
|
||||
= ship_address.text_field :zipcode, { placeholder: t("split_checkout.step1.address.zipcode.placeholder") }
|
||||
= f.error_message_on "ship_address.zipcode"
|
||||
|
||||
%div{ "data-controller": "dependant-select", "data-dependant-select-options-value": countries_with_states }
|
||||
%div{ "data-controller": "dependent-select", "data-dependent-select-options-value": countries_with_states }
|
||||
- ship_address_country = @order.ship_address.country || DefaultCountry.country
|
||||
|
||||
%div.checkout-input
|
||||
= ship_address.label :country_id, t("split_checkout.step1.address.country_id.label")
|
||||
= ship_address.select :country_id, countries, { selected: ship_address_country.id }, { "data-dependant-select-target": "source", "data-action": "dependant-select#handleSelectChange" }
|
||||
= ship_address.select :country_id, countries, { selected: ship_address_country.id }, { "data-dependent-select-target": "source", "data-action": "dependent-select#handleSelectChange" }
|
||||
|
||||
%div.checkout-input
|
||||
= ship_address.label :state_id, t("split_checkout.step1.address.state_id.label")
|
||||
= ship_address.select :state_id, states_for_country(ship_address_country), { selected: @order.ship_address&.state_id }, { "data-dependant-select-target": "select" }
|
||||
= ship_address.select :state_id, states_for_country(ship_address_country), { selected: @order.ship_address&.state_id }, { "data-dependent-select-target": "select" }
|
||||
|
||||
- if spree_current_user
|
||||
%div.checkout-input{ "data-toggle-target": "content", style: "display: #{display_ship_address ? 'block' : 'none'}" }
|
||||
|
||||
Reference in New Issue
Block a user