Migrate all variables in the front-end

This commit is contained in:
Ferks-FK 2023-02-05 17:20:55 +00:00 committed by IceToast
parent cfd370eb6d
commit 411441e1a8
43 changed files with 267 additions and 149 deletions

View file

@ -4,6 +4,7 @@ namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use App\Models\ApplicationApi;
use App\Settings\LocaleSettings;
use Exception;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Contracts\View\Factory;
@ -20,9 +21,11 @@ class ApplicationApiController extends Controller
*
* @return Application|Factory|View|Response
*/
public function index()
public function index(LocaleSettings $locale_settings)
{
return view('admin.api.index');
return view('admin.api.index', [
'locale_datatables' => $locale_settings->datatables
]);
}
/**

View file

@ -5,13 +5,16 @@ namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use App\Models\PartnerDiscount;
use App\Models\User;
use App\Settings\LocaleSettings;
use Illuminate\Http\Request;
class PartnerController extends Controller
{
public function index()
public function index(LocaleSettings $locale_settings)
{
return view('admin.partners.index');
return view('admin.partners.index', [
'locale_datatables' => $locale_settings->datatables
]);
}
/**

View file

@ -18,17 +18,18 @@ use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use App\Helpers\ExtensionHelper;
use App\Settings\LocaleSettings;
class PaymentController extends Controller
{
/**
* @return Application|Factory|View
*/
public function index()
public function index(LocaleSettings $locale_settings)
{
return view('admin.payments.index')->with([
'payments' => Payment::paginate(15),
'locale_datatables' => $locale_settings->datatables
]);
}

View file

@ -6,6 +6,8 @@ use App\Http\Controllers\Controller;
use App\Models\Pterodactyl\Location;
use App\Models\Pterodactyl\Nest;
use App\Models\Product;
use App\Settings\GeneralSettings;
use App\Settings\LocaleSettings;
use App\Settings\UserSettings;
use Exception;
use Illuminate\Contracts\Foundation\Application;
@ -22,9 +24,11 @@ class ProductController extends Controller
*
* @return Application|Factory|View
*/
public function index()
public function index(LocaleSettings $locale_settings)
{
return view('admin.products.index');
return view('admin.products.index', [
'locale_datatables' => $locale_settings->datatables
]);
}
/**
@ -32,11 +36,12 @@ class ProductController extends Controller
*
* @return Application|Factory|View
*/
public function create()
public function create(GeneralSettings $general_settings)
{
return view('admin.products.create', [
'locations' => Location::with('nodes')->get(),
'nests' => Nest::with('eggs')->get(),
'credits_display_name' => $general_settings->credits_display_name
]);
}
@ -91,11 +96,12 @@ class ProductController extends Controller
* @param Product $product
* @return Application|Factory|View
*/
public function show(Product $product, UserSettings $user_settings)
public function show(Product $product, UserSettings $user_settings, GeneralSettings $general_settings)
{
return view('admin.products.show', [
'product' => $product,
'minimum_credits' => $user_settings->min_credits_to_make_server,
'credits_display_name' => $general_settings->credits_display_name
]);
}
@ -105,12 +111,13 @@ class ProductController extends Controller
* @param Product $product
* @return Application|Factory|View
*/
public function edit(Product $product)
public function edit(Product $product, GeneralSettings $general_settings)
{
return view('admin.products.edit', [
'product' => $product,
'locations' => Location::with('nodes')->get(),
'nests' => Nest::with('eggs')->get(),
'credits_display_name' => $general_settings->credits_display_name
]);
}

View file

@ -5,6 +5,7 @@ namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use App\Models\Server;
use App\Models\User;
use App\Settings\LocaleSettings;
use Exception;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Contracts\View\Factory;
@ -22,9 +23,11 @@ class ServerController extends Controller
*
* @return Application|Factory|View|Response
*/
public function index()
public function index(LocaleSettings $locale_settings)
{
return view('admin.servers.index');
return view('admin.servers.index', [
'locale_datatables' => $locale_settings->datatables
]);
}
/**

View file

@ -3,6 +3,7 @@
namespace App\Http\Controllers\Admin;
use App\Models\ShopProduct;
use App\Settings\LocaleSettings;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Contracts\View\Factory;
use Illuminate\Contracts\View\View;
@ -20,7 +21,7 @@ class ShopProductController extends Controller
*
* @return Application|Factory|View|Response
*/
public function index(Request $request)
public function index(LocaleSettings $locale_settings)
{
$isPaymentSetup = false;
@ -34,6 +35,7 @@ class ShopProductController extends Controller
return view('admin.store.index', [
'isPaymentSetup' => $isPaymentSetup,
'locale_datatables' => $locale_settings->datatables
]);
}

View file

@ -5,6 +5,7 @@ namespace App\Http\Controllers\Admin;
use App\Enums\UsefulLinkLocation;
use App\Http\Controllers\Controller;
use App\Models\UsefulLink;
use App\Settings\LocaleSettings;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Contracts\View\Factory;
use Illuminate\Contracts\View\View;
@ -19,9 +20,11 @@ class UsefulLinkController extends Controller
*
* @return Application|Factory|View|Response
*/
public function index()
public function index(LocaleSettings $locale_settings)
{
return view('admin.usefullinks.index');
return view('admin.usefullinks.index', [
'locale_datatables' => $locale_settings->datatables
]);
}
/**

View file

@ -6,6 +6,7 @@ use App\Events\UserUpdateCreditsEvent;
use App\Http\Controllers\Controller;
use App\Models\User;
use App\Notifications\DynamicNotification;
use App\Settings\LocaleSettings;
use Exception;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Contracts\View\Factory;
@ -31,9 +32,11 @@ class UserController extends Controller
* @param Request $request
* @return Application|Factory|View|Response
*/
public function index()
public function index(LocaleSettings $locale_settings)
{
return view('admin.users.index');
return view('admin.users.index', [
'locale_datatables' => $locale_settings->datatables
]);
}
/**

View file

@ -6,6 +6,7 @@ use App\Events\UserUpdateCreditsEvent;
use App\Http\Controllers\Controller;
use App\Models\User;
use App\Models\Voucher;
use App\Settings\LocaleSettings;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Contracts\View\Factory;
use Illuminate\Contracts\View\View;
@ -22,9 +23,11 @@ class VoucherController extends Controller
*
* @return Application|Factory|View
*/
public function index()
public function index(LocaleSettings $locale_settings)
{
return view('admin.vouchers.index');
return view('admin.vouchers.index', [
'locale_datatables' => $locale_settings->datatables
]);
}
/**
@ -117,10 +120,11 @@ class VoucherController extends Controller
return redirect()->back()->with('success', __('voucher has been removed!'));
}
public function users(Voucher $voucher)
public function users(Voucher $voucher, LocaleSettings $locale_settings)
{
return view('admin.vouchers.users', [
'voucher' => $voucher,
'locale_datatables' => $locale_settings->datatables
]);
}

View file

@ -4,15 +4,15 @@ namespace App\Http\Controllers;
use App\Models\PartnerDiscount;
use App\Models\UsefulLink;
use App\Settings\GeneralSettings;
use App\Settings\WebsiteSettings;
use App\Settings\ReferralSettings;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Facades\URL;
use App\Settings\GeneralSettings;
use App\Settings\WebsiteSettings;
use App\Settings\ReferralSettings;
class HomeController extends Controller
{

View file

@ -10,17 +10,19 @@ use App\Models\TicketCategory;
use App\Models\TicketComment;
use App\Models\User;
use App\Notifications\Ticket\User\ReplyNotification;
use App\Settings\LocaleSettings;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
class TicketsController extends Controller
{
public function index()
public function index(LocaleSettings $locale_settings)
{
$tickets = Ticket::orderBy('id', 'desc')->paginate(10);
$ticketcategories = TicketCategory::all();
return view('moderator.ticket.index', compact('tickets', 'ticketcategories'));
return view('moderator.ticket.index', [
'tickets' => Ticket::orderBy('id', 'desc')->paginate(10),
'ticketcategories' => TicketCategory::all(),
'locale_datatables' => $locale_settings->datatables
]);
}
public function show($ticket_id)
@ -164,9 +166,11 @@ class TicketsController extends Controller
->make(true);
}
public function blacklist()
public function blacklist(LocaleSettings $locale_settings)
{
return view('moderator.ticket.blacklist');
return view('moderator.ticket.blacklist', [
'locale_datatables' => $locale_settings->datatables
]);
}
public function blacklistAdd(Request $request)

View file

@ -0,0 +1,12 @@
<?php
namespace App\Http\Controllers\Pterodactyl;
use App\Http\Controllers\Controller;
use App\Classes\PterodactylClient;
use Illuminate\Http\Request;
abstract class PterodactylController extends PterodactylClient
{
//
}

View file

@ -11,6 +11,7 @@ use App\Models\User;
use App\Notifications\Ticket\Admin\AdminCreateNotification;
use App\Notifications\Ticket\Admin\AdminReplyNotification;
use App\Notifications\Ticket\User\CreateNotification;
use App\Settings\LocaleSettings;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Notification;
@ -18,12 +19,13 @@ use Illuminate\Support\Str;
class TicketsController extends Controller
{
public function index()
public function index(LocaleSettings $locale_settings)
{
$tickets = Ticket::where('user_id', Auth::user()->id)->paginate(10);
$ticketcategories = TicketCategory::all();
return view('ticket.index', compact('tickets', 'ticketcategories'));
return view('ticket.index', [
'tickets' => Ticket::where('user_id', Auth::user()->id)->paginate(10),
'ticketcategories' => TicketCategory::all(),
'locale_datatables' => $locale_settings->datatables
]);
}
public function store(Request $request)

View file

@ -6,17 +6,17 @@ use Spatie\LaravelSettings\Settings;
class DiscordSettings extends Settings
{
public string $bot_token;
public ?string $bot_token;
public string $client_id;
public ?string $client_id;
public string $client_secret;
public ?string $client_secret;
public int $guild_id;
public ?string $guild_id;
public string $invite_url;
public ?string $invite_url;
public int $role_id;
public ?string $role_id;
public static function group(): string
{

View file

@ -0,0 +1,17 @@
<?php
namespace app\Settings;
use Spatie\LaravelSettings\Settings;
class TicketSettings extends Settings
{
public bool $enabled;
public string $notify;
public static function group(): string
{
return 'ticket';
}
}

View file

@ -22,6 +22,8 @@ class WebsiteSettings extends Settings
public string $seo_description;
public bool $enable_login_logo;
public static function group(): string
{
return 'website';

View file

@ -210,9 +210,8 @@ return [
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
Yajra\DataTables\DataTablesServiceProvider::class,
KKomelin\TranslatableStringExporter\Providers\ExporterServiceProvider::class,
Biscolab\ReCaptcha\ReCaptchaServiceProvider::class,
],
/*

View file

@ -13,9 +13,9 @@ class CreateDiscordSettings extends SettingsMigration
$this->migrator->addEncrypted('discord.bot_token', $table_exists ? $this->getOldValue('SETTINGS::DISCORD:BOT_TOKEN'): '');
$this->migrator->addEncrypted('discord.client_id', $table_exists ? $this->getOldValue('SETTINGS::DISCORD:CLIENT_ID'): '');
$this->migrator->addEncrypted('discord.client_secret', $table_exists ? $this->getOldValue('SETTINGS::DISCORD:CLIENT_SECRET'): '');
$this->migrator->add('discord.guild_id', $table_exists ? $this->getOldValue('SETTINGS::DISCORD:GUILD_ID'): null);
$this->migrator->add('discord.guild_id', $table_exists ? $this->getOldValue('SETTINGS::DISCORD:GUILD_ID'): '');
$this->migrator->add('discord.invite_url', $table_exists ? $this->getOldValue('SETTINGS::DISCORD:INVITE_URL'): '');
$this->migrator->add('discord.role_id', $table_exists ? $this->getOldValue('SETTINGS::DISCORD:ROLE_ID'): null);
$this->migrator->add('discord.role_id', $table_exists ? $this->getOldValue('SETTINGS::DISCORD:ROLE_ID'): '');
}
public function getOldValue(string $key)

View file

@ -23,7 +23,7 @@ class CreateWebsiteSettings extends SettingsMigration
$this->migrator->add('website.useful_links_enabled', $table_exists ? $this->getOldValue("SETTINGS::SYSTEM:USEFULLINKS_ENABLED") : true);
$this->migrator->add('website.seo_title', $table_exists ? $this->getOldValue("SETTINGS::SYSTEM:SEO_TITLE") : 'ControlPanel.gg');
$this->migrator->add('website.seo_description', $table_exists ? $this->getOldValue("SETTINGS::SYSTEM:SEO_DESCRIPTION") : 'Billing software for Pterodactyl Panel.');
$this->migrator->add('website.enable_login_logo', true);
}
public function getOldValue(string $key)

View file

@ -0,0 +1,34 @@
<?php
use Spatie\LaravelSettings\Migrations\SettingsMigration;
use Illuminate\Support\Facades\DB;
class CreateTicketSettings extends SettingsMigration
{
public function up(): void
{
$table_exists = DB::table('settings_old')->exists();
// Get the user-set configuration values from the old table.
$this->migrator->add('ticket.enabled', true);
$this->migrator->add('ticket.notify', $table_exists ? $this->getOldValue('SETTINGS::TICKET:NOTIFY') : 'all');
}
public function getOldValue(string $key)
{
// Always get the first value of the key.
$old_value = DB::table('settings_old')->where('key', '=', $key)->get(['value', 'type'])->first();
// Handle the old values to return without it being a string in all cases.
if ($old_value->type === "string" || $old_value->type === "text") {
return $old_value->value;
}
if ($old_value->type === "boolean") {
return filter_var($old_value->value, FILTER_VALIDATE_BOOL);
}
return filter_var($old_value->value, FILTER_VALIDATE_INT);
}
}

View file

@ -106,15 +106,14 @@ Route::middleware(['auth', 'checkSuspended'])->group(function () {
Route::post('changelocale', [TranslationController::class, 'changeLocale'])->name('changeLocale');
//ticket user
if (config('SETTINGS::TICKET:ENABLED')) {
Route::get('ticket', [TicketsController::class, 'index'])->name('ticket.index');
Route::get('ticket/datatable', [TicketsController::class, 'datatable'])->name('ticket.datatable');
Route::get('ticket/new', [TicketsController::class, 'create'])->name('ticket.new');
Route::post('ticket/new', [TicketsController::class, 'store'])->middleware(['throttle:ticket-new'])->name('ticket.new.store');
Route::get('ticket/show/{ticket_id}', [TicketsController::class, 'show'])->name('ticket.show');
Route::post('ticket/reply', [TicketsController::class, 'reply'])->middleware(['throttle:ticket-reply'])->name('ticket.reply');
Route::post('ticket/status/{ticket_id}', [TicketsController::class, 'changeStatus'])->name('ticket.changeStatus');
}
Route::get('ticket', [TicketsController::class, 'index'])->name('ticket.index');
Route::get('ticket/datatable', [TicketsController::class, 'datatable'])->name('ticket.datatable');
Route::get('ticket/new', [TicketsController::class, 'create'])->name('ticket.new');
Route::post('ticket/new', [TicketsController::class, 'store'])->middleware(['throttle:ticket-new'])->name('ticket.new.store');
Route::get('ticket/show/{ticket_id}', [TicketsController::class, 'show'])->name('ticket.show');
Route::post('ticket/reply', [TicketsController::class, 'reply'])->middleware(['throttle:ticket-reply'])->name('ticket.reply');
Route::post('ticket/close/{ticket_id}', [TicketsController::class, 'close'])->name('ticket.close');
//admin
Route::prefix('admin')->name('admin.')->middleware('admin')->group(function () {

View file

@ -65,7 +65,7 @@
document.addEventListener("DOMContentLoaded", function () {
$('#datatable').DataTable({
language: {
url: '//cdn.datatables.net/plug-ins/1.11.3/i18n/{{config("SETTINGS::LOCALE:DATATABLES")}}.json'
url: '//cdn.datatables.net/plug-ins/1.11.3/i18n/{{ $locale_datatables }}.json'
},
processing: true,
serverSide: true,

View file

@ -68,7 +68,7 @@
document.addEventListener("DOMContentLoaded", function () {
$('#datatable').DataTable({
language: {
url: '//cdn.datatables.net/plug-ins/1.11.3/i18n/{{config("SETTINGS::LOCALE:DATATABLES")}}.json'
url: '//cdn.datatables.net/plug-ins/1.11.3/i18n/{{ $locale_datatables }}.json'
},
processing: true,
serverSide: true,

View file

@ -67,7 +67,7 @@
document.addEventListener("DOMContentLoaded", function() {
$('#datatable').DataTable({
language: {
url: '//cdn.datatables.net/plug-ins/1.11.3/i18n/{{config("SETTINGS::LOCALE:DATATABLES")}}.json'
url: '//cdn.datatables.net/plug-ins/1.11.3/i18n/{{ $locale_datatables }}.json'
},
processing: true,
serverSide: true,

View file

@ -149,7 +149,7 @@
</div>
<div class="form-group">
<label for="minimum_credits">{{__('Minimum')}} {{ CREDITS_DISPLAY_NAME }} <i
<label for="minimum_credits">{{__('Minimum')}} {{ $credits_display_name }} <i
data-toggle="popover" data-trigger="hover"
data-content="{{__('Setting to -1 will use the value from configuration.')}}"
class="fas fa-info-circle"></i></label>

View file

@ -153,7 +153,7 @@
@enderror
</div>
<div class="form-group">
<label for="minimum_credits">{{__('Minimum')}} {{ CREDITS_DISPLAY_NAME }} <i
<label for="minimum_credits">{{__('Minimum')}} {{ $credits_display_name }} <i
data-toggle="popover" data-trigger="hover"
data-content="{{__('Setting to -1 will use the value from configuration.')}}"
class="fas fa-info-circle"></i></label>

View file

@ -79,7 +79,7 @@
document.addEventListener("DOMContentLoaded", function () {
$("#datatable").DataTable({
language: {
url: '//cdn.datatables.net/plug-ins/1.11.3/i18n/{{config("SETTINGS::LOCALE:DATATABLES")}}.json'
url: '//cdn.datatables.net/plug-ins/1.11.3/i18n/{{ $locale_datatables }}.json'
},
processing: true,
serverSide: true,

View file

@ -87,7 +87,7 @@
<div class="col-lg-6">
<div class="row">
<div class="col-lg-4">
<label>{{__('Minimum')}} {{ CREDITS_DISPLAY_NAME }}</label>
<label>{{__('Minimum')}} {{ $credits_display_name }}</label>
</div>
<div class="col-lg-8">
<span style="max-width: 250px;" class="d-inline-block text-truncate">

View file

@ -34,20 +34,59 @@
</div>
</div>
<div class="card-body table-responsive">
@include('admin.servers.table')
{{-- <div class="float-right">--}}
{{-- {!! $servers->links() !!}--}}
{{-- </div>--}}
<table id="datatable" class="table table-striped">
<thead>
<tr>
<th width="20"></th>
<th>{{__('Name')}}</th>
<th>{{__('User')}}</th>
<th>{{__('Server id')}}</th>
<th>{{__('Config')}}</th>
<th>{{__('Suspended at')}}</th>
<th>{{__('Created at')}}</th>
<th></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
<!-- END CUSTOM CONTENT -->
</div>
</section>
<!-- END CONTENT -->
@endsection
<script>
function submitResult() {
return confirm("{{__('Are you sure you wish to delete?')}}") !== false;
}
document.addEventListener("DOMContentLoaded", function () {
$('#datatable').DataTable({
language: {
url: '//cdn.datatables.net/plug-ins/1.11.3/i18n/{{ $locale_datatables }}.json'
},
processing: true,
serverSide: true,
stateSave: true,
ajax: "{{route('admin.servers.datatable')}}{{$filter ?? ''}}",
order: [[ 5, "desc" ]],
columns: [
{data: 'status' , name : 'servers.suspended'},
{data: 'name'},
{data: 'user' , name : 'user.name'},
{data: 'identifier'},
{data: 'resources' , name : 'product.name'},
{data: 'suspended'},
{data: 'created_at'},
{data: 'actions' , sortable : false},
],
fnDrawCallback: function( oSettings ) {
$('[data-toggle="popover"]').popover();
}
});
});
</script>

View file

@ -83,7 +83,7 @@
document.addEventListener("DOMContentLoaded", function() {
$('#datatable').DataTable({
language: {
url: '//cdn.datatables.net/plug-ins/1.11.3/i18n/{{ config('app.datatable_locale') }}.json'
url: '//cdn.datatables.net/plug-ins/1.11.3/i18n/{{ $locale_datatables }}.json'
},
processing: true,
serverSide: true,

View file

@ -68,7 +68,7 @@
document.addEventListener("DOMContentLoaded", function () {
$('#datatable').DataTable({
language: {
url: '//cdn.datatables.net/plug-ins/1.11.3/i18n/{{config("SETTINGS::LOCALE:DATATABLES")}}.json'
url: '//cdn.datatables.net/plug-ins/1.11.3/i18n/{{ $locale_datatables }}.json'
},
processing: true,
serverSide: true,

View file

@ -75,7 +75,7 @@
document.addEventListener("DOMContentLoaded", function() {
$('#datatable').DataTable({
language: {
url: '//cdn.datatables.net/plug-ins/1.11.3/i18n/{{ config('SETTINGS::LOCALE:DATATABLES') }}.json'
url: '//cdn.datatables.net/plug-ins/1.11.3/i18n/{{ $locale_datatables }}.json'
},
processing: true,
serverSide: true, //why was this set to false before? increased loadingtimes by 10 seconds

View file

@ -70,7 +70,7 @@
document.addEventListener("DOMContentLoaded", function () {
$('#datatable').DataTable({
language: {
url: '//cdn.datatables.net/plug-ins/1.11.3/i18n/{{config("SETTINGS::LOCALE:DATATABLES")}}.json'
url: '//cdn.datatables.net/plug-ins/1.11.3/i18n/{{ $locale_datatables }}.json'
},
processing: true,
serverSide: true,

View file

@ -63,7 +63,7 @@
document.addEventListener("DOMContentLoaded", function() {
$('#datatable').DataTable({
language: {
url: '//cdn.datatables.net/plug-ins/1.11.3/i18n/{{config("SETTINGS::LOCALE:DATATABLES")}}.json'
url: '//cdn.datatables.net/plug-ins/1.11.3/i18n/{{ $locale_datatables }}.json'
},
processing: true,
serverSide: true,

View file

@ -1,20 +1,20 @@
@extends('layouts.app')
@section('content')
@php($website_settings = app(App\Settings\WebsiteSettings::class))
<body class="hold-transition dark-mode login-page">
<div class="login-box">
<!-- /.login-logo -->
<div class="card card-outline card-primary">
<div class="card-header text-center">
<a href="{{ route('welcome') }}" class="h1"><b
<a href="{{ route('welcome') }}" class="h1 mb-2"><b
class="mr-1">{{ config('app.name', 'Laravel') }}</b></a>
@if (config('SETTINGS::SYSTEM:ENABLE_LOGIN_LOGO'))
@if ($website_settings->enable_login_logo)
<img src="{{ \Illuminate\Support\Facades\Storage::disk('public')->exists('logo.png') ? asset('storage/logo.png') : asset('images/controlpanel_logo.png') }}"
alt="{{ config('app.name', 'Controlpanel.gg') }} Logo" style="opacity: .8;max-width:100%">
alt="{{ config('app.name', 'Controlpanel.gg') }} Logo" style="opacity: .8; max-width:100%; height: 150px; margin-top: 10px;">
@endif
</div>
<div class="card-body">
<div class="card-body pt-0">
<p class="login-box-msg">{{ __('Sign in to start your session') }}</p>
@if (session('message'))
@ -66,7 +66,7 @@
</span>
@enderror
</div>
@if (config('SETTINGS::RECAPTCHA:ENABLED') == 'true')
@if (app(App\Settings\GeneralSettings::class)->recaptcha_enabled)
<div class="input-group mb-3">
{!! htmlFormSnippet() !!}
@error('g-recaptcha-response')
@ -94,17 +94,6 @@
<!-- /.col -->
</div>
</form>
{{-- <div class="social-auth-links text-center mt-2 mb-3"> --}}
{{-- <a href="#" class="btn btn-block btn-primary"> --}}
{{-- <i class="fab fa-facebook mr-2"></i> Sign in using Facebook --}}
{{-- </a> --}}
{{-- <a href="#" class="btn btn-block btn-danger"> --}}
{{-- <i class="fab fa-google-plus mr-2"></i> Sign in using Google+ --}}
{{-- </a> --}}
{{-- </div> --}}
<!-- /.social-auth-links -->
<p class="mb-1">
@if (Route::has('password.request'))
<a class="" href="{{ route('password.request') }}">
@ -125,13 +114,13 @@
{{-- imprint and privacy policy --}}
<div class="fixed-bottom ">
<div class="container text-center">
@if (config('SETTINGS::SYSTEM:SHOW_IMPRINT') == "true")
@if ($website_settings->show_imprint)
<a href="{{ route('imprint') }}"><strong>{{ __('Imprint') }}</strong></a> |
@endif
@if (config('SETTINGS::SYSTEM:SHOW_PRIVACY') == "true")
@if ($website_settings->show_privacy)
<a href="{{ route('privacy') }}"><strong>{{ __('Privacy') }}</strong></a>
@endif
@if (config('SETTINGS::SYSTEM:SHOW_TOS') == "true")
@if ($website_settings->show_tos)
| <a target="_blank" href="{{ route('tos') }}"><strong>{{ __('Terms of Service') }}</strong></a>
@endif
</div>

View file

@ -36,8 +36,7 @@
</span>
@enderror
</div>
@if (config('SETTINGS::RECAPTCHA:ENABLED') == 'true')
@if (app(App\Settings\GeneralSettings::class)->recaptcha_enabled)
<div class="input-group mb-3">
{!! htmlFormSnippet() !!}
@error('g-recaptcha-response')
@ -70,13 +69,14 @@
{{-- imprint and privacy policy --}}
<div class="fixed-bottom ">
<div class="container text-center">
@if (config('SETTINGS::SYSTEM:SHOW_IMPRINT') == "true")
@php($website_settings = app(App\Settings\WebsiteSettings::class))
@if ($website_settings->show_imprint)
<a href="{{ route('imprint') }}"><strong>{{ __('Imprint') }}</strong></a> |
@endif
@if (config('SETTINGS::SYSTEM:SHOW_PRIVACY') == "true")
@if ($website_settings->show_privacy)
<a href="{{ route('privacy') }}"><strong>{{ __('Privacy') }}</strong></a>
@endif
@if (config('SETTINGS::SYSTEM:SHOW_TOS') == "true")
@if ($website_settings->show_tos)
| <a target="_blank" href="{{ route('tos') }}"><strong>{{ __('Terms of Service') }}</strong></a>
@endif
</div>

View file

@ -81,13 +81,14 @@
{{-- imprint and privacy policy --}}
<div class="fixed-bottom ">
<div class="container text-center">
@if (config('SETTINGS::SYSTEM:SHOW_IMPRINT') == "true")
@php($website_settings = app(App\Settings\WebsiteSettings::class))
@if ($website_settings->show_imprint)
<a href="{{ route('imprint') }}"><strong>{{ __('Imprint') }}</strong></a> |
@endif
@if (config('SETTINGS::SYSTEM:SHOW_PRIVACY') == "true")
@if ($website_settings->show_privacy)
<a href="{{ route('privacy') }}"><strong>{{ __('Privacy') }}</strong></a>
@endif
@if (config('SETTINGS::SYSTEM:SHOW_TOS') == "true")
@if ($website_settings->show_tos)
| <a target="_blank" href="{{ route('tos') }}"><strong>{{ __('Terms of Service') }}</strong></a>
@endif
</div>

View file

@ -10,7 +10,7 @@
class="mr-1">{{ config('app.name', 'Laravel') }}</b></a>
</div>
<div class="card-body">
@if (!config('SETTINGS::SYSTEM:CREATION_OF_NEW_USERS'))
@if (!app(App\Settings\UserSettings::class)->creation_enabled)
<div class="alert alert-warning p-2 m-2">
<h5><i class="icon fas fa-exclamation-circle"></i> {{ __('Warning!') }}</h5>
{{ __('The system administrator has blocked the registration of new users') }}
@ -108,7 +108,7 @@
</div>
</div>
</div>
@if (config('SETTINGS::REFERRAL::ENABLED') == 'true')
@if (app(App\Settings\ReferralSettings::class)->enabled)
<div class="input-group mb-3">
<input type="text" value="{{ Request::get('ref') }}" class="form-control"
name="referral_code"
@ -120,7 +120,7 @@
</div>
</div>
@endif
@if (config('SETTINGS::RECAPTCHA:ENABLED') == 'true')
@if (app(App\Settings\GeneralSettings::class)->recaptcha_enabled)
<div class="input-group mb-3">
{!! htmlFormSnippet() !!}
@error('g-recaptcha-response')
@ -133,8 +133,8 @@
<div class="row">
<div class="col-12">
@if (config('SETTINGS::SYSTEM:SHOW_TOS'))
@php($website_settings = app(App\Settings\WebsiteSettings::class))
@if ($website_settings->show_tos)
<div class="icheck-primary">
<input type="checkbox" id="agreeTerms" name="terms" value="agree">
<label for="agreeTerms">
@ -146,7 +146,6 @@
<small><strong>{{ $message }}</strong></small>
</span>
@enderror
@endif
</div>
</div>
@ -157,18 +156,6 @@
<!-- /.col -->
</div>
</form>
{{-- <div class="social-auth-links text-center"> --}}
{{-- <a href="#" class="btn btn-block btn-primary"> --}}
{{-- <i class="fab fa-facebook mr-2"></i> --}}
{{-- Sign up using Facebook --}}
{{-- </a> --}}
{{-- <a href="#" class="btn btn-block btn-danger"> --}}
{{-- <i class="fab fa-google-plus mr-2"></i> --}}
{{-- Sign up using Google+ --}}
{{-- </a> --}}
{{-- </div> --}}
<a href="{{ route('login') }}" class="text-center">{{ __('I already have a membership') }}</a>
</div>
<!-- /.form-box -->
@ -179,15 +166,15 @@
{{-- imprint and privacy policy --}}
<div class="fixed-bottom ">
<div class="container text-center">
@if (config('SETTINGS::SYSTEM:SHOW_IMPRINT') == "true")
<a href="{{ route('imprint') }}"><strong>{{ __('Imprint') }}</strong></a> |
@endif
@if (config('SETTINGS::SYSTEM:SHOW_PRIVACY') == "true")
<a href="{{ route('privacy') }}"><strong>{{ __('Privacy') }}</strong></a>
@endif
@if (config('SETTINGS::SYSTEM:SHOW_TOS') == "true")
| <a target="_blank" href="{{ route('tos') }}"><strong>{{ __('Terms of Service') }}</strong></a>
@endif
@if ($website_settings->show_imprint)
<a href="{{ route('imprint') }}"><strong>{{ __('Imprint') }}</strong></a> |
@endif
@if ($website_settings->show_privacy)
<a href="{{ route('privacy') }}"><strong>{{ __('Privacy') }}</strong></a>
@endif
@if ($website_settings->show_tos)
| <a target="_blank" href="{{ route('tos') }}"><strong>{{ __('Terms of Service') }}</strong></a>
@endif
</div>
</div>
</body>

View file

@ -2,10 +2,11 @@
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
@php($website_settings = app(App\Settings\WebsiteSettings::class))
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta content="{{ config('SETTINGS::SYSTEM:SEO_TITLE') }}" property="og:title">
<meta content="{{ config('SETTINGS::SYSTEM:SEO_DESCRIPTION') }}" property="og:description">
<meta content="{{ $website_settings->seo_title }}" property="og:title">
<meta content="{{ $website_settings->seo_description }}" property="og:description">
<meta content='{{ \Illuminate\Support\Facades\Storage::disk('public')->exists('logo.png') ? asset('storage/logo.png') : asset('images/controlpanel_logo.png') }}' property="og:image">
<!-- CSRF Token -->
@ -27,7 +28,7 @@
<noscript>
<link rel="stylesheet" href="{{ asset('plugins/fontawesome-free/css/all.min.css') }}">
</noscript>
@if (config('SETTINGS::RECAPTCHA:ENABLED') == 'true')
@if (app(App\Settings\GeneralSettings::class)->recaptcha_enabled)
{!! htmlScriptTagJsApi() !!}
@endif
@vite('themes/default/sass/app.scss')

View file

@ -2,12 +2,13 @@
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
@php($website_settings = app(App\Settings\WebsiteSettings::class))
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- CSRF Token -->
<meta name="csrf-token" content="{{ csrf_token() }}">
<meta content="{{ config('SETTINGS::SYSTEM:SEO_TITLE') }}" property="og:title">
<meta content="{{ config('SETTINGS::SYSTEM:SEO_DESCRIPTION') }}" property="og:description">
<meta content="{{ $website_settings->seo_title }}" property="og:title">
<meta content="{{ $website_settings->seo_description }}" property="og:description">
<meta content='{{ \Illuminate\Support\Facades\Storage::disk('public')->exists('logo.png') ? asset('storage/logo.png') : asset('images/controlpanel_logo.png') }}' property="og:image">
<title>{{ config('app.name', 'Laravel') }}</title>
<link rel="icon"
@ -54,15 +55,16 @@
<a href="{{ route('home') }}" class="nav-link"><i
class="fas fa-home mr-2"></i>{{ __('Home') }}</a>
</li>
@if (config('SETTINGS::DISCORD:INVITE_URL'))
@if (!empty($discord_settings->invite_url))
<li class="nav-item d-none d-sm-inline-block">
<a href="{{ config('SETTINGS::DISCORD:INVITE_URL') }}" class="nav-link" target="__blank"><i
<a href="{{ $discord_settings->invite_url }}" class="nav-link" target="__blank"><i
class="fab fa-discord mr-2"></i>{{ __('Discord') }}</a>
</li>
@endif
<!-- Language Selection -->
@if (config('SETTINGS::LOCALE:CLIENTS_CAN_CHANGE') == 'true')
@php($locale_settings = app(App\Settings\LocaleSettings::class))
@if ($locale_settings->clients_can_change)
<li class="nav-item dropdown">
<a class="nav-link" href="#" id="languageDropdown" role="button" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
@ -74,7 +76,7 @@
aria-labelledby="changeLocale">
<form method="post" action="{{ route('changeLocale') }}" class="nav-item text-center">
@csrf
@foreach (explode(',', config('SETTINGS::LOCALE:AVAILABLE')) as $key)
@foreach (explode(',', $locale_settings->available) as $key)
<button class="dropdown-item" name="inputLocale" value="{{ $key }}">
{{ __($key) }}
</button>
@ -243,7 +245,8 @@
</a>
</li>
@endif
@if (config('SETTINGS::TICKET:ENABLED'))
@php($ticket_enabled = app(App\Settings\TicketSettings::class)->enabled)
@if ($ticket_enabled)
<li class="nav-item">
<a href="{{ route('ticket.index') }}"
class="nav-link @if (Request::routeIs('ticket.*')) active @endif">
@ -253,7 +256,7 @@
</li>
@endif
@if ((Auth::user()->role == 'admin' || Auth::user()->role == 'moderator') && config('SETTINGS::TICKET:ENABLED'))
@if ((Auth::user()->role == 'admin' || Auth::user()->role == 'moderator') && $ticket_enabled)
<li class="nav-header">{{ __('Moderation') }}</li>
<li class="nav-item">
@ -448,13 +451,13 @@
{{-- Show imprint and privacy link --}}
<div class="float-right d-none d-sm-inline-block">
@if (config('SETTINGS::SYSTEM:SHOW_IMPRINT') == "true")
@if ($website_settings->show_imprint)
<a target="_blank" href="{{ route('imprint') }}"><strong>{{ __('Imprint') }}</strong></a> |
@endif
@if (config('SETTINGS::SYSTEM:SHOW_PRIVACY') == "true")
@if ($website_settings->show_privacy)
<a target="_blank" href="{{ route('privacy') }}"><strong>{{ __('Privacy') }}</strong></a>
@endif
@if (config('SETTINGS::SYSTEM:SHOW_TOS') == "true")
@if ($website_settings->show_tos)
| <a target="_blank" href="{{ route('tos') }}"><strong>{{ __('Terms of Service') }}</strong></a>
@endif
</div>

View file

@ -90,7 +90,7 @@
document.addEventListener("DOMContentLoaded", function () {
$('#datatable').DataTable({
language: {
url: '//cdn.datatables.net/plug-ins/1.11.3/i18n/{{config("SETTINGS::LOCALE:DATATABLES")}}.json'
url: '//cdn.datatables.net/plug-ins/1.11.3/i18n/{{ $locale_datatables }}.json'
},
processing: true,
serverSide: true,

View file

@ -67,7 +67,7 @@
document.addEventListener("DOMContentLoaded", function () {
$('#datatable').DataTable({
language: {
url: '//cdn.datatables.net/plug-ins/1.11.3/i18n/{{config("SETTINGS::LOCALE:DATATABLES")}}.json'
url: '//cdn.datatables.net/plug-ins/1.11.3/i18n/{{ $locale_datatables }}.json'
},
processing: true,
serverSide: true,

View file

@ -80,7 +80,7 @@
document.addEventListener("DOMContentLoaded", function () {
$('#datatable').DataTable({
language: {
url: '//cdn.datatables.net/plug-ins/1.11.3/i18n/{{config("SETTINGS::LOCALE:DATATABLES")}}.json'
url: '//cdn.datatables.net/plug-ins/1.11.3/i18n/{{ $locale_datatables }}.json'
},
processing: true,
serverSide: true,