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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user