Add user directory & isolate authorisation
This commit is contained in:
@@ -63,7 +63,7 @@ I
|
||||
<form name="search" method="POST" action="{{route('searchRegisteredPLayerList')}}">
|
||||
@csrf
|
||||
<div class="input-group">
|
||||
<input type="text" name="searchTerm" class="form-control" placeholder="Username/email search">
|
||||
<input type="text" name="searchTerm" class="form-control" placeholder="Full/partial email search">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" type="submit">
|
||||
<i class="fa fa-search"></i>
|
||||
@@ -116,6 +116,7 @@ I
|
||||
<th>#</th>
|
||||
<th>IGN</th>
|
||||
<th>UUID</th>
|
||||
<th>Email</th>
|
||||
<th>Status</th>
|
||||
<th>Registration Date</th>
|
||||
<th>Actions</th>
|
||||
@@ -125,11 +126,12 @@ I
|
||||
<tbody>
|
||||
|
||||
@foreach($users as $user)
|
||||
|
||||
|
||||
<tr>
|
||||
<td>{{$user->id}}</td>
|
||||
<td>{{UUID::toUsername($user->uuid)}}</td>
|
||||
<td>{{$user->uuid}}</td>
|
||||
<td>{{ $user->email }}</td>
|
||||
<td>
|
||||
@if ($user->isBanned())
|
||||
<span class="badge badge-danger"><i class="fa fa-ban"></i> Banned</span>
|
||||
@@ -150,7 +152,7 @@ I
|
||||
</table>
|
||||
@else
|
||||
<div class="alert alert-secondary">
|
||||
|
||||
|
||||
<i class="fas fa-question"></i><span> There are no registered players!</span>
|
||||
<p>
|
||||
Registered players are those without a staff role in the team management application.
|
||||
|
@@ -49,6 +49,7 @@
|
||||
<th>Full Name</th>
|
||||
<th>UUID</th>
|
||||
<th>Rank</th>
|
||||
<th>Email</th>
|
||||
<th>Status</th>
|
||||
<th>Join Date</th>
|
||||
<th>Actions</th>
|
||||
@@ -60,7 +61,7 @@
|
||||
@foreach($users as $user)
|
||||
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>{{ $user->id }}</td>
|
||||
<td>{{$user->name}}</td>
|
||||
<td>{{UUID::toUsername($user->uuid)}}</td>
|
||||
<td>
|
||||
@@ -68,16 +69,16 @@
|
||||
<span class="badge badge-info badge-sm">{{$role->name}}</span>
|
||||
@endforeach
|
||||
</td>
|
||||
<td>{{ $user->email }}</td>
|
||||
<td><span class="badge badge-success">Active</span></td>
|
||||
<td>{{$user->created_at}}</td>
|
||||
<td>
|
||||
<button type="button" class="btn btn-sm btn-success mr-2" onclick="window.location.href='{{route('showSingleProfile', ['user' => $user->id])}}'"><i class="fa fa-eye"></i></button>
|
||||
<button type="button" class="btn btn-sm btn-warning mr-2"><i class="fas fa-pencil-alt"></i></button>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@endforeach
|
||||
|
||||
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
|
107
resources/views/dashboard/user/directory.blade.php
Normal file
107
resources/views/dashboard/user/directory.blade.php
Normal file
@@ -0,0 +1,107 @@
|
||||
@extends('adminlte::page')
|
||||
|
||||
@section('title', 'Raspberry Network | User Directory')
|
||||
|
||||
@section('content_header')
|
||||
|
||||
<h4>Users / Directory</h4>
|
||||
|
||||
@stop
|
||||
|
||||
@section('js')
|
||||
<script src="/js/app.js"></script>
|
||||
<x-global-errors></x-global-errors>
|
||||
@stop
|
||||
|
||||
@section('css')
|
||||
|
||||
<link rel="stylesheet" href="/css/directory.css" />
|
||||
|
||||
@stop
|
||||
|
||||
|
||||
@section('content')
|
||||
|
||||
@if (Auth::user()->can('profiles.view.others'))
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
@foreach ($users as $user)
|
||||
<div class="col-md-4">
|
||||
<!-- Widget: user widget style 1 -->
|
||||
<div class="card card-widget widget-user">
|
||||
<div class="widget-user-header bg-secondary">
|
||||
<h3 class="widget-user-username">{{ $user->name }}</h3>
|
||||
<h5 class="widget-user-desc">{{ $user->profile->profileShortBio }}</h5>
|
||||
</div>
|
||||
<div class="widget-user-image">
|
||||
@if($user->profile->avatarPreference == 'gravatar')
|
||||
<img class="profile-user-img elevation-2 img-fluid img-circle" src="https://gravatar.com/avatar/{{md5($user->email)}}" alt="User profile picture">
|
||||
@else
|
||||
<img class="profile-user-img elevation-2 img-fluid img-circle" src="https://crafatar.com/avatars/{{$user->uuid}}" alt="User profile picture">
|
||||
@endif
|
||||
</div>
|
||||
<div class="card-footer text-center">
|
||||
|
||||
@if (Auth::user()->is($user))
|
||||
|
||||
<div class="user-indicator mb-2">
|
||||
|
||||
<span class="badge badge-success">It's you!</span>
|
||||
|
||||
</div>
|
||||
|
||||
@endif
|
||||
|
||||
<div class="roles mb-2">
|
||||
|
||||
@foreach ($user->roles as $role)
|
||||
|
||||
<span class="badge badge-secondary mr-2">{{ucfirst($role->name)}}</span>
|
||||
|
||||
@endforeach
|
||||
|
||||
</div>
|
||||
|
||||
<button type="button" class="btn btn-sm btn-primary" onclick="window.location.href='{{ route('showSingleProfile', ['user' => $user->id]) }}'"><i class="fa fa-eye"></i> Profile</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.widget-user -->
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
</div>
|
||||
|
||||
<div clsas="row mt-4">
|
||||
|
||||
<div class="col">
|
||||
|
||||
<div class="card">
|
||||
|
||||
<div class="card-body text-center">
|
||||
|
||||
<div class="links">
|
||||
{{ $users->links() }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@else
|
||||
<div class="alert alert-danger">
|
||||
|
||||
<p>
|
||||
You do not have permission to view this page.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@stop
|
@@ -4,7 +4,7 @@
|
||||
|
||||
@section('content_header')
|
||||
|
||||
<h4>Profile</h4>
|
||||
<h4>Users / Profile / {{ $profile->user->name }}</h4>
|
||||
|
||||
@stop
|
||||
|
||||
|
Reference in New Issue
Block a user