mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Extract location map from registration form into its own partial, also add missing new lines
This commit is contained in:
@@ -120,4 +120,4 @@
|
||||
|
||||
.row
|
||||
.twelve.columns.alpha
|
||||
= render partial: "spree/admin/shared/new_resource_links"
|
||||
= render partial: "spree/admin/shared/new_resource_links"
|
||||
|
||||
@@ -35,4 +35,4 @@
|
||||
= yield :injection_data
|
||||
|
||||
= render "layouts/i18n_script"
|
||||
= render "layouts/bugherd_script"
|
||||
= render "layouts/bugherd_script"
|
||||
|
||||
@@ -56,24 +56,8 @@
|
||||
%select.chunky{ id: 'enterprise_country', name: 'country', required: true, ng: { init: "setDefaultCountry(#{Spree::Config[:default_country_id]})", model: 'enterprise.country', options: 'c as c.name for c in countries' } }
|
||||
%span.error{ ng: { show: "details.country.$error.required && submitted" } }
|
||||
= t(".country_field_error")
|
||||
- if using_google_maps?
|
||||
%div
|
||||
.center{ ng: {if: "latLong"}}
|
||||
%strong {{'registration.steps.details.drag_pin' | t}}
|
||||
.small-12.medium-9.large-12.columns.end
|
||||
.map-container--registration{id: "registration-map", ng: {if: "!!map"}}
|
||||
%ui-gmap-google-map{ center: "map.center", zoom: "map.zoom"}
|
||||
%ui-gmap-marker{idKey: 1, coords: "latLong", options: '{ draggable: true}'}
|
||||
|
||||
.center
|
||||
%input.button.primary{ type: "button", value: "{{'registration.steps.details.locate_address' | t}}", ng: { click: "locateAddress()" } }
|
||||
.center{ ng: {if: "latLong"}}
|
||||
.field
|
||||
%input{ type: 'checkbox', id: 'confirm_address', name: 'confirm_address', ng: { model: 'addressConfirmed', change: 'confirmAddressChange(confirmAddress)'} }
|
||||
%label{ for: 'confirm_address' } {{'registration.steps.details.confirm_address' | t}}
|
||||
.small-12.medium-9.large-12.columns.end{ ng: {if: "latLong"}}
|
||||
.field
|
||||
%strong {{'registration.steps.details.drag_map_marker' | t}}
|
||||
= render 'registration/steps/location_map' if using_google_maps?
|
||||
|
||||
.row.buttons
|
||||
.small-12.columns
|
||||
|
||||
18
app/views/registration/steps/_location_map.html.haml
Normal file
18
app/views/registration/steps/_location_map.html.haml
Normal file
@@ -0,0 +1,18 @@
|
||||
%div
|
||||
.center{ ng: {if: "latLong"}}
|
||||
%strong {{'registration.steps.details.drag_pin' | t}}
|
||||
.small-12.medium-9.large-12.columns.end
|
||||
.map-container--registration{id: "registration-map", ng: {if: "!!map"}}
|
||||
%ui-gmap-google-map{ center: "map.center", zoom: "map.zoom"}
|
||||
%ui-gmap-marker{idKey: 1, coords: "latLong", options: '{ draggable: true}'}
|
||||
|
||||
.center
|
||||
%input.button.primary{ type: "button", value: "{{'registration.steps.details.locate_address' | t}}", ng: { click: "locateAddress()" } }
|
||||
.center{ ng: {if: "latLong"}}
|
||||
.field
|
||||
%input{ type: 'checkbox', id: 'confirm_address', name: 'confirm_address', ng: { model: 'addressConfirmed', change: 'confirmAddressChange(confirmAddress)'} }
|
||||
%label{ for: 'confirm_address' } {{'registration.steps.details.confirm_address' | t}}
|
||||
.small-12.medium-9.large-12.columns.end{ ng: {if: "latLong"}}
|
||||
.field
|
||||
%strong {{'registration.steps.details.drag_map_marker' | t}}
|
||||
|
||||
Reference in New Issue
Block a user