fix: 🐛 Different badge colors #703

This commit is contained in:
IceToast 2023-04-04 02:04:41 +02:00
parent 91476d2701
commit f68b1cc8ca
No known key found for this signature in database
GPG key ID: 1464353E063A5B97

View file

@ -6,14 +6,14 @@
<div class="container-fluid"> <div class="container-fluid">
<div class="row mb-2"> <div class="row mb-2">
<div class="col-sm-6"> <div class="col-sm-6">
<h1>{{__('Users')}}</h1> <h1>{{ __('Users') }}</h1>
</div> </div>
<div class="col-sm-6"> <div class="col-sm-6">
<ol class="breadcrumb float-sm-right"> <ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="{{route('home')}}">{{__('Dashboard')}}</a></li> <li class="breadcrumb-item"><a href="{{ route('home') }}">{{ __('Dashboard') }}</a></li>
<li class="breadcrumb-item"><a href="{{route('admin.users.index')}}">{{__('Users')}}</a></li> <li class="breadcrumb-item"><a href="{{ route('admin.users.index') }}">{{ __('Users') }}</a></li>
<li class="breadcrumb-item"><a class="text-muted" <li class="breadcrumb-item"><a class="text-muted"
href="{{route('admin.users.show' , $user->id)}}">{{__('Show')}}</a> href="{{ route('admin.users.show', $user->id) }}">{{ __('Show') }}</a>
</li> </li>
</ol> </ol>
</div> </div>
@ -26,18 +26,18 @@
<section class="content"> <section class="content">
<div class="container-fluid"> <div class="container-fluid">
@if($user->discordUser) @if ($user->discordUser)
<div class="row"> <div class="row">
<div class="col-lg-4 col-md-6"> <div class="col-lg-4 col-md-6">
<div class="small-box bg-dark"> <div class="small-box bg-dark">
<div class="d-flex justify-content-between"> <div class="d-flex justify-content-between">
<div class="p-3"> <div class="p-3">
<h3>{{$user->discordUser->username}} <sup>{{$user->discordUser->locale}}</sup></h3> <h3>{{ $user->discordUser->username }} <sup>{{ $user->discordUser->locale }}</sup></h3>
<p>{{$user->discordUser->id}} <p>{{ $user->discordUser->id }}
</p> </p>
</div> </div>
<div class="p-3"><img width="100px" height="100px" class="rounded-circle" <div class="p-3"><img width="100px" height="100px" class="rounded-circle"
src="{{$user->discordUser->getAvatar()}}" alt="avatar"></div> src="{{ $user->discordUser->getAvatar() }}" alt="avatar"></div>
</div> </div>
<div class="small-box-footer"> <div class="small-box-footer">
<i class="fab fa-discord mr-1"></i>Discord <i class="fab fa-discord mr-1"></i>Discord
@ -50,7 +50,7 @@
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
<h5 class="card-title"><i class="fas fa-users mr-2"></i>{{__('Users')}}</h5> <h5 class="card-title"><i class="fas fa-users mr-2"></i>{{ __('Users') }}</h5>
</div> </div>
<div class="card-body"> <div class="card-body">
<div class="row"> <div class="row">
@ -58,11 +58,11 @@
<div class="col-lg-6"> <div class="col-lg-6">
<div class="row"> <div class="row">
<div class="col-lg-4"> <div class="col-lg-4">
<label>{{__('ID')}}</label> <label>{{ __('ID') }}</label>
</div> </div>
<div class="col-lg-8"> <div class="col-lg-8">
<span style="max-width: 250px;" class="d-inline-block text-truncate"> <span style="max-width: 250px;" class="d-inline-block text-truncate">
{{$user->id}} {{ $user->id }}
</span> </span>
</div> </div>
</div> </div>
@ -71,12 +71,20 @@
<div class="col-lg-6"> <div class="col-lg-6">
<div class="row"> <div class="row">
<div class="col-lg-4"> <div class="col-lg-4">
<label>{{__('Role')}}</label> <label>{{ __('Role') }}</label>
</div> </div>
<div class="col-lg-8"> <div class="col-lg-8">
<span style="max-width: 250px;" <span style="max-width: 250px;"
class="d-inline-block text-truncate badge {{$user->role == 'admin' || $user->role == 'mod' ? 'badge-info' : 'badge-secondary'}}"> class="d-inline-block text-truncate badge
{{$user->role}} @if ($user->role == 'admin') badge-danger
@elseif ($user->role == 'moderator')
badge-info
@elseif ($user->role == 'client')
badge-success
@else
badge-secondary @endif
">
{{ $user->role }}
</span> </span>
</div> </div>
</div> </div>
@ -85,11 +93,11 @@
<div class="col-lg-6"> <div class="col-lg-6">
<div class="row"> <div class="row">
<div class="col-lg-4"> <div class="col-lg-4">
<label>{{__('Pterodactyl ID')}}</label> <label>{{ __('Pterodactyl ID') }}</label>
</div> </div>
<div class="col-lg-8"> <div class="col-lg-8">
<span style="max-width: 250px;" class="d-inline-block text-truncate"> <span style="max-width: 250px;" class="d-inline-block text-truncate">
{{$user->pterodactyl_id}} {{ $user->pterodactyl_id }}
</span> </span>
</div> </div>
</div> </div>
@ -98,11 +106,11 @@
<div class="col-lg-6"> <div class="col-lg-6">
<div class="row"> <div class="row">
<div class="col-lg-4"> <div class="col-lg-4">
<label>{{__('Email')}}</label> <label>{{ __('Email') }}</label>
</div> </div>
<div class="col-lg-8"> <div class="col-lg-8">
<span style="max-width: 250px;" class="d-inline-block text-truncate"> <span style="max-width: 250px;" class="d-inline-block text-truncate">
{{$user->email}} {{ $user->email }}
</span> </span>
</div> </div>
</div> </div>
@ -112,11 +120,11 @@
<div class="col-lg-6"> <div class="col-lg-6">
<div class="row"> <div class="row">
<div class="col-lg-4"> <div class="col-lg-4">
<label>{{__('Server limit')}}</label> <label>{{ __('Server limit') }}</label>
</div> </div>
<div class="col-lg-8"> <div class="col-lg-8">
<span style="max-width: 250px;" class="d-inline-block text-truncate"> <span style="max-width: 250px;" class="d-inline-block text-truncate">
{{$user->Servers()->count()}} / {{$user->server_limit}} {{ $user->Servers()->count() }} / {{ $user->server_limit }}
</span> </span>
</div> </div>
</div> </div>
@ -125,11 +133,11 @@
<div class="col-lg-6"> <div class="col-lg-6">
<div class="row"> <div class="row">
<div class="col-lg-4"> <div class="col-lg-4">
<label>{{__('Name')}}</label> <label>{{ __('Name') }}</label>
</div> </div>
<div class="col-lg-8"> <div class="col-lg-8">
<span style="max-width: 250px;" class="d-inline-block text-truncate"> <span style="max-width: 250px;" class="d-inline-block text-truncate">
{{$user->name}} {{ $user->name }}
</span> </span>
</div> </div>
</div> </div>
@ -138,11 +146,11 @@
<div class="col-lg-6"> <div class="col-lg-6">
<div class="row"> <div class="row">
<div class="col-lg-4"> <div class="col-lg-4">
<label>{{__('Verified')}} {{__('Email')}}</label> <label>{{ __('Verified') }} {{ __('Email') }}</label>
</div> </div>
<div class="col-lg-8"> <div class="col-lg-8">
<span style="max-width: 250px;" class="d-inline-block text-truncate"> <span style="max-width: 250px;" class="d-inline-block text-truncate">
{{$user->email_verified_at ? 'True' : 'False'}} {{ $user->email_verified_at ? 'True' : 'False' }}
</span> </span>
</div> </div>
</div> </div>
@ -155,7 +163,7 @@
</div> </div>
<div class="col-lg-8"> <div class="col-lg-8">
<span style="max-width: 250px;" class="d-inline-block text-truncate"> <span style="max-width: 250px;" class="d-inline-block text-truncate">
<i class="fas fa-coins mr-2"></i>{{$user->Credits()}} <i class="fas fa-coins mr-2"></i>{{ $user->Credits() }}
</span> </span>
</div> </div>
</div> </div>
@ -164,11 +172,11 @@
<div class="col-lg-6"> <div class="col-lg-6">
<div class="row"> <div class="row">
<div class="col-lg-4"> <div class="col-lg-4">
<label>{{__('Verified')}} {{__('Discord')}}</label> <label>{{ __('Verified') }} {{ __('Discord') }}</label>
</div> </div>
<div class="col-lg-8"> <div class="col-lg-8">
<span style="max-width: 250px;" class="d-inline-block text-truncate"> <span style="max-width: 250px;" class="d-inline-block text-truncate">
{{$user->discordUser ? 'True' : 'False'}} {{ $user->discordUser ? 'True' : 'False' }}
</span> </span>
</div> </div>
</div> </div>
@ -177,11 +185,11 @@
<div class="col-lg-6"> <div class="col-lg-6">
<div class="row"> <div class="row">
<div class="col-lg-4"> <div class="col-lg-4">
<label>{{__('Usage')}}</label> <label>{{ __('Usage') }}</label>
</div> </div>
<div class="col-lg-8"> <div class="col-lg-8">
<span style="max-width: 250px;" class="d-inline-block text-truncate"> <span style="max-width: 250px;" class="d-inline-block text-truncate">
<i class="fas fa-coins mr-2"></i>{{$user->CreditUsage()}} <i class="fas fa-coins mr-2"></i>{{ $user->CreditUsage() }}
</span> </span>
</div> </div>
</div> </div>
@ -191,11 +199,11 @@
<div class="col-lg-6"> <div class="col-lg-6">
<div class="row"> <div class="row">
<div class="col-lg-4"> <div class="col-lg-4">
<label>{{__('IP')}}</label> <label>{{ __('IP') }}</label>
</div> </div>
<div class="col-lg-8"> <div class="col-lg-8">
<span style="max-width: 250px;" class="d-inline-block text-truncate"> <span style="max-width: 250px;" class="d-inline-block text-truncate">
{{$user->ip}} {{ $user->ip }}
</span> </span>
</div> </div>
</div> </div>
@ -204,11 +212,11 @@
<div class="col-lg-6"> <div class="col-lg-6">
<div class="row"> <div class="row">
<div class="col-lg-4"> <div class="col-lg-4">
<label>{{__('Created at')}}</label> <label>{{ __('Created at') }}</label>
</div> </div>
<div class="col-lg-8"> <div class="col-lg-8">
<span style="max-width: 250px;" class="d-inline-block text-truncate"> <span style="max-width: 250px;" class="d-inline-block text-truncate">
{{$user->created_at->diffForHumans()}} {{ $user->created_at->diffForHumans() }}
</span> </span>
</div> </div>
</div> </div>
@ -220,15 +228,14 @@
<div class="col-lg-6"> <div class="col-lg-6">
<div class="row"> <div class="row">
<div class="col-lg-4"> <div class="col-lg-4">
<label>{{__('Last seen')}}</label> <label>{{ __('Last seen') }}</label>
</div> </div>
<div class="col-lg-8"> <div class="col-lg-8">
<span style="max-width: 250px;" class="d-inline-block text-truncate"> <span style="max-width: 250px;" class="d-inline-block text-truncate">
@if($user->last_seen) @if ($user->last_seen)
{{$user->last_seen->diffForHumans()}} {{ $user->last_seen->diffForHumans() }}
@else @else
<small <small class="text-muted">Null</small>
class="text-muted">Null</small>
@endif @endif
</span> </span>
</div> </div>
@ -243,19 +250,19 @@
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
<h5 class="card-title"><i class="fas fa-server mr-2"></i>{{__('Servers')}}</h5> <h5 class="card-title"><i class="fas fa-server mr-2"></i>{{ __('Servers') }}</h5>
</div> </div>
<div class="card-body table-responsive"> <div class="card-body table-responsive">
<table id="datatable" class="table table-striped"> <table id="datatable" class="table table-striped">
<thead> <thead>
<tr> <tr>
<th width="20"></th> <th width="20"></th>
<th>{{__('Name')}}</th> <th>{{ __('Name') }}</th>
<th>{{__('User')}}</th> <th>{{ __('User') }}</th>
<th>{{__('Server id')}}</th> <th>{{ __('Server id') }}</th>
<th>{{__('Config')}}</th> <th>{{ __('Config') }}</th>
<th>{{__('Suspended at')}}</th> <th>{{ __('Suspended at') }}</th>
<th>{{__('Created at')}}</th> <th>{{ __('Created at') }}</th>
<th></th> <th></th>
</tr> </tr>
</thead> </thead>
@ -267,27 +274,27 @@
</div> </div>
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
<h5 class="card-title"><i class="fas fa-user-check mr-2"></i>{{__('Referals')}} <h5 class="card-title"><i class="fas fa-user-check mr-2"></i>{{ __('Referals') }}
({{__("referral-code")}}: {{$user->referral_code}})</h5> ({{ __('referral-code') }}: {{ $user->referral_code }})</h5>
</div> </div>
<div class="card-body table-responsive"> <div class="card-body table-responsive">
@foreach($referrals as $referral) @foreach ($referrals as $referral)
<div class="col-lg-6"> <div class="col-lg-6">
<div class="row"> <div class="row">
<div class="col-lg-4"> <div class="col-lg-4">
<label>User ID: {{$referral->id}}</label> <label>User ID: {{ $referral->id }}</label>
</div> </div>
<div class="col-lg-4"> <div class="col-lg-4">
<span style="max-width: 250px;" class="d-inline-block text-truncate"> <span style="max-width: 250px;" class="d-inline-block text-truncate">
<i class="fas fa-user-check mr-2"></i><a <i class="fas fa-user-check mr-2"></i><a
href="{{route("admin.users.show",$referral->id)}}">{{$referral->name}}</a> href="{{ route('admin.users.show', $referral->id) }}">{{ $referral->name }}</a>
</span> </span>
</div> </div>
<div class="col-lg-4"> <div class="col-lg-4">
<span style="max-width: 250px;" class="d-inline-block text-truncate"> <span style="max-width: 250px;" class="d-inline-block text-truncate">
<i class="fas fa-clock mr-2"></i>{{$referral->created_at->diffForHumans()}} <i class="fas fa-clock mr-2"></i>{{ $referral->created_at->diffForHumans() }}
</span> </span>
</div> </div>
</div> </div>
@ -302,11 +309,10 @@
</div> </div>
</section> </section>
<!-- END CONTENT --> <!-- END CONTENT -->
@endsection @endsection
<script> <script>
document.addEventListener("DOMContentLoaded", function () { document.addEventListener("DOMContentLoaded", function() {
$('#datatable').DataTable({ $('#datatable').DataTable({
language: { language: {
url: '//cdn.datatables.net/plug-ins/1.11.3/i18n/{{ $locale_datatables }}.json' url: '//cdn.datatables.net/plug-ins/1.11.3/i18n/{{ $locale_datatables }}.json'
@ -314,19 +320,40 @@
processing: true, processing: true,
serverSide: true, serverSide: true,
stateSave: true, stateSave: true,
ajax: "{{route('admin.servers.datatable')}}?user={{ $user->id }}", ajax: "{{ route('admin.servers.datatable') }}?user={{ $user->id }}",
order: [[ 5, "desc" ]], order: [
columns: [ [5, "desc"]
{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 ) { 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(); $('[data-toggle="popover"]').popover();
} }
}); });