fix general settings

This commit is contained in:
1day2die 2023-05-08 13:53:21 +02:00
parent 78dfe881d2
commit 29b5b39d17
2 changed files with 10 additions and 9 deletions

View file

@ -8,13 +8,13 @@ class GeneralSettings extends Settings
{
public bool $store_enabled;
public string $credits_display_name;
public bool $recaptcha_enabled;
public string $recaptcha_site_key;
public string $recaptcha_secret_key;
public string $phpmyadmin_url;
public bool $alert_enabled;
public ?bool $recaptcha_enabled;
public ?string $recaptcha_site_key;
public ?string $recaptcha_secret_key;
public ?string $phpmyadmin_url;
public ?bool $alert_enabled;
public string $alert_type;
public string $alert_message;
public ?string $alert_message;
public string $theme;
//public int $initial_user_role; wait for Roles & Permissions PR.
@ -41,7 +41,7 @@ class GeneralSettings extends Settings
'phpmyadmin_url' => 'nullable|string',
'alert_enabled' => 'nullable|boolean',
'alert_type' => 'required|in:primary,secondary,success,danger,warning,info',
'alert_message' => 'required|string',
'alert_message' => 'nullable|string',
'theme' => 'required|in:default,BlueInfinity' // TODO: themes should be made/loaded dynamically
];
}

View file

@ -121,10 +121,11 @@
@case($value['type'] == 'select')
<select id="{{ $key }}"
class="custom-select w-100" name="{{ $key }}">
@foreach ($value['options'] as $option)
@foreach ($value['options'] as $option=>$display)
<option value="{{ $option }}"
{{ $value['value'] == $option ? 'selected' : '' }}>
{{ __($option) }}
{{ __($display) }}
</option>
@endforeach
</select>