Merge branch 'master' into dashboard

This commit is contained in:
decabeza
2019-03-26 16:45:48 +01:00
2476 changed files with 62613 additions and 84405 deletions

View File

@@ -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