code cleanup
This commit is contained in:
parent
ebacd4b44d
commit
f4a5e735d1
|
|
@ -17,9 +17,9 @@ class AdminController extends Controller
|
||||||
public function users(Request $request)
|
public function users(Request $request)
|
||||||
{
|
{
|
||||||
if ($request->searchBy == 'name' && $request->has('q')) {
|
if ($request->searchBy == 'name' && $request->has('q')) {
|
||||||
$users = DB::table('users')->where('name', 'LIKE', '%' . $request->q . '%')->paginate(10);
|
$users = User::where('name', 'LIKE', '%' . $request->q . '%')->paginate(10);
|
||||||
} else if ($request->searchBy == 'id' && $request->has('q')) {
|
} else if ($request->searchBy == 'id' && $request->has('q')) {
|
||||||
$users = DB::table('users')->where('id', $request->q)->paginate(10);
|
$users = User::where('id', $request->q)->paginate(10);
|
||||||
} else {
|
} else {
|
||||||
$users = User::paginate(10);
|
$users = User::paginate(10);
|
||||||
}
|
}
|
||||||
|
|
@ -51,6 +51,6 @@ class AdminController extends Controller
|
||||||
'invited_by' => $invited_by,
|
'invited_by' => $invited_by,
|
||||||
];
|
];
|
||||||
|
|
||||||
return view('admin.tree')->with('data', $data);
|
return view('admin.tree')->with($data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ class FriendController extends Controller
|
||||||
public function accept($id): void
|
public function accept($id): void
|
||||||
{
|
{
|
||||||
$user = Auth::user();
|
$user = Auth::user();
|
||||||
$recipient = User::find($id);
|
$recipient = User::findOrFail($id);
|
||||||
|
|
||||||
if (!$user->hasFriendRequestFrom($recipient)) {
|
if (!$user->hasFriendRequestFrom($recipient)) {
|
||||||
abort(404);
|
abort(404);
|
||||||
|
|
@ -67,7 +67,7 @@ class FriendController extends Controller
|
||||||
public function decline($id): void
|
public function decline($id): void
|
||||||
{
|
{
|
||||||
$user = Auth::user();
|
$user = Auth::user();
|
||||||
$recipient = User::find($id);
|
$recipient = User::findOrFail($id);
|
||||||
|
|
||||||
if (!$user->hasFriendRequestFrom($recipient)) {
|
if (!$user->hasFriendRequestFrom($recipient)) {
|
||||||
abort(404);
|
abort(404);
|
||||||
|
|
@ -79,9 +79,9 @@ class FriendController extends Controller
|
||||||
public function add($id)
|
public function add($id)
|
||||||
{
|
{
|
||||||
$user = Auth::user();
|
$user = Auth::user();
|
||||||
$recipient = User::find($id);
|
$recipient = User::findOrFail($id);
|
||||||
|
|
||||||
if (!$recipient || $recipient->id == $user->id) {
|
if ($recipient->id == $user->id) {
|
||||||
abort(404);
|
abort(404);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -96,9 +96,9 @@ class FriendController extends Controller
|
||||||
public function remove($id)
|
public function remove($id)
|
||||||
{
|
{
|
||||||
$user = Auth::user();
|
$user = Auth::user();
|
||||||
$recipient = User::find($id);
|
$recipient = User::findOrFail($id);
|
||||||
|
|
||||||
if (!$recipient || $recipient->id == $user->id) {
|
if ($recipient->id == $user->id) {
|
||||||
abort(404);
|
abort(404);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ class HomeController extends Controller
|
||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
if (auth()->user()) {
|
if (Auth::check()) {
|
||||||
return redirect(route('home'));
|
return redirect(route('home'));
|
||||||
}
|
}
|
||||||
return view('index');
|
return view('index');
|
||||||
|
|
@ -43,21 +43,21 @@ class HomeController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
$query->whereIn('user_id', $friendIds)
|
$query->whereIn('user_id', $friendIds)
|
||||||
->orWhere('user_id', '=', Auth::id());
|
->orWhere('user_id', Auth::id());
|
||||||
})->orderBy('id', 'desc')->paginate(10, ["*"], "feedPage");
|
})->latest()->paginate(10, ["*"], "feedPage");
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'friends' => $friends,
|
'friends' => $friends,
|
||||||
'posts' => $posts,
|
'posts' => $posts,
|
||||||
];
|
];
|
||||||
|
|
||||||
return view('home')->with('data', $data);
|
return view('home')->with($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function feed_post(Request $request)
|
public function feed_post(Request $request)
|
||||||
{
|
{
|
||||||
$request->validate([
|
$request->validate([
|
||||||
'status' => 'required|min:3|max:100'
|
'status' => ['required', 'min:3', 'max:100']
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$post = new FeedPost;
|
$post = new FeedPost;
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,8 @@ class KeyController extends Controller
|
||||||
{
|
{
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$fetchKeys = InviteKey::where('created_by', Auth::id())->orderBy('id', 'desc')->get();
|
$fetchKeys = InviteKey::where('created_by', Auth::id())->latest()->get();
|
||||||
$activeKey = InviteKey::where('created_by', Auth::id())->orderBy('id', 'desc')->first();
|
$activeKey = InviteKey::where('created_by', Auth::id())->latest()->first();
|
||||||
|
|
||||||
if (!$fetchKeys->isEmpty()) {
|
if (!$fetchKeys->isEmpty()) {
|
||||||
if ($activeKey->created_at->addWeek()->gt(Carbon::now())) {
|
if ($activeKey->created_at->addWeek()->gt(Carbon::now())) {
|
||||||
|
|
@ -36,8 +36,8 @@ class KeyController extends Controller
|
||||||
|
|
||||||
public function create()
|
public function create()
|
||||||
{
|
{
|
||||||
$fetchKeys = InviteKey::where('created_by', Auth::id())->orderBy('id', 'desc')->get();
|
$fetchKeys = InviteKey::where('created_by', Auth::id())->latest()->get();
|
||||||
$activeKey = InviteKey::where('created_by', Auth::id())->orderBy('id', 'desc')->first();
|
$activeKey = InviteKey::where('created_by', Auth::id())->latest()->first();
|
||||||
|
|
||||||
// Validation
|
// Validation
|
||||||
if (!$fetchKeys->isEmpty() && $activeKey->created_at->addWeek()->gt(Carbon::now())) {
|
if (!$fetchKeys->isEmpty() && $activeKey->created_at->addWeek()->gt(Carbon::now())) {
|
||||||
|
|
|
||||||
|
|
@ -12,21 +12,21 @@ class MessageController extends Controller
|
||||||
{
|
{
|
||||||
public function inbox()
|
public function inbox()
|
||||||
{
|
{
|
||||||
$messages = Message::where('sendto_id', Auth::id())->where('deleted', false)->orderBy('id', 'desc')->paginate(10);
|
$messages = Message::where('sendto_id', Auth::id())->where('deleted', false)->latest()->paginate(10);
|
||||||
|
|
||||||
return view('messages.index')->with('messages', $messages);
|
return view('messages.index')->with('messages', $messages);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function inbox_sent()
|
public function inbox_sent()
|
||||||
{
|
{
|
||||||
$messages = Message::where('user_id', Auth::id())->orderBy('id', 'desc')->paginate(10);
|
$messages = Message::where('user_id', Auth::id())->latest()->paginate(10);
|
||||||
|
|
||||||
return view('messages.sent')->with('messages', $messages);
|
return view('messages.sent')->with('messages', $messages);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function deleted()
|
public function deleted()
|
||||||
{
|
{
|
||||||
$messages = Message::where('sendto_id', Auth::id())->where('deleted', true)->orderBy('id', 'desc')->paginate(10);
|
$messages = Message::where('sendto_id', Auth::id())->where('deleted', true)->latest()->paginate(10);
|
||||||
|
|
||||||
return view('messages.deleted')->with('messages', $messages);
|
return view('messages.deleted')->with('messages', $messages);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,13 +27,8 @@ class PageController extends Controller
|
||||||
|
|
||||||
public function profile($id)
|
public function profile($id)
|
||||||
{
|
{
|
||||||
$user = User::find($id);
|
$user = User::findOrFail($id);
|
||||||
$badges = DB::table('badges')->get();
|
$badges = DB::table('badges')->get();
|
||||||
|
|
||||||
if (!$user) {
|
|
||||||
abort(404);
|
|
||||||
}
|
|
||||||
|
|
||||||
$friends = $user->getFriends($perPage = 3);
|
$friends = $user->getFriends($perPage = 3);
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
|
|
@ -42,16 +37,12 @@ class PageController extends Controller
|
||||||
'friends' => $friends
|
'friends' => $friends
|
||||||
];
|
];
|
||||||
|
|
||||||
return view('pages.profile')->with('data', $data);
|
return view('pages.profile')->with($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function profile_friends($id)
|
public function profile_friends($id)
|
||||||
{
|
{
|
||||||
$user = User::find($id);
|
$user = User::findOrFail($id);
|
||||||
if (!$user) {
|
|
||||||
abort(404);
|
|
||||||
}
|
|
||||||
|
|
||||||
$friends = $user->getFriends($perPage = 10);
|
$friends = $user->getFriends($perPage = 10);
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
|
|
@ -59,13 +50,13 @@ class PageController extends Controller
|
||||||
'friends' => $friends
|
'friends' => $friends
|
||||||
];
|
];
|
||||||
|
|
||||||
return view('pages.profile_friends')->with('data', $data);
|
return view('pages.profile_friends')->with($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function mutual_friends($id)
|
public function mutual_friends($id)
|
||||||
{
|
{
|
||||||
$user = User::find($id);
|
$user = User::findOrFail($id);
|
||||||
if (!$user || $user->id == Auth::id()) {
|
if ($user->id == Auth::id()) {
|
||||||
abort(404);
|
abort(404);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -76,13 +67,13 @@ class PageController extends Controller
|
||||||
'friends' => $friends
|
'friends' => $friends
|
||||||
];
|
];
|
||||||
|
|
||||||
return view('pages.mutual_friends')->with('data', $data);
|
return view('pages.mutual_friends')->with($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function users(Request $request)
|
public function users(Request $request)
|
||||||
{
|
{
|
||||||
if ($request->has('q')) {
|
if ($request->has('q')) {
|
||||||
$users = DB::table('users')->where('name', 'LIKE', '%' . $request->q . '%')->paginate(10);
|
$users = User::where('name', 'LIKE', '%' . $request->q . '%')->paginate(10);
|
||||||
} else {
|
} else {
|
||||||
$users = User::paginate(10);
|
$users = User::paginate(10);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,19 +26,19 @@
|
||||||
name="searchBy" value="name">Search by Username</button><button class="bluebutton"
|
name="searchBy" value="name">Search by Username</button><button class="bluebutton"
|
||||||
style="margin-left:2px" name="searchBy" value="id">Search by ID</button></div>
|
style="margin-left:2px" name="searchBy" value="id">Search by ID</button></div>
|
||||||
</form>
|
</form>
|
||||||
@if ($data['user'])
|
@if ($user)
|
||||||
<div id="SearchContainer">
|
<div id="SearchContainer">
|
||||||
<h2>User Found: {{ $data['user']->name }}</h2>
|
<h2>User Found: {{ $user->name }}</h2>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<h3><a
|
<h3><a
|
||||||
href="{{ route('profile', App\Models\User::where('name', $data['invited_by'])->first()->id) }}" target="_blank">{{ $data['invited_by'] }}</a>
|
href="{{ route('profile', App\Models\User::where('name', $invited_by)->first()->id) }}" target="_blank">{{ $invited_by }}</a>
|
||||||
</h3>
|
</h3>
|
||||||
</li>
|
</li>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="{{ route('profile', $data['user']->id) }}" target="_blank">{{ $data['user']->name }}</a></li>
|
<li><a href="{{ route('profile', $user->id) }}" target="_blank">{{ $user->name }}</a></li>
|
||||||
<ul>
|
<ul>
|
||||||
@foreach ($data['children'] as $child)
|
@foreach ($children as $child)
|
||||||
<li><a href="{{ route('profile', $child->id) }}" target="_blank">{{ $child->name }}</a></li>
|
<li><a href="{{ route('profile', $child->id) }}" target="_blank">{{ $child->name }}</a></li>
|
||||||
@endforeach
|
@endforeach
|
||||||
</ul>
|
</ul>
|
||||||
|
|
@ -48,7 +48,7 @@
|
||||||
@endif
|
@endif
|
||||||
@if (!request()->has('q'))
|
@if (!request()->has('q'))
|
||||||
<h5>Enter a username or ID.</h5>
|
<h5>Enter a username or ID.</h5>
|
||||||
@elseif (!$data['user'])
|
@elseif (!$user)
|
||||||
<h5>No user was found, check if you entered the correct details.</h5>
|
<h5>No user was found, check if you entered the correct details.</h5>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,8 @@
|
||||||
<input id="FeedBox" type="text" name="status" placeholder="Say something..." style="width: 80%;"
|
<input id="FeedBox" type="text" name="status" placeholder="Say something..." style="width: 80%;"
|
||||||
value="{{ old('status') }}">
|
value="{{ old('status') }}">
|
||||||
<button style="width: 20%;height: 28px;margin-left: 10px;" class="greybutton" id="FeedButton"
|
<button style="width: 20%;height: 28px;margin-left: 10px;" class="greybutton" id="FeedButton"
|
||||||
type="submit" alt="Post it!, Button" onClick="this.form.submit();this.disabled=true;this.innerText='Posting…';">Post
|
type="submit" alt="Post it!, Button"
|
||||||
|
onClick="this.form.submit();this.disabled=true;this.innerText='Posting…';">Post
|
||||||
it!</button>
|
it!</button>
|
||||||
</p>
|
</p>
|
||||||
@if ($errors->any())
|
@if ($errors->any())
|
||||||
|
|
@ -34,7 +35,7 @@
|
||||||
</form>
|
</form>
|
||||||
<br>
|
<br>
|
||||||
<div id="FeedContainer">
|
<div id="FeedContainer">
|
||||||
@foreach ($data['posts'] as $post)
|
@foreach ($posts as $post)
|
||||||
<div class="FeedContainerBox" id="FeedContainerBox1">
|
<div class="FeedContainerBox" id="FeedContainerBox1">
|
||||||
<div class="FeedContainerBoxImageContainer" id="FeedContainerBox1ImageContainer">
|
<div class="FeedContainerBoxImageContainer" id="FeedContainerBox1ImageContainer">
|
||||||
<a href="{{ route('profile', $post->user->id) }}"><img alt="A image of {{ $post->user->name }}"
|
<a href="{{ route('profile', $post->user->id) }}"><img alt="A image of {{ $post->user->name }}"
|
||||||
|
|
@ -46,25 +47,27 @@
|
||||||
<p id="FeedContainerBox1Text" style="word-wrap:break-word;max-width:400px">
|
<p id="FeedContainerBox1Text" style="word-wrap:break-word;max-width:400px">
|
||||||
"{{ $post->status }}"</p>
|
"{{ $post->status }}"</p>
|
||||||
@if (!Auth::user()->settings->time_preference_24hr)
|
@if (!Auth::user()->settings->time_preference_24hr)
|
||||||
<p id="FeedContainerBox1Timestamp" alt="">{{ $post->created_at->format('F d, Y h:i A') }}</p>
|
<p id="FeedContainerBox1Timestamp" alt="">
|
||||||
|
{{ $post->created_at->format('F d, Y h:i A') }}</p>
|
||||||
@else
|
@else
|
||||||
<p id="FeedContainerBox1Timestamp" alt="">{{ $post->created_at->format('F d, Y H:i') }}</p>
|
<p id="FeedContainerBox1Timestamp" alt="">
|
||||||
|
{{ $post->created_at->format('F d, Y H:i') }}</p>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
@if ($data['posts']->isEmpty())
|
@if ($posts->isEmpty())
|
||||||
<p>Your feed is empty.</p>
|
<p>Your feed is empty.</p>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
{{ $data['posts']->links() }}
|
{{ $posts->links() }}
|
||||||
</div>
|
</div>
|
||||||
<div id="gamesframe">
|
<div id="gamesframe">
|
||||||
<div class="content_special" style="justify-content: center;">
|
<div class="content_special" style="justify-content: center;">
|
||||||
<h2>Friends ({{ Auth::user()->getFriendsCount() }})</h2>
|
<h2>Friends ({{ Auth::user()->getFriendsCount() }})</h2>
|
||||||
@if (Auth::user()->getFriendsCount() > 0)
|
@if (Auth::user()->getFriendsCount() > 0)
|
||||||
<a alt="View All, button" href="{{ route('friends') }}" style="margin-left: 5px"> <button class="bluebutton"
|
<a alt="View All, button" href="{{ route('friends') }}" style="margin-left: 5px"> <button
|
||||||
style="margin-top: 5px">View
|
class="bluebutton" style="margin-top: 5px">View
|
||||||
All</button></a>
|
All</button></a>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -74,7 +77,7 @@
|
||||||
@if (Auth::user()->getFriendsCount() > 0)
|
@if (Auth::user()->getFriendsCount() > 0)
|
||||||
<div id="profilefriendcontainer" class="content_special"
|
<div id="profilefriendcontainer" class="content_special"
|
||||||
style="flex-wrap: wrap;justify-content: space-evenly;flex-direction: row;display: inline-flex;align-content: center;align-items: center;">
|
style="flex-wrap: wrap;justify-content: space-evenly;flex-direction: row;display: inline-flex;align-content: center;align-items: center;">
|
||||||
@foreach ($data['friends'] as $friend)
|
@foreach ($friends as $friend)
|
||||||
<div class="profilefriend">
|
<div class="profilefriend">
|
||||||
<a href="{{ route('profile', $friend->id) }}"><img alt="Profile Image"
|
<a href="{{ route('profile', $friend->id) }}"><img alt="Profile Image"
|
||||||
src="{{ asset('img/defaultrender.png') }}" width="150px" height="110px"></a>
|
src="{{ asset('img/defaultrender.png') }}" width="150px" height="110px"></a>
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,18 @@
|
||||||
@extends('layouts.app')
|
@extends('layouts.app')
|
||||||
@section('title')
|
@section('title')
|
||||||
<title>{{ $data['user']->name }}'s Friends (Mutual) - {{ env('APP_NAME') }}</title>
|
<title>{{ $user->name }}'s Friends (Mutual) - {{ env('APP_NAME') }}</title>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<h1 id="usernameframe">Your Mutual Friends with {{ $data['user']->name }} ({{ Auth::user()->getMutualFriendsCount($data['user']) }})</h1>
|
<h1 id="usernameframe">Your Mutual Friends with {{ $user->name }} ({{ Auth::user()->getMutualFriendsCount($user) }})</h1>
|
||||||
<a href="{{ route('profile_friends', $data['user']->id) }}" class="tab">All Friends</a>
|
<a href="{{ route('profile_friends', $user->id) }}" class="tab">All Friends</a>
|
||||||
@auth
|
@auth
|
||||||
<a href="#" class="tab_selected">Mutual Friends ({{ Auth::user()->getMutualFriendsCount($data['user']) }})</a>
|
<a href="#" class="tab_selected">Mutual Friends ({{ Auth::user()->getMutualFriendsCount($user) }})</a>
|
||||||
@endauth
|
@endauth
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
<div class="content_special" id="FriendsContainer" style="flex-wrap: wrap;">
|
<div class="content_special" id="FriendsContainer" style="flex-wrap: wrap;">
|
||||||
@foreach ($data['friends'] as $friend)
|
@foreach ($friends as $friend)
|
||||||
<div class="FriendsContainerBox" id="FriendsContainerBox1">
|
<div class="FriendsContainerBox" id="FriendsContainerBox1">
|
||||||
<div id="FriendsContainerBox1ImageContainer">
|
<div id="FriendsContainerBox1ImageContainer">
|
||||||
<a href="{{ route('profile', $friend->id) }}"><img alt="Profile Image"
|
<a href="{{ route('profile', $friend->id) }}"><img alt="Profile Image"
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
{{ Carbon\Carbon::parse($friend->last_seen)->diffForHumans() }}</strong>
|
{{ Carbon\Carbon::parse($friend->last_seen)->diffForHumans() }}</strong>
|
||||||
@endif
|
@endif
|
||||||
<br>
|
<br>
|
||||||
@if (Auth::id() == $data['user']->id)
|
@if (Auth::id() == $user->id)
|
||||||
<form action="{{ route('friend_remove', $friend->id) }}" method="POST"
|
<form action="{{ route('friend_remove', $friend->id) }}" method="POST"
|
||||||
style="display:inline-block">
|
style="display:inline-block">
|
||||||
@csrf
|
@csrf
|
||||||
|
|
@ -42,10 +42,10 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
@if (!Auth::user()->getMutualFriendsCount($data['user']))
|
@if (!Auth::user()->getMutualFriendsCount($user))
|
||||||
<p>You don't have any mutual friends with {{ $data['user']->name }}.</p>
|
<p>You don't have any mutual friends with {{ $user->name }}.</p>
|
||||||
@endif
|
@endif
|
||||||
{{ $data['friends']->links() }}
|
{{ $friends->links() }}
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
|
||||||
|
|
@ -1,54 +1,54 @@
|
||||||
@extends('layouts.app')
|
@extends('layouts.app')
|
||||||
@section('title')
|
@section('title')
|
||||||
<title>{{ $data['user']->name }} - {{ env('APP_NAME') }}</title>
|
<title>{{ $user->name }} - {{ env('APP_NAME') }}</title>
|
||||||
@endsection
|
@endsection
|
||||||
@section('titlediscord')
|
@section('titlediscord')
|
||||||
<meta content="{{ $data['user']->name }} - {{ env('APP_NAME') }}" property="og:title" />
|
<meta content="{{ $user->name }} - {{ env('APP_NAME') }}" property="og:title" />
|
||||||
@endsection
|
@endsection
|
||||||
@section('descdiscord')
|
@section('descdiscord')
|
||||||
<meta content="{{ $data['user']->blurb }} | ARCHBLOX is a work in progress revival." property="og:description" />
|
<meta content="{{ $user->blurb }} | ARCHBLOX is a work in progress revival." property="og:description" />
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<div id="profiletopcontainer">
|
<div id="profiletopcontainer">
|
||||||
<h1 id="usernameframe">{{ $data['user']->name }}</h1>
|
<h1 id="usernameframe">{{ $user->name }}</h1>
|
||||||
@if ($data['user']->settings->changed_name)
|
@if ($user->settings->changed_name)
|
||||||
<h4>Previous Username: {{ $data['user']->settings->old_name }}</h4>
|
<h4>Previous Username: {{ $user->settings->old_name }}</h4>
|
||||||
@endif
|
@endif
|
||||||
@if (Cache::has('is_online_' . $data['user']->id))
|
@if (Cache::has('is_online_' . $user->id))
|
||||||
<strong id="onlinestatus" class="onlinestatus_website">Website</strong>
|
<strong id="onlinestatus" class="onlinestatus_website">Website</strong>
|
||||||
@else
|
@else
|
||||||
<strong id="onlinestatus" class="onlinestatus_offline">Offline - Last Online
|
<strong id="onlinestatus" class="onlinestatus_offline">Offline - Last Online
|
||||||
{{ Carbon\Carbon::parse($data['user']->last_seen)->diffForHumans() }}</strong>
|
{{ Carbon\Carbon::parse($user->last_seen)->diffForHumans() }}</strong>
|
||||||
@endif
|
@endif
|
||||||
<br>
|
<br>
|
||||||
@if (!Auth::guest() && Auth::id() != $data['user']->id)
|
@if (!Auth::guest() && Auth::id() != $user->id)
|
||||||
@if (Auth::user()->hasSentFriendRequestTo($data['user']))
|
@if (Auth::user()->hasSentFriendRequestTo($user))
|
||||||
<button class="bluebutton" type="submit" disabled>Pending...</button>
|
<button class="bluebutton" type="submit" disabled>Pending...</button>
|
||||||
@elseif (Auth::user()->hasFriendRequestFrom($data['user']))
|
@elseif (Auth::user()->hasFriendRequestFrom($user))
|
||||||
<form action="{{ route('friend_handle', $data['user']->id) }}" method="POST">
|
<form action="{{ route('friend_handle', $user->id) }}" method="POST">
|
||||||
@csrf
|
@csrf
|
||||||
<button class="greenbutton" name="action" type="submit" value="accept">Accept</button>
|
<button class="greenbutton" name="action" type="submit" value="accept">Accept</button>
|
||||||
<button class="redbutton" name="action" type="submit" value="decline">Decline</button>
|
<button class="redbutton" name="action" type="submit" value="decline">Decline</button>
|
||||||
</form>
|
</form>
|
||||||
@elseif (Auth::user()->isFriendWith($data['user']))
|
@elseif (Auth::user()->isFriendWith($user))
|
||||||
<form action="{{ route('friend_remove', $data['user']->id) }}" method="POST" style="display:inline-block">
|
<form action="{{ route('friend_remove', $user->id) }}" method="POST" style="display:inline-block">
|
||||||
@csrf
|
@csrf
|
||||||
<button class="redbutton" type="submit">Unfriend</button>
|
<button class="redbutton" type="submit">Unfriend</button>
|
||||||
</form>
|
</form>
|
||||||
@else
|
@else
|
||||||
<form action="{{ route('friend_add', $data['user']->id) }}" method="POST" style="display:inline-block">
|
<form action="{{ route('friend_add', $user->id) }}" method="POST" style="display:inline-block">
|
||||||
@csrf
|
@csrf
|
||||||
<button class="bluebutton" type="submit">Add Friend</button>
|
<button class="bluebutton" type="submit">Add Friend</button>
|
||||||
</form>
|
</form>
|
||||||
@endif
|
@endif
|
||||||
@switch($data['user']->settings->message_preference)
|
@switch($user->settings->message_preference)
|
||||||
@case(2)
|
@case(2)
|
||||||
<a href="/my/messages/compose?to={{ $data['user']->name }}"><button class="greybutton">Message</button></a>
|
<a href="/my/messages/compose?to={{ $user->name }}"><button class="greybutton">Message</button></a>
|
||||||
@break
|
@break
|
||||||
@case(1)
|
@case(1)
|
||||||
@if (Auth::user()->isFriendWith($data['user']))
|
@if (Auth::user()->isFriendWith($user))
|
||||||
<a href="/my/messages/compose?to={{ $data['user']->name }}"><button class="greybutton">Message</button></a>
|
<a href="/my/messages/compose?to={{ $user->name }}"><button class="greybutton">Message</button></a>
|
||||||
@else
|
@else
|
||||||
<a href="#"><button class="greybutton" disabled>Message (Friends Only)</button></a>
|
<a href="#"><button class="greybutton" disabled>Message (Friends Only)</button></a>
|
||||||
@endif
|
@endif
|
||||||
|
|
@ -60,8 +60,8 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="content_special">
|
<div class="content_special">
|
||||||
<div id="profileleftcontainer">
|
<div id="profileleftcontainer">
|
||||||
@if (!empty($data['user']->feedposts->last()->status))
|
@if (!empty($user->feedposts->last()->status))
|
||||||
<address id="status" style="word-wrap:break-word">"{{ $data['user']->feedposts->last()->status }}"
|
<address id="status" style="word-wrap:break-word">"{{ $user->feedposts->last()->status }}"
|
||||||
</address>
|
</address>
|
||||||
@else
|
@else
|
||||||
<address id="status">"I'm new to ARCHBLOX!"</address>
|
<address id="status">"I'm new to ARCHBLOX!"</address>
|
||||||
|
|
@ -69,21 +69,21 @@
|
||||||
<img alt="profile image" src="{{ asset('img/defaultrender.png') }}" width="75%">
|
<img alt="profile image" src="{{ asset('img/defaultrender.png') }}" width="75%">
|
||||||
<div id="bio"
|
<div id="bio"
|
||||||
style="min-width:350px;max-width:350px;text-align:center;margin:0 auto;max-height:275px;overflow-y: auto;">
|
style="min-width:350px;max-width:350px;text-align:center;margin:0 auto;max-height:275px;overflow-y: auto;">
|
||||||
{!! nl2br(e($data['user']->blurb)) !!}</div>
|
{!! nl2br(e($user->blurb)) !!}</div>
|
||||||
<br>
|
<br>
|
||||||
<div id="stats">
|
<div id="stats">
|
||||||
@guest
|
@guest
|
||||||
<h3>Joined: {{ $data['user']->created_at->format('d/m/Y') }}</h3>
|
<h3>Joined: {{ $user->created_at->format('d/m/Y') }}</h3>
|
||||||
@else
|
@else
|
||||||
<h3>Joined: {{ $data['user']->created_at->format(Auth::user()->settings->date_preference) }}</h3>
|
<h3>Joined: {{ $user->created_at->format(Auth::user()->settings->date_preference) }}</h3>
|
||||||
@endguest
|
@endguest
|
||||||
<h3>Place Visits: 0</h3>
|
<h3>Place Visits: 0</h3>
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
<h2>Role</h2>
|
<h2>Role</h2>
|
||||||
<div style="white-space:nowrap">
|
<div style="white-space:nowrap">
|
||||||
@foreach ($data['badges'] as $badge)
|
@foreach ($badges as $badge)
|
||||||
@foreach ($data['user']->badges as $user_badge)
|
@foreach ($user->badges as $user_badge)
|
||||||
@if ($badge->id == $user_badge)
|
@if ($badge->id == $user_badge)
|
||||||
<div style="width:120px;display:inline-block">
|
<div style="width:120px;display:inline-block">
|
||||||
<img src="/img/badges/{{ $badge->id }}.png" width="75px" height="75px" />
|
<img src="/img/badges/{{ $badge->id }}.png" width="75px" height="75px" />
|
||||||
|
|
@ -107,19 +107,19 @@
|
||||||
<p>This user hasn't made any games yet!</p>
|
<p>This user hasn't made any games yet!</p>
|
||||||
<br>
|
<br>
|
||||||
<div class="content_special" style="justify-content: center;">
|
<div class="content_special" style="justify-content: center;">
|
||||||
<h2>Friends ({{ $data['user']->getFriendsCount() }})</h2>
|
<h2>Friends ({{ $user->getFriendsCount() }})</h2>
|
||||||
@if ($data['user']->getFriendsCount() > 0)
|
@if ($user->getFriendsCount() > 0)
|
||||||
<a href="{{ route('profile_friends', $data['user']->id) }}" style="margin-left: 5px"> <button
|
<a href="{{ route('profile_friends', $user->id) }}" style="margin-left: 5px"> <button
|
||||||
class="bluebutton" style="margin-top: 5px">View All</button></a>
|
class="bluebutton" style="margin-top: 5px">View All</button></a>
|
||||||
</div>
|
</div>
|
||||||
@if (Auth::check() && Auth::id() != $data['user']->id && Auth::user()->getMutualFriendsCount($data['user']) > 0)
|
@if (Auth::check() && Auth::id() != $user->id && Auth::user()->getMutualFriendsCount($user) > 0)
|
||||||
<a href="{{ route('mutual_friends', $data['user']->id) }}"
|
<a href="{{ route('mutual_friends', $user->id) }}"
|
||||||
style="color:blue;font-size:12px">{{ Auth::user()->getMutualFriendsCount($data['user']) }} Mutual
|
style="color:blue;font-size:12px">{{ Auth::user()->getMutualFriendsCount($user) }} Mutual
|
||||||
Friends</a>
|
Friends</a>
|
||||||
@endif
|
@endif
|
||||||
<div id="profilefriendcontainer" class="content_special"
|
<div id="profilefriendcontainer" class="content_special"
|
||||||
style="flex-wrap: wrap;justify-content: space-evenly;flex-direction: row;display: inline-flex;align-content: center;align-items: center;">
|
style="flex-wrap: wrap;justify-content: space-evenly;flex-direction: row;display: inline-flex;align-content: center;align-items: center;">
|
||||||
@foreach ($data['friends'] as $friend)
|
@foreach ($friends as $friend)
|
||||||
<div class="profilefriend">
|
<div class="profilefriend">
|
||||||
<a href="{{ route('profile', $friend->id) }}"><img alt="Profile Image"
|
<a href="{{ route('profile', $friend->id) }}"><img alt="Profile Image"
|
||||||
src="{{ asset('img/defaultrender.png') }}" width="150px" height="110px"></a>
|
src="{{ asset('img/defaultrender.png') }}" width="150px" height="110px"></a>
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,20 @@
|
||||||
@extends('layouts.app')
|
@extends('layouts.app')
|
||||||
@section('title')
|
@section('title')
|
||||||
<title>{{ $data['user']->name }}'s Friends - {{ env('APP_NAME') }}</title>
|
<title>{{ $user->name }}'s Friends - {{ env('APP_NAME') }}</title>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<h1 id="usernameframe">{{ $data['user']->name }}'s Friends ({{ $data['user']->getFriendsCount() }})</h1>
|
<h1 id="usernameframe">{{ $user->name }}'s Friends ({{ $user->getFriendsCount() }})</h1>
|
||||||
<a href="#" class="tab_selected">All Friends</a>
|
<a href="#" class="tab_selected">All Friends</a>
|
||||||
@auth
|
@auth
|
||||||
@if ($data['user']->id != Auth::id())
|
@if ($user->id != Auth::id())
|
||||||
<a href="{{ route('mutual_friends', $data['user']->id) }}" class="tab">Mutual Friends ({{ Auth::user()->getMutualFriendsCount($data['user']) }})</a>
|
<a href="{{ route('mutual_friends', $user->id) }}" class="tab">Mutual Friends ({{ Auth::user()->getMutualFriendsCount($user) }})</a>
|
||||||
@endif
|
@endif
|
||||||
@endauth
|
@endauth
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
<div class="content_special" id="FriendsContainer" style="flex-wrap: wrap;">
|
<div class="content_special" id="FriendsContainer" style="flex-wrap: wrap;">
|
||||||
@foreach ($data['friends'] as $friend)
|
@foreach ($friends as $friend)
|
||||||
<div class="FriendsContainerBox" id="FriendsContainerBox1">
|
<div class="FriendsContainerBox" id="FriendsContainerBox1">
|
||||||
<div id="FriendsContainerBox1ImageContainer">
|
<div id="FriendsContainerBox1ImageContainer">
|
||||||
<a href="{{ route('profile', $friend->id) }}"><img alt="Profile Image"
|
<a href="{{ route('profile', $friend->id) }}"><img alt="Profile Image"
|
||||||
|
|
@ -34,7 +34,7 @@
|
||||||
{{ Carbon\Carbon::parse($friend->last_seen)->diffForHumans() }}</strong>
|
{{ Carbon\Carbon::parse($friend->last_seen)->diffForHumans() }}</strong>
|
||||||
@endif
|
@endif
|
||||||
<br>
|
<br>
|
||||||
@if (Auth::id() == $data['user']->id)
|
@if (Auth::id() == $user->id)
|
||||||
<form action="{{ route('friend_remove', $friend->id) }}" method="POST"
|
<form action="{{ route('friend_remove', $friend->id) }}" method="POST"
|
||||||
style="display:inline-block">
|
style="display:inline-block">
|
||||||
@csrf
|
@csrf
|
||||||
|
|
@ -44,10 +44,10 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
@if (!$data['user']->getFriendsCount())
|
@if (!$user->getFriendsCount())
|
||||||
<p>{{ $data['user']->name }} hasn't made friends with anyone yet.</p>
|
<p>{{ $user->name }} hasn't made friends with anyone yet.</p>
|
||||||
@endif
|
@endif
|
||||||
{{ $data['friends']->links() }}
|
{{ $friends->links() }}
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue