瀏覽代碼

basics for the language-settings

1Day 3 年之前
父節點
當前提交
6f1d372512

+ 6 - 1
app/Http/Controllers/Admin/SettingsControllers/SettingsController.php

@@ -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){
+
+
+    }
+
 }

+ 1 - 0
resources/views/admin/settings/tabs/invoice.blade.php

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

+ 66 - 0
resources/views/admin/settings/tabs/language.blade.php

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

+ 1 - 1
resources/views/layouts/main.blade.php

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

+ 1 - 0
routes/web.php

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