Merge branch 'main' of https://github.com/Thomasluigi07/MORBLOX-WEBSITE
This commit is contained in:
commit
fbae1603c8
|
|
@ -5,6 +5,7 @@ namespace App\Http\Controllers\Auth;
|
|||
use App\Http\Controllers\Controller;
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use App\Models\User;
|
||||
use App\Models\UserSetting;
|
||||
use App\Models\InviteKey;
|
||||
use Illuminate\Foundation\Auth\RegistersUsers;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
|
@ -71,6 +72,7 @@ class RegisterController extends Controller
|
|||
$invited_by = $this->getInviter($data['key']);
|
||||
$this->updateKeyTable($data['key']);
|
||||
|
||||
UserSetting::create(['user_id' => User::all()->last()->id+1]);
|
||||
return User::create([
|
||||
'name' => $data['name'],
|
||||
'email' => $data['email'],
|
||||
|
|
|
|||
|
|
@ -29,12 +29,13 @@ class PageController extends Controller
|
|||
{
|
||||
$user = User::find($id);
|
||||
$badges = DB::table('badges')->get();
|
||||
$friends = $user->getFriends($perPage = 3);
|
||||
|
||||
if (!$user) {
|
||||
abort(404);
|
||||
}
|
||||
|
||||
$friends = $user->getFriends($perPage = 3);
|
||||
|
||||
$data = [
|
||||
'user' => $user,
|
||||
'badges' => $badges,
|
||||
|
|
@ -89,24 +90,6 @@ class PageController extends Controller
|
|||
return view('pages.users')->with('users', $users);
|
||||
}
|
||||
|
||||
public function settings()
|
||||
{
|
||||
return view('misc.settings');
|
||||
}
|
||||
|
||||
public function change_settings(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'bio' => 'required|min:3|max:2000'
|
||||
]);
|
||||
|
||||
$user = Auth::user();
|
||||
$user->blurb = $request->bio;
|
||||
$user->save();
|
||||
|
||||
return redirect()->back()->with('success', 'Your bio has been updated.');
|
||||
}
|
||||
|
||||
public function download()
|
||||
{
|
||||
return view('pages.download');
|
||||
|
|
|
|||
|
|
@ -0,0 +1,119 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use App\Models\UserSetting;
|
||||
|
||||
class SettingController extends Controller
|
||||
{
|
||||
public function settings()
|
||||
{
|
||||
return view('misc.settings');
|
||||
}
|
||||
|
||||
public function change_settings(Request $request)
|
||||
{
|
||||
$option = $request->activeSetting;
|
||||
$changeMsg = null;
|
||||
$user = Auth::user();
|
||||
$userSetting = Auth::user()->settings;
|
||||
|
||||
switch ($option) {
|
||||
case 1:
|
||||
$request->validate([
|
||||
'name' => ['required', 'string', 'min:3', 'max:20', 'unique:users', 'regex:/^(?!^\.)(?!.*[-_.]$)[a-zA-Z0-9-_. ]+$/'],
|
||||
'username_change_confirm' => 'accepted'
|
||||
]);
|
||||
|
||||
if (Auth::user()->settings->changed_name) {
|
||||
return redirect()->back()->withErrors(['You have already changed your username!']);
|
||||
}
|
||||
|
||||
$oldUsername = $user->name;
|
||||
|
||||
$user->name = $request->name;
|
||||
$user->save();
|
||||
|
||||
$userSetting->old_name = $oldUsername;
|
||||
$userSetting->changed_name = true;
|
||||
$userSetting->save();
|
||||
|
||||
$changeMsg = "Your username has been changed.";
|
||||
break;
|
||||
case 2:
|
||||
$request->validate([
|
||||
'email' => ['required', 'string', 'email', 'max:255', 'unique:users', 'confirmed', 'email:rfc,dns'],
|
||||
]);
|
||||
|
||||
$user->email = $request->email;
|
||||
$user->save();
|
||||
|
||||
$changeMsg = "Your email has been changed.";
|
||||
break;
|
||||
case 3:
|
||||
$request->validate([
|
||||
'dob' => ['required', 'date_format:Y-m-d', 'before:today', 'after:01/01/1970'],
|
||||
]);
|
||||
|
||||
$user->dob = $request->dob;
|
||||
$user->save();
|
||||
|
||||
$changeMsg = "Your date of birth has been changed.";
|
||||
break;
|
||||
case 4:
|
||||
$request->validate([
|
||||
'password' => ['required', 'string', 'min:8', 'confirmed', 'regex:/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{6,}$/'],
|
||||
]);
|
||||
|
||||
if (!Hash::check($request->old_password, Auth::user()->password)) {
|
||||
return redirect()->back()->withErrors(['Your old password is incorrect!']);
|
||||
}
|
||||
|
||||
$user->password = Hash::make($request->password);
|
||||
$user->save();
|
||||
|
||||
$changeMsg = "Your password has been changed.";
|
||||
break;
|
||||
case 5:
|
||||
$request->validate([
|
||||
'date_preference' => ['required', 'string', 'in:d/m/Y,m/d/Y,Y/d/m'],
|
||||
]);
|
||||
|
||||
$userSetting->date_preference = $request->date_preference;
|
||||
$userSetting->save();
|
||||
|
||||
$changeMsg = "Your date display preference has been changed.";
|
||||
break;
|
||||
case 6:
|
||||
$request->validate([
|
||||
'time_preference' => ['required', 'string', 'in:0,1'],
|
||||
]);
|
||||
|
||||
$userSetting->time_preference_24hr = $request->time_preference;
|
||||
$userSetting->save();
|
||||
|
||||
$changeMsg = "Your time display preference has been changed.";
|
||||
break;
|
||||
default:
|
||||
abort(404);
|
||||
}
|
||||
|
||||
return redirect()->back()->with('change', $changeMsg);
|
||||
}
|
||||
|
||||
public function change_bio(Request $request)
|
||||
{
|
||||
$request->validateWithBag('bio_form', [
|
||||
'bio' => 'required|min:3|max:2000'
|
||||
]);
|
||||
|
||||
$user = Auth::user();
|
||||
$user->blurb = $request->bio;
|
||||
$user->save();
|
||||
|
||||
return redirect()->back()->with('success', 'Your bio has been updated.');
|
||||
}
|
||||
}
|
||||
|
|
@ -65,4 +65,9 @@ class User extends Authenticatable
|
|||
{
|
||||
return $this->hasMany('App\Models\FeedPost');
|
||||
}
|
||||
|
||||
public function settings()
|
||||
{
|
||||
return $this->hasOne('App\Models\UserSetting');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class UserSetting extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'user_settings';
|
||||
public $primaryKey = 'id';
|
||||
public $timestamps = true;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'old_name',
|
||||
'changed_name',
|
||||
'date_preference',
|
||||
'time_preference_24hr',
|
||||
'theme',
|
||||
'message_preference',
|
||||
];
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('App\Models\User');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateUserSettingsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('user_settings', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->integer('user_id');
|
||||
$table->string('old_name')->nullable();
|
||||
$table->boolean('changed_name')->default(false);
|
||||
$table->string('date_preference')->default('d/m/Y');
|
||||
$table->boolean('time_preference_24hr')->default(false);
|
||||
$table->integer('theme')->default(1);
|
||||
$table->integer('message_preference')->default(2);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('user_settings');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
var active = 0;
|
||||
|
||||
function openPopup(id) {
|
||||
document.querySelector('.popupcontainer').removeAttribute('id');
|
||||
|
||||
switch (id) {
|
||||
case 1:
|
||||
active = 1;
|
||||
setActiveSetting(1);
|
||||
document.querySelector('.popup .username_change').removeAttribute('id');
|
||||
document.querySelector('.popup #heading').innerHTML = "Change Username";
|
||||
document.querySelector('.popup .warningtext').innerHTML = "You can only change your username once.";
|
||||
document.querySelector('.popup #desc').innerHTML = "Your new username must be from 3-20 characters long.<br>Spaces, periods, and underscores allowed.";
|
||||
break;
|
||||
case 2:
|
||||
active = 2;
|
||||
setActiveSetting(2);
|
||||
document.querySelector('.popup .email_change').removeAttribute('id');
|
||||
document.querySelector('.popup #heading').innerHTML = "Change E-Mail";
|
||||
document.querySelector('.popup .warningtext').innerHTML = null;
|
||||
document.querySelector('.popup #desc').innerHTML = "Enter your new E-Mail below as well as confirming it.<br>E-Mails are primarily used to reset passwords.";
|
||||
break;
|
||||
case 3:
|
||||
active = 3;
|
||||
setActiveSetting(3);
|
||||
document.querySelector('.popup .dob_change').removeAttribute('id');
|
||||
document.querySelector('.popup #heading').innerHTML = "Change Date of Birth";
|
||||
document.querySelector('.popup .warningtext').innerHTML = null;
|
||||
document.querySelector('.popup #desc').innerHTML = null;
|
||||
break;
|
||||
case 4:
|
||||
active = 4;
|
||||
setActiveSetting(4);
|
||||
document.querySelector('.popup .password_change').removeAttribute('id');
|
||||
document.querySelector('.popup #heading').innerHTML = "Change Password";
|
||||
document.querySelector('.popup .warningtext').innerHTML = "Your password must follow ARCHBLOX's format.";
|
||||
document.querySelector('.popup #desc').innerHTML = "Firstly, you need to remember your old password.<br><span style=\"text-align:left\">Your new password must include:<br> <ul style=\"margin-inline-start:2.5em\"><li>8 or more characters</li><li>1 capital letter</li><li>1 symbol</li><li>1 number</li></ul></span>";
|
||||
break;
|
||||
case 5:
|
||||
active = 5;
|
||||
setActiveSetting(5);
|
||||
document.querySelector('.popup .date_change').removeAttribute('id');
|
||||
document.querySelector('.popup #heading').innerHTML = "Change Date Preference";
|
||||
document.querySelector('.popup .warningtext').innerHTML = null;
|
||||
document.querySelector('.popup #desc').innerHTML = "Change the way you see dates on the site.<br>Default preference is the Australian format (dd/mm/yyyy)";
|
||||
break;
|
||||
case 6:
|
||||
active = 6;
|
||||
setActiveSetting(6);
|
||||
document.querySelector('.popup .time_change').removeAttribute('id');
|
||||
document.querySelector('.popup #heading').innerHTML = "Change Time Preference";
|
||||
document.querySelector('.popup .warningtext').innerHTML = null;
|
||||
document.querySelector('.popup #desc').innerHTML = "Choose whether 12 hour or 24 hour time is displayed on the site.";
|
||||
break;
|
||||
default:
|
||||
console.error('Invalid setting.');
|
||||
}
|
||||
}
|
||||
|
||||
function closePopup() {
|
||||
document.querySelector('.popupcontainer').setAttribute("id", "invisible");
|
||||
switch (active) {
|
||||
case 1:
|
||||
document.querySelector('.popup .username_change').setAttribute("id", "invisible");
|
||||
break;
|
||||
case 2:
|
||||
document.querySelector('.popup .email_change').setAttribute("id", "invisible");
|
||||
break;
|
||||
case 3:
|
||||
document.querySelector('.popup .dob_change').setAttribute("id", "invisible");
|
||||
break;
|
||||
case 4:
|
||||
document.querySelector('.popup .password_change').setAttribute("id", "invisible");
|
||||
break;
|
||||
case 5:
|
||||
document.querySelector('.popup .date_change').setAttribute("id", "invisible");
|
||||
break;
|
||||
case 6:
|
||||
document.querySelector('.popup .time_change').setAttribute("id", "invisible");
|
||||
break;
|
||||
default:
|
||||
console.error('Invalid setting.');
|
||||
}
|
||||
}
|
||||
|
||||
function setActiveSetting(id) {
|
||||
document.querySelector('.popup #activeSetting').setAttribute("value", id);
|
||||
}
|
||||
|
|
@ -43,8 +43,13 @@
|
|||
<div class="FeedContainerBoxTextContainer" id="FeedContainerBox1TextContainer">
|
||||
<a href="{{ route('profile', $post->user->id) }}"
|
||||
id="FeedContainerBox1Username">{{ $post->user->name }}</a>
|
||||
<p id="FeedContainerBox1Text" style="word-wrap:break-word;max-width:400px">"{{ $post->status }}"</p>
|
||||
<p id="FeedContainerBox1Timestamp">{{ $post->created_at->format('F d, Y h:i A') }}</p>
|
||||
<p id="FeedContainerBox1Text" style="word-wrap:break-word;max-width:400px">
|
||||
"{{ $post->status }}"</p>
|
||||
@if (!Auth::user()->settings->time_preference_24hr)
|
||||
<p id="FeedContainerBox1Timestamp">{{ $post->created_at->format('F d, Y h:i A') }}</p>
|
||||
@else
|
||||
<p id="FeedContainerBox1Timestamp">{{ $post->created_at->format('F d, Y H:i') }}</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -1,6 +1,12 @@
|
|||
@extends('layouts.app')
|
||||
@section('title')
|
||||
<title>Settings - {{ env('APP_NAME') }}</title>
|
||||
<script src="{{ asset('js/settings.js') }}"></script>
|
||||
<style>
|
||||
.bio_form {
|
||||
width: 50%
|
||||
}
|
||||
</style>
|
||||
@endsection
|
||||
@section('titlediscord')
|
||||
<meta content="Settings - {{ env('APP_NAME') }}" property="og:title" />
|
||||
|
|
@ -12,70 +18,118 @@
|
|||
@section('popup_content')
|
||||
<div class="popupcontainer" id="invisible">
|
||||
<div class="popup">
|
||||
<h2>Test Dialog</h2>
|
||||
<p class="warningtext">WARNING TEXT</p>
|
||||
<p>DESCRIPTION OF THE SETTING YOU ARE ABOUT TO CHANGE</p>
|
||||
<input type="text" placeholder="New Username Field">
|
||||
<br>
|
||||
<input type="password" placeholder="Old Password Field">
|
||||
<input type="password" placeholder="New Password Field">
|
||||
<input type="password" placeholder="Confirm New Password Field">
|
||||
<br>
|
||||
<input type="text" placeholder="Confirm Old E-Mail Field">
|
||||
<input type="text" placeholder="New E-Mail Field">
|
||||
<input type="text" placeholder="Confirm New E-Mail Field">
|
||||
<br>
|
||||
<input type="date">
|
||||
<br>
|
||||
<select name="Time Preference">
|
||||
<option value="12hour">12 Hour</option>
|
||||
<option value="24hour">24 Hour</option>
|
||||
</select>
|
||||
<br>
|
||||
<select name="Date Preference">
|
||||
<option value="DMY">DAY/MONTH/YEAR</option>
|
||||
<option value="MDY">MONTH/DAY/YEAR</option>
|
||||
<option value="YDM">YEAR/MONTH/DAY</option>
|
||||
</select>
|
||||
<br>
|
||||
<button class="bluebutton">Confirm_Good</button>
|
||||
<button class="redbutton">Cancel_Bad</button>
|
||||
<button class="redbutton">Confirm_Bad</button>
|
||||
<button class="bluebutton">Cancel_Good</button>
|
||||
<form action="{{ route('change_settings') }}" method="POST">
|
||||
@csrf
|
||||
<input type="hidden" id="activeSetting" name="activeSetting">
|
||||
<h2 id="heading"></h2>
|
||||
<p class="warningtext"></p>
|
||||
<p id="desc"></p>
|
||||
<span class="username_change" id="invisible">
|
||||
<br>
|
||||
<h4>New Username</h4>
|
||||
<input type="text" placeholder="New Username..." id="name" name="name">
|
||||
<br>
|
||||
<br>
|
||||
<input type="checkbox" id="username_change_confirm" name="username_change_confirm" value="true">
|
||||
<label for="username_change_confirm"> I understand that changing my username is permanent<br> and can
|
||||
only
|
||||
be done once.</label>
|
||||
</span>
|
||||
<span class="email_change" id="invisible">
|
||||
<br>
|
||||
<h4>New E-Mail</h4>
|
||||
<input type="email" name="email" placeholder="New E-Mail Field"><br>
|
||||
<h4>Confirm New E-Mail</h4>
|
||||
<input type="email" name="email_confirmation" placeholder="Confirm New E-Mail Field">
|
||||
</span>
|
||||
<span class="dob_change" id="invisible">
|
||||
<br>
|
||||
<h4>New Date of Birth</h4>
|
||||
<input type="date" name="dob">
|
||||
</span>
|
||||
<span class="password_change" id="invisible">
|
||||
<br>
|
||||
<h4>Old Password</h4>
|
||||
<input type="password" name="old_password" placeholder="Old Password Field"><br>
|
||||
<h4>New Password</h4>
|
||||
<input type="password" name="password" placeholder="New Password Field"><br>
|
||||
<h4>Confirm New Password</h4>
|
||||
<input type="password" name="password_confirmation" placeholder="Confirm New Password Field">
|
||||
</span>
|
||||
<span class="date_change" id="invisible">
|
||||
<br>
|
||||
<select name="date_preference">
|
||||
<option value="d/m/Y">DAY/MONTH/YEAR</option>
|
||||
<option value="m/d/Y">MONTH/DAY/YEAR</option>
|
||||
<option value="Y/d/m">YEAR/MONTH/DAY</option>
|
||||
</select>
|
||||
</span>
|
||||
<span class="time_change" id="invisible">
|
||||
<br>
|
||||
<select name="time_preference">
|
||||
<option value="0">12 Hour</option>
|
||||
<option value="1">24 Hour</option>
|
||||
</select>
|
||||
</span>
|
||||
<br>
|
||||
<br>
|
||||
<button class="bluebutton" type="submit">Confirm</button>
|
||||
<button class="redbutton" type="reset" onclick="closePopup()">Cancel</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('alert')
|
||||
@if ($errors->any())
|
||||
<div style="color:white;background-color:red;text-align:center;margin-top:72px">{{ $errors->first() }}</div>
|
||||
@endif
|
||||
@if (session()->has('change'))
|
||||
<div style="color:white;background-color:green;text-align:center;margin-top:72px">{{ session()->get('change') }}
|
||||
</div>
|
||||
@endif
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<h1>Settings</h1>
|
||||
<form action="{{ route('change_settings') }}" method="POST">
|
||||
@csrf
|
||||
<div class="content_special" style="align-content: flex-end; align-items: flex-start; width=100%;">
|
||||
<div class="content_special" style="flex-wrap: wrap; flex-direction: column; width: 50%;">
|
||||
<div class="content_special" style="align-content: flex-end; align-items: flex-start; width:100%;">
|
||||
<form action="{{ route('change_bio') }}" method="POST" class="bio_form">
|
||||
@csrf
|
||||
<div class="content_special" style="flex-wrap: wrap; flex-direction: column; width: 100%;">
|
||||
<h3>Bio</h3>
|
||||
<textarea style="resize: none; width: 100%; height: 75px;" name="bio">
|
||||
@if (!old('bio'))
|
||||
{{ Auth::user()->blurb }}@else{{ old('bio') }}
|
||||
@endif
|
||||
</textarea>
|
||||
@if ($errors->any())
|
||||
<span class="warningtext">{{ $errors->first() }}</span>
|
||||
@if ($errors->bio_form->any())
|
||||
<span class="warningtext">{{ $errors->bio_form->first() }}</span>
|
||||
@endif
|
||||
@if (session()->has('success'))
|
||||
<span style="color:green">{{ session()->get('success') }}</span>
|
||||
@endif
|
||||
<button class="bluebutton" type="submit">Save</button>
|
||||
</form>
|
||||
<br>
|
||||
</form>
|
||||
<br>
|
||||
</div>
|
||||
<div class="content_special"
|
||||
style="flex-wrap: wrap; flex-direction: row-reverse; width: 50%; text-align: end; align-content: flex-end;">
|
||||
<p style="width: 100%;">Username: {{ Auth::user()->name }} <button class="bluebutton" disabled>Edit</button></p>
|
||||
<p style="width: 100%;">E-Mail: {{ Auth::user()->email }} <button class="bluebutton" disabled>Edit</button></p>
|
||||
<p style="width: 100%;">Date of Birth: {{ Auth::user()->dob }} <button class="bluebutton" disabled>Edit</button></p>
|
||||
<p style="width: 100%;">Password: ******** <button class="bluebutton" disabled>Edit</button></p>
|
||||
<p style="width: 100%;">Date Display Preference: D/M/YY <button class="bluebutton" disabled>Edit</button></p>
|
||||
<p style="width: 100%;">Time Display Preference: 12 Hour <button class="bluebutton" disabled>Edit</button></p>
|
||||
<p style="width: 100%;">Username: {{ Auth::user()->name }} <button class="bluebutton"
|
||||
onclick="openPopup(1)">Edit</button></p>
|
||||
<p style="width: 100%;">E-Mail: {{ Auth::user()->email }} <button class="bluebutton"
|
||||
onclick="openPopup(2)">Edit</button></p>
|
||||
<p style="width: 100%;">Date of Birth: {{ Auth::user()->dob }} <button class="bluebutton"
|
||||
onclick="openPopup(3)">Edit</button>
|
||||
</p>
|
||||
<p style="width: 100%;">Password: ******** <button class="bluebutton" onclick="openPopup(4)">Edit</button></p>
|
||||
<p style="width: 100%;">Date Display Preference:
|
||||
{{ Auth::user()->settings->date_preference }} <button class="bluebutton"
|
||||
onclick="openPopup(5)">Edit</button>
|
||||
</p>
|
||||
<p style="width: 100%;">Time Display Preference:
|
||||
{{ Auth::user()->settings->time_preference_24hr ? '24 Hour' : '12 Hour' }}
|
||||
<button class="bluebutton" onclick="openPopup(6)">Edit</button>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content_special" style="align-content: flex-end; align-items: flex-start;">
|
||||
|
|
|
|||
|
|
@ -12,6 +12,9 @@
|
|||
@section('content')
|
||||
<div id="profiletopcontainer">
|
||||
<h1 id="usernameframe">{{ $data['user']->name }}</h1>
|
||||
@if ($data['user']->settings->changed_name)
|
||||
<h4>Previous Username: {{ $data['user']->settings->old_name }}</h4>
|
||||
@endif
|
||||
@if (Cache::has('is_online_' . $data['user']->id))
|
||||
<strong id="onlinestatus" class="onlinestatus_website">Website</strong>
|
||||
@else
|
||||
|
|
@ -29,8 +32,7 @@
|
|||
<button class="redbutton" name="action" type="submit" value="decline">Decline</button>
|
||||
</form>
|
||||
@elseif (Auth::user()->isFriendWith($data['user']))
|
||||
<form action="{{ route('friend_remove', $data['user']->id) }}" method="POST"
|
||||
style="display:inline-block">
|
||||
<form action="{{ route('friend_remove', $data['user']->id) }}" method="POST" style="display:inline-block">
|
||||
@csrf
|
||||
<button class="redbutton" type="submit">Unfriend</button>
|
||||
</form>
|
||||
|
|
@ -57,7 +59,11 @@
|
|||
{!! nl2br(e($data['user']->blurb)) !!}</div>
|
||||
<br>
|
||||
<div id="stats">
|
||||
<h3>Joined: {{ $data['user']->created_at->format('d/m/Y') }}</h3>
|
||||
@guest
|
||||
<h3>Joined: {{ $data['user']->created_at->format('d/m/Y') }}</h3>
|
||||
@else
|
||||
<h3>Joined: {{ $data['user']->created_at->format(Auth::user()->settings->date_preference) }}</h3>
|
||||
@endguest
|
||||
<h3>Place Visits: 0</h3>
|
||||
</div>
|
||||
<br>
|
||||
|
|
@ -93,7 +99,9 @@
|
|||
class="bluebutton" style="margin-top: 5px">View All</button></a>
|
||||
</div>
|
||||
@if (Auth::check() && Auth::id() != $data['user']->id && Auth::user()->getMutualFriendsCount($data['user']) > 0)
|
||||
<a href="{{ route('mutual_friends', $data['user']->id) }}" style="color:blue;font-size:12px">{{ Auth::user()->getMutualFriendsCount($data['user'])}} Mutual Friends</a>
|
||||
<a href="{{ route('mutual_friends', $data['user']->id) }}"
|
||||
style="color:blue;font-size:12px">{{ Auth::user()->getMutualFriendsCount($data['user']) }} Mutual
|
||||
Friends</a>
|
||||
@endif
|
||||
<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;">
|
||||
|
|
|
|||
|
|
@ -36,8 +36,9 @@ Route::middleware(['auth'])->group(function () {
|
|||
});
|
||||
|
||||
Route::get('/user/{id}/friends/mutual', [App\Http\Controllers\PageController::class, 'mutual_friends'])->name('mutual_friends');
|
||||
Route::get('/my/settings', [App\Http\Controllers\PageController::class, 'settings'])->name('settings');
|
||||
Route::post('/my/settings', [App\Http\Controllers\PageController::class, 'change_settings'])->name('change_settings');
|
||||
Route::get('/my/settings', [App\Http\Controllers\SettingController::class, 'settings'])->name('settings');
|
||||
Route::post('/my/settings', [App\Http\Controllers\SettingController::class, 'change_bio'])->name('change_bio');
|
||||
Route::post('/my/settings/change', [App\Http\Controllers\SettingController::class, 'change_settings'])->name('change_settings');
|
||||
Route::get('/my/invites', [App\Http\Controllers\KeyController::class, 'index'])->name('key_index');
|
||||
Route::post('/my/invites', [App\Http\Controllers\KeyController::class, 'create'])->name('key_create');
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue