basics for the language-settings

This commit is contained in:
1Day 2022-01-04 10:03:03 +01:00
parent c2988787e6
commit 6f1d372512
5 changed files with 75 additions and 2 deletions

View file

@ -38,7 +38,7 @@ class SettingsController extends Controller
return view('admin.settings.index', [
'tabs' => $tabs,
'tabListItems' => $tabListItems,
]);;
]);
}
public function updateIcons(Request $request)
@ -85,4 +85,9 @@ class SettingsController extends Controller
return redirect()->route('admin.settings.index')->with('success', 'Invoice settings updated!');
}
public function updateLanguageSettings (Request $request){
}
}

View file

@ -102,3 +102,4 @@
</form>
</div>

View file

@ -0,0 +1,66 @@
<div class="tab-pane mt-3" id="language">
<form method="POST" enctype="multipart/form-data" class="mb-3"
action="{{ route('admin.settings.update.languagesettings') }}">
@csrf
@method('PATCH')
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="languages">{{__("Available languages")}}:</label>
<select id="languages" style="width:100%"
class="custom-select" name="languages[]"
multiple="multiple" autocomplete="off">
<option value="de">German</option>
<option value="en">English</option>
<option value="fr">French</option>
<option value="cz">Czech</option>
</select>
<label for="defaultLanguage">{{__("Default language")}}: <i data-toggle="popover"
data-trigger="hover"
data-content="{{__('The fallback Language, if something goes wrong')}}"
class="fas fa-info-circle"></i></label>
<select id="defaultLanguage" style="width:100%"
class="custom-select" name="defaultLanguage"
autocomplete="off">
<option value="de">German</option>
<option value="en">English</option>
<option value="fr">French</option>
<option value="cz">Czech</option>
</select>
</div>
<div class="form-group">
<input value="autotranslate" id="autotranslate" name="autotranslate"
type="checkbox">
<label for="autotranslate">{{__('Auto-translate')}} <i data-toggle="popover"
data-trigger="hover"
data-content="{{__('If this is checked, the Dashboard will translate itself to the Clients language, if available')}}"
class="fas fa-info-circle"></i></label>
<br/>
<input value="canClientChangeLanguage" id="canClientChangeLanguage" name="canClientChangeLanguage"
type="checkbox">
<label for="canClientChangeLanguage">{{__('Let the Client change the Language')}} <i data-toggle="popover"
data-trigger="hover"
data-content="{{__('If this is checked, Clients will have the ability to manually change their Dashboard language')}}"
class="fas fa-info-circle"></i></label>
</div>
</div>
</div>
<button class="btn btn-primary">{{ __('Save') }}</button>
</form>
</div>
<script>
document.addEventListener('DOMContentLoaded', (event) => {
$('.custom-select').select2();
})
</script>

View file

@ -57,7 +57,7 @@
<a class="nav-link" href="#" id="languageDropdown" role="button" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
<span class="mr-1 d-lg-inline text-gray-600">
<small><i class="fa fa-language mr-2"></i></small>{{ __('Languages') }}
<small><i class="fa fa-language mr-2"></i></small>{{ __('Language') }}
</span>
</a>
<div class="dropdown-menu dropdown-menu-right shadow animated--grow-in"

View file

@ -133,6 +133,7 @@ Route::middleware(['auth', 'checkSuspended'])->group(function () {
#settings
Route::patch('settings/update/icons', [SettingsController::class, 'updateIcons'])->name('settings.update.icons');
Route::patch('settings/update/invoice-settings', [SettingsController::class, 'updateInvoiceSettings'])->name('settings.update.invoicesettings');
Route::patch('settings/update/lagnguage', [SettingsController::class, 'updateLanguageSettings'])->name('settings.update.languagesettings');
Route::resource('settings', SettingsController::class)->only('index');
#invoices