Home screen improvements, testing for role, work on user/account models
This commit is contained in:
@@ -4,21 +4,29 @@
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
@if ($user->all_accounts()->count())
|
||||
<table class="table table-striped table-hover" id="accounts" style="width: 100%;">
|
||||
@if ($user->accounts->count())
|
||||
<table class="table table-striped table-hover" id="accounts">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Profile</th>
|
||||
<th>Name</th>
|
||||
<th>Active</th>
|
||||
<th>Services</th>
|
||||
<th class="text-right">Services</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($user->accounts as $ao)
|
||||
<tr>
|
||||
<td><a href="{{ url('r/switch/start',$ao->user_id) }}"><i class="fas fa-external-link-alt"></i></a></td>
|
||||
<td>{{ $ao->name }}</td>
|
||||
<td class="text-right">{{ $ao->services->where('active',TRUE)->count() }} <small>/{{ $ao->services->count() }}</small></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>Count {{ $user->all_accounts()->count() }}</th>
|
||||
<th colspan="3"> </th>
|
||||
<th>Count {{ $user->accounts->count() }}</th>
|
||||
<th colspan="2"> </th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
@@ -35,21 +43,12 @@
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('#accounts').DataTable( {
|
||||
ajax: {
|
||||
url: "/api/r/accounts"
|
||||
},
|
||||
columns: [
|
||||
{ data: "switch_url" },
|
||||
{ data: "name" },
|
||||
{ data: "active_display" },
|
||||
{ data: "services_count_html" }
|
||||
],
|
||||
$('#accounts').DataTable({
|
||||
language: {
|
||||
emptyTable: "No Active Clients"
|
||||
},
|
||||
order: [1, 'asc'],
|
||||
pageLength: 25
|
||||
order: [1,'asc'],
|
||||
pageLength: 10
|
||||
});
|
||||
|
||||
$('#accounts tbody').on('click','tr', function () {
|
||||
|
Reference in New Issue
Block a user