Merge branch 'master' into dashboard
This commit is contained in:
@@ -6,11 +6,11 @@ class Admin::SettingsController < Admin::BaseController
|
||||
:poster_feature_short_title_setting, :poster_feature_description_setting
|
||||
|
||||
def index
|
||||
all_settings = Setting.all.group_by { |s| s.type }
|
||||
@settings = all_settings['common']
|
||||
@feature_flags = all_settings['feature']
|
||||
@banner_styles = all_settings['banner-style']
|
||||
@banner_imgs = all_settings['banner-img']
|
||||
all_settings = Setting.all.group_by { |setting| setting.type }
|
||||
@configuration_settings = all_settings["configuration"]
|
||||
@feature_settings = all_settings["feature"]
|
||||
@participation_processes_settings = all_settings["process"]
|
||||
@map_configuration_settings = all_settings["map"]
|
||||
end
|
||||
|
||||
def update
|
||||
@@ -20,15 +20,16 @@ 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
|
||||
redirect_to admin_settings_path, notice: t('admin.settings.index.map.flash.update')
|
||||
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
|
||||
|
||||
private
|
||||
|
||||
def settings_params
|
||||
params.require(:setting).permit(:value)
|
||||
end
|
||||
def settings_params
|
||||
params.require(:setting).permit(:value)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user