Extract location map from registration form into its own partial, also add missing new lines

This commit is contained in:
Cillian O'Ruanaidh
2021-03-17 10:04:26 +00:00
parent f20cea7e4f
commit 4e1eefa877
4 changed files with 21 additions and 19 deletions

View File

@@ -120,4 +120,4 @@
 
.row
.twelve.columns.alpha
= render partial: "spree/admin/shared/new_resource_links"
= render partial: "spree/admin/shared/new_resource_links"

View File

@@ -35,4 +35,4 @@
= yield :injection_data
= render "layouts/i18n_script"
= render "layouts/bugherd_script"
= render "layouts/bugherd_script"

View File

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

View 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}}