Change admin settings tab for maps

- Rename map settings keys
- Add fields for latitude, longitude and zoom
- Add a callout message on how to enable map feature
This commit is contained in:
Julian Herrero
2019-03-13 12:24:10 +01:00
parent c0d2776e8d
commit dbac4bc222
12 changed files with 52 additions and 36 deletions

View File

@@ -4,6 +4,7 @@ class Admin::SettingsController < Admin::BaseController
all_settings = Setting.all.group_by { |setting| setting.type }
@configuration_settings = all_settings["configuration"]
@feature_settings = all_settings["feature"]
@map_configuration_settings = all_settings["map"]
end
def update
@@ -13,9 +14,9 @@ class Admin::SettingsController < Admin::BaseController
end
def update_map
Setting["map_latitude"] = params[:latitude].to_f
Setting["map_longitude"] = params[:longitude].to_f
Setting["map_zoom"] = params[:zoom].to_i
Setting["map.latitude"] = params[:latitude].to_f
Setting["map.longitude"] = params[:longitude].to_f
Setting["map.zoom"] = params[:zoom].to_i
redirect_to admin_settings_path, notice: t("admin.settings.index.map.flash.update")
end