source: resources/views/dashboard/users/index.blade.php@ 24a616f

develop
Last change on this file since 24a616f was 24a616f, checked in by Berat Kjufliju <kufliju@…>, 3 years ago

added documents crud, added last_seen_to_user, edited views

  • Property mode set to 100644
File size: 5.7 KB
RevLine 
[194a359]1@extends('layouts.app')
2
3@section("title", "Users")
4
5@section('pageTitle', 'User List')
6
7@section('head')
8 <!-- Datatable -->
9 <link rel="stylesheet" href="{{ url('vendors/dataTable/dataTables.min.css') }}" type="text/css">
[24a616f]10
[194a359]11@endsection
12
13@section('content')
14
15 <div class="page-header justify-content-between">
16 <nav aria-label="breadcrumb" class="d-flex align-items-start">
17 <ol class="breadcrumb">
18 <li class="breadcrumb-item">
19 <a href="{{ url('dashboard.users') }}">Users</a>
20 </li>
21 <li class="breadcrumb-item active" aria-current="page">User List</li>
22 </ol>
23 </nav>
24 <div class="dropdown">
25 <a href="{{ route("dashboard.users.create") }}" class="btn btn-primary text-white">
26 Add user
27 </a>
28 </div>
29 </div>
30
31 <div class="row">
32 <div class="col-md-12">
33 <div class="card">
34 <div class="card-body">
35 <div class="table-responsive">
36 <table id="user-list" class="table table-lg">
37 <thead>
38 <tr>
[24a616f]39 <th>
40 <div class="custom-control custom-checkbox">
41 <input type="checkbox" class="custom-control-input" id="user-list-select-all">
42 <label class="custom-control-label" for="user-list-select-all"></label>
43 </div>
44 </th>
45 <th>State</th>
[194a359]46 <th>Username</th>
47 <th>Name</th>
48 <th>Email</th>
49 <th>Phone Number</th>
[24a616f]50 <th>Created at</th>
[194a359]51 <th>Role</th>
[24a616f]52 <th>Status</th>
53 <th>Last seen</th>
[194a359]54 <th>Actions</th>
55 </tr>
56 </thead>
57 <tbody>
58 @foreach($users as $user)
59 <tr>
[24a616f]60 <td></td>
[194a359]61 <td>
62 @if($user->is_confirmed)
63 @if ($user->is_active)
64 <span class="badge bg-success-bright text-success">Active</span>
65 @else
66 <span class="badge bg-danger-bright text-danger">Blocked</span>
67 @endif
68 @else
69 <span class="badge bg-warning-bright text-warning">New user</span>
70 @endif
71 </td>
72 <td>
[24a616f]73 @include('dashboard.partials.avatar')
74 {{$user->username}}
[194a359]75 </td>
[24a616f]76 <td>{{$user->name .' '. $user->surname}}</td>
[194a359]77 <td>{{$user->email}}</td>
78 <td>{{$user->mobile_number}}</td>
79 <td>{{ date('d.m.Y', strtotime($user->created_at)) }}</td>
80 <td>{{ $user->role->name }}</td>
[24a616f]81 <td>
82 @if(Cache::has('is_online' . $user->id))
83 <span class="text-success">Online</span>
84 @else
85 <span class="text-secondary">Offline</span>
86 @endif
87 </td>
88 @if($user->last_seen==NULL)
89 <td>Never logged in</td>
90 @else
91 <td>{{ \Carbon\Carbon::parse($user->last_seen)->diffForHumans() }}</td>
92 @endif
[194a359]93 @if($user->hasRole("Referent") && $user->is_confirmed)
94 <td>
95 <a href="{{ route("dashboard.users.edit", ["id" => $user->id]) }}" class="text-secondary" data-toggle="tooltip" title="Edit">
96 <i class="ti-pencil"></i>
97 </a>
98 <a href="javascript:void(0)" class="text-danger ml-2" data-action="{{ route("dashboard.users.destroy", ["id" => $user->id]) }}" data-method="delete" title="Delete">
99 <i class="ti-trash"></i>
100 </a>
101 </td>
102 @else
103 <td>Not available</td>
104 @endif
105 </tr>
106 @endforeach
107
108
109 </tbody>
110 </table>
111 </div>
112 </div>
113 </div>
114 </div>
115 </div>
116
117@endsection
118
119@section('script')
[24a616f]120 <script src="{{ url('assets/js/examples/pages/user-list.js') }}"></script>
[194a359]121 <!-- Datatable -->
122 <script src="{{ url('vendors/dataTable/dataTables.min.js') }}"></script>
123@endsection
Note: See TracBrowser for help on using the repository browser.