Add map settings to backend. Install leaflet assets to render maps.
This commit is contained in:
31
app/views/admin/settings/_map_form.html.erb
Normal file
31
app/views/admin/settings/_map_form.html.erb
Normal file
@@ -0,0 +1,31 @@
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
<div id="admin-map" class="map" data-map
|
||||
data-latitude="<%= Setting["map.latitude"] %>"
|
||||
data-longitude="<%= Setting["map.longitude"] %>"
|
||||
data-zoom="<%= Setting["map.zoom"] %>"
|
||||
data-tiles-attribution-selector="#admin-map-attribution"
|
||||
data-tiles-provider="//{s}.tile.osm.org/{z}/{x}/{y}.png"
|
||||
data-latitude-input-selector="#latitude"
|
||||
data-longitude-input-selector="#longitude"
|
||||
data-zoom-input-selector="#zoom"
|
||||
data-marker-selector="#admin-map-marker">
|
||||
</div>
|
||||
<div id="admin-map-attribution" class="map-attributtion">
|
||||
© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors
|
||||
</div>
|
||||
|
||||
<%= form_tag admin_update_map_path, method: :put, id: 'map-form' do |f| %>
|
||||
|
||||
<%= hidden_field_tag :latitude, Setting["map.latitude"] %>
|
||||
<%= hidden_field_tag :longitude, Setting["map.longitude"] %>
|
||||
<%= hidden_field_tag :zoom, Setting["map.zoom"] %>
|
||||
|
||||
<div class="small-12 medium-6 large-4">
|
||||
<%= submit_tag t("admin.settings.index.map.form.submit"),
|
||||
class: "button hollow expanded" %>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user