Move settings map inside the form
That's what we usually do, and it makes sense since clicking on the map changes the content of hidden fields in the form.
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="small-12 column">
|
<div class="small-12 column">
|
||||||
|
<%= form_tag admin_update_map_path, method: :put, id: "map-form" do |f| %>
|
||||||
<div id="admin-map" class="map"
|
<div id="admin-map" class="map"
|
||||||
data-map
|
data-map
|
||||||
data-map-center-latitude="<%= Setting["map.latitude"] %>"
|
data-map-center-latitude="<%= Setting["map.latitude"] %>"
|
||||||
@@ -15,8 +16,6 @@
|
|||||||
data-zoom-input-selector="#zoom">
|
data-zoom-input-selector="#zoom">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<%= form_tag admin_update_map_path, method: :put, id: "map-form" do |f| %>
|
|
||||||
|
|
||||||
<%= hidden_field_tag :latitude, Setting["map.latitude"] %>
|
<%= hidden_field_tag :latitude, Setting["map.latitude"] %>
|
||||||
<%= hidden_field_tag :longitude, Setting["map.longitude"] %>
|
<%= hidden_field_tag :longitude, Setting["map.longitude"] %>
|
||||||
<%= hidden_field_tag :zoom, Setting["map.zoom"] %>
|
<%= hidden_field_tag :zoom, Setting["map.zoom"] %>
|
||||||
|
|||||||
@@ -92,8 +92,9 @@ describe "Admin settings", :admin do
|
|||||||
|
|
||||||
visit admin_settings_path
|
visit admin_settings_path
|
||||||
click_link "Map configuration"
|
click_link "Map configuration"
|
||||||
find("#admin-map").click
|
|
||||||
within "#map-form" do
|
within "#map-form" do
|
||||||
|
find("#admin-map").click
|
||||||
click_button "Update"
|
click_button "Update"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user