Commit bfd21813 authored by Martin Wortschack's avatar Martin Wortschack 🐻

use referer for redirect instead of hidden field param from partials

parent bf5972e1
Pipeline #29840497 failed with stages
in 30 minutes and 10 seconds
......@@ -9,7 +9,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
.new(@application_setting, current_user, application_setting_params)
.execute
redirect_path = params[:redirect_path] ? params[:redirect_path].to_h : admin_application_settings_path
redirect_path = request.referer.presence ? request.referer : admin_application_settings_path
if successful
redirect_to redirect_path,
......
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-abuse-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting)
= hidden_field(:redirect_path, reporting_admin_application_settings_path)
%fieldset
.form-group
= f.label :admin_notification_email, 'Abuse reports notification email', class: 'label-bold'
......
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-account-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting)
= hidden_field(:redirect_path, admin_application_settings_path)
%fieldset
.form-group
.form-check
......
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-background-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting)
= hidden_field(:redirect_path, preferences_admin_application_settings_path)
%fieldset
%p
These settings require a
......
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-ci-cd-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting)
= hidden_field(:redirect_path, ci_cd_admin_application_settings_path)
%fieldset
.form-group
.card.auto-devops-card
......
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-email-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting)
= hidden_field(:redirect_path, preferences_admin_application_settings_path)
%fieldset
.form-group
.form-check
......
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-gitaly-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting)
= hidden_field(:redirect_path, preferences_admin_application_settings_path)
%fieldset
.form-group
= f.label :gitaly_timeout_default, 'Default Timeout Period', class: 'label-bold'
......
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-help-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting)
= hidden_field(:redirect_path, preferences_admin_application_settings_path)
%fieldset
.form-group
= f.label :help_page_text, class: 'label-bold'
......
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-influx-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting)
= hidden_field(:redirect_path, metrics_and_profiling_admin_application_settings_path)
%fieldset
%p
Setup InfluxDB to measure a wide variety of statistics like the time spent
......
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-ip-limits-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting)
= hidden_field(:redirect_path, network_admin_application_settings_path)
%fieldset
.form-group
.form-check
......
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-koding-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting)
= hidden_field(:redirect_path, admin_application_settings_path)
%fieldset
.form-group
.form-check
......
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-logging-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting)
= hidden_field(:redirect_path, reporting_admin_application_settings_path)
%fieldset
.form-group
.form-check
......
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-outbound-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting)
= hidden_field(:redirect_path, network_admin_application_settings_path)
%fieldset
.form-group
.form-check
......
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-pages-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting)
= hidden_field(:redirect_path, preferences_admin_application_settings_path)
%fieldset
.form-group
= f.label :max_pages_size, 'Maximum size of pages (MB)', class: 'label-bold'
......
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-performance-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting)
= hidden_field(:redirect_path, network_admin_application_settings_path)
%fieldset
.form-group
.form-check
......
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-performance-bar-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting)
= hidden_field(:redirect_path, metrics_and_profiling_admin_application_settings_path)
%fieldset
.form-group
.form-check
......
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-plantuml-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting)
= hidden_field(:redirect_path, integrations_admin_application_settings_path)
%fieldset
.form-group
.form-check
......
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-prometheus-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting)
= hidden_field(:redirect_path, metrics_and_profiling_admin_application_settings_path)
%fieldset
%p
Enable a Prometheus metrics endpoint at
......
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-realtime-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting)
= hidden_field(:redirect_path, preferences_admin_application_settings_path)
%fieldset
.form-group
= f.label :polling_interval_multiplier, 'Polling interval multiplier', class: 'label-bold'
......
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-registry-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting)
= hidden_field(:redirect_path, ci_cd_admin_application_settings_path)
%fieldset
.form-group
= f.label :container_registry_token_expire_delay, 'Authorization token duration (minutes)', class: 'label-bold'
......
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-repository-check-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting)
= hidden_field(:redirect_path, repository_admin_application_settings_path)
%fieldset
.sub-section
%h4 Repository checks
......
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-mirror-settings') do |f|
= form_errors(@application_setting)
= hidden_field(:redirect_path, repository_admin_application_settings_path)
%fieldset
.form-group
= f.label :mirror_available, 'Enable mirror configuration', class: 'label-bold'
......
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-repository-storage-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting)
= hidden_field(:redirect_path, repository_admin_application_settings_path)
%fieldset
.sub-section
.form-group
......
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-signin-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting)
= hidden_field(:redirect_path, admin_application_settings_path)
%fieldset
.form-group
.form-check
......
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-signup-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting)
= hidden_field(:redirect_path, admin_application_settings_path)
%fieldset
.form-group
.form-check
......
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-spam-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting)
= hidden_field(:redirect_path, reporting_admin_application_settings_path)
%fieldset
.form-group
.form-check
......
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-terminal-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting)
= hidden_field(:redirect_path, admin_application_settings_path)
%fieldset
.form-group
= f.label :terminal_max_session_time, 'Max session time', class: 'label-bold'
......
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-terms-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting)
= hidden_field(:redirect_path, admin_application_settings_path)
%fieldset
.form-group
.form-check
......
......@@ -3,8 +3,6 @@
= form_for application_setting, url: admin_application_settings_path(anchor: 'js-third-party-offers-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(application_setting)
= hidden_field(:redirect_path, integrations_admin_application_settings_path)
%fieldset
.form-group
.form-check
......
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-usage-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting)
= hidden_field(:redirect_path, metrics_and_profiling_admin_application_settings_path)
%fieldset
.form-group.mb-2
.form-check
......
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-visibility-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting)
= hidden_field(:redirect_path, admin_application_settings_path)
%fieldset
.form-group
= f.label :default_branch_protection, class: 'label-bold'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment