Added profile page
39
README.md
@ -7,7 +7,44 @@ Notice that the styles were taken from [AnySpace](https://anyspace.3to.moe/about
|
|||||||
## Overview
|
## Overview
|
||||||
|
|
||||||

|

|
||||||
|

|
||||||
|
|
||||||
## TODO:
|
## TODO:
|
||||||
|
|
||||||
- [ ] Do the ToDo list
|
- [-] Activitypub
|
||||||
|
- [x] Accounts (users can now be found in mastodon instances)
|
||||||
|
- [ ] Posts
|
||||||
|
- [ ] Local posts should be federated
|
||||||
|
- [ ] Remote posts should be fetched
|
||||||
|
- [ ] Follows
|
||||||
|
- [ ] Likes
|
||||||
|
- [ ] Comments
|
||||||
|
|
||||||
|
- [-] Social features
|
||||||
|
- [x] Profile
|
||||||
|
- [ ] Show when the user is online
|
||||||
|
- [ ] Set mood
|
||||||
|
- [ ] Set interests
|
||||||
|
- [ ] Update profile picture
|
||||||
|
- [ ] Mark account as private (in federation manual approval is needed)
|
||||||
|
- [ ] Allow custom CSS
|
||||||
|
- [ ] Profile audio
|
||||||
|
- [ ] Friends (they are known as follows in the activitypub protocol)
|
||||||
|
- [ ] Add friends
|
||||||
|
- [ ] Remove friends
|
||||||
|
- [ ] Posts (everything should be federated)
|
||||||
|
- [ ] Create posts
|
||||||
|
- [ ] Delete posts
|
||||||
|
- [ ] Like posts
|
||||||
|
- [ ] Comment posts
|
||||||
|
- [ ] Blog
|
||||||
|
- [ ] Bulletin
|
||||||
|
- [ ] Groups
|
||||||
|
- [ ] Forum
|
||||||
|
- [ ] Events
|
||||||
|
- [ ] Add users to favourites
|
||||||
|
- [ ] Chat
|
||||||
|
|
||||||
|
- [ ] Others
|
||||||
|
- [ ] Music
|
||||||
|
- [ ] Announcements
|
||||||
|
@ -22,7 +22,7 @@ class UserController extends Controller
|
|||||||
public function do_signup (Request $request)
|
public function do_signup (Request $request)
|
||||||
{
|
{
|
||||||
$incoming_fields = $request->validate ([
|
$incoming_fields = $request->validate ([
|
||||||
"name" => "required",
|
"name" => "required|alpha_dash",
|
||||||
"email" => "required|email|unique:users",
|
"email" => "required|email|unique:users",
|
||||||
"password" => "required|confirmed"
|
"password" => "required|confirmed"
|
||||||
]);
|
]);
|
||||||
@ -55,4 +55,9 @@ class UserController extends Controller
|
|||||||
|
|
||||||
return redirect ()->route ("login")->with ("success", "You have successfuly logged out!");
|
return redirect ()->route ("login")->with ("success", "You have successfuly logged out!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function show (User $user)
|
||||||
|
{
|
||||||
|
return view ("users.profile", compact ("user"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,21 @@ class User extends Authenticatable
|
|||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'name',
|
'name',
|
||||||
'email',
|
'email',
|
||||||
'password'
|
'password',
|
||||||
|
|
||||||
|
"bio",
|
||||||
|
"avatar",
|
||||||
|
"status",
|
||||||
|
"mood",
|
||||||
|
"about_you",
|
||||||
|
|
||||||
|
// interests
|
||||||
|
"interests_general",
|
||||||
|
"interests_music",
|
||||||
|
"interests_movies",
|
||||||
|
"interests_television",
|
||||||
|
"interests_books",
|
||||||
|
"interests_heroes"
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -14,6 +14,19 @@ return new class extends Migration
|
|||||||
Schema::table('users', function (Blueprint $table) {
|
Schema::table('users', function (Blueprint $table) {
|
||||||
$table->text ("bio")->nullable ();
|
$table->text ("bio")->nullable ();
|
||||||
$table->string ("avatar")->nullable ();
|
$table->string ("avatar")->nullable ();
|
||||||
|
|
||||||
|
$table->string ("status")->nullable ();
|
||||||
|
$table->string ("mood")->nullable ();
|
||||||
|
$table->string ("about_you")->nullable ();
|
||||||
|
|
||||||
|
// interests
|
||||||
|
$table->string ("interests_general")->nullable ();
|
||||||
|
$table->string ("interests_music")->nullable ();
|
||||||
|
$table->string ("interests_movies")->nullable ();
|
||||||
|
$table->string ("interests_television")->nullable ();
|
||||||
|
$table->string ("interests_books")->nullable ();
|
||||||
|
$table->string ("interests_heroes")->nullable ();
|
||||||
|
|
||||||
$table->integer ("friends")->default (0);
|
$table->integer ("friends")->default (0);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Before Width: | Height: | Size: 204 KiB After Width: | Height: | Size: 136 KiB |
BIN
img/OurSpaceProfile.png
Normal file
After Width: | Height: | Size: 126 KiB |
BIN
public/resources/icons/add.png
Normal file
After Width: | Height: | Size: 679 B |
BIN
public/resources/icons/arrow_right.png
Normal file
After Width: | Height: | Size: 341 B |
BIN
public/resources/icons/asterisk_yellow.png
Normal file
After Width: | Height: | Size: 685 B |
BIN
public/resources/icons/award_star_add.png
Normal file
After Width: | Height: | Size: 795 B |
BIN
public/resources/icons/clock.png
Normal file
After Width: | Height: | Size: 827 B |
BIN
public/resources/icons/comment.png
Normal file
After Width: | Height: | Size: 360 B |
BIN
public/resources/icons/delete.png
Normal file
After Width: | Height: | Size: 660 B |
BIN
public/resources/icons/email.png
Normal file
After Width: | Height: | Size: 584 B |
BIN
public/resources/icons/exclamation.png
Normal file
After Width: | Height: | Size: 646 B |
BIN
public/resources/icons/flag_red.png
Normal file
After Width: | Height: | Size: 606 B |
BIN
public/resources/icons/group_add.png
Normal file
After Width: | Height: | Size: 751 B |
BIN
public/resources/icons/hourglass.png
Normal file
After Width: | Height: | Size: 691 B |
BIN
public/resources/icons/script.png
Normal file
After Width: | Height: | Size: 693 B |
BIN
public/resources/icons/text_list_bullets.png
Normal file
After Width: | Height: | Size: 313 B |
BIN
public/resources/icons/tick.png
Normal file
After Width: | Height: | Size: 479 B |
BIN
public/resources/icons/user.png
Normal file
After Width: | Height: | Size: 685 B |
BIN
public/resources/icons/world.png
Normal file
After Width: | Height: | Size: 864 B |
Before Width: | Height: | Size: 101 B |
BIN
public/resources/img/favicon.ico
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
public/resources/img/green_person.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
@ -3718,3 +3718,15 @@ audio {
|
|||||||
.main-header a:visited {
|
.main-header a:visited {
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.profile-info {
|
||||||
|
height: 82px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#music {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 10px;
|
||||||
|
left: 10px;
|
||||||
|
width: 80px;
|
||||||
|
transition: 0.5s width;
|
||||||
|
}
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||||
<title>@yield ("title") | OurSpace</title>
|
<title>@yield ("title") | OurSpace</title>
|
||||||
|
|
||||||
|
<link rel="icon" href="/resources/img/favicon.ico" type="image/x-icon">
|
||||||
|
|
||||||
@vite(["/resources/css/app.css"])
|
@vite(["/resources/css/app.css"])
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
248
resources/views/users/profile.blade.php
Normal file
@ -0,0 +1,248 @@
|
|||||||
|
@extends ("partials.layout")
|
||||||
|
|
||||||
|
@section('title', "$user->name's Profile")
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="row profile">
|
||||||
|
|
||||||
|
<div class="col w-40 left">
|
||||||
|
<span>
|
||||||
|
<h1>{{ $user->name }}</h1>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<div class="general-about">
|
||||||
|
|
||||||
|
<div class="profile-pic">
|
||||||
|
<img loading="lazy" src="{{ $user->avatar }}" alt="{{ $user->name }}'s pfp" class="pfp-fa" style="width: 235px; height: auto">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="details">
|
||||||
|
<p>{{ $user->status }}</p>
|
||||||
|
<p>{{ $user->about_you }}</p>
|
||||||
|
<p class="online">
|
||||||
|
<img loading="lazy" src="/resources/img/green_person.png" alt="online"> ONLINE!
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<audio src="#" id="music" autoplay loop controls></audio>
|
||||||
|
|
||||||
|
<div class="mood">
|
||||||
|
<p><b>Mood:</b> {{ $user->mood }}</p>
|
||||||
|
<p><b>View my: <a href="#">Blog</a> | <a href="#">Bulletins</a></b></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="contact">
|
||||||
|
<div class="heading">
|
||||||
|
<h4>Contacting {{ $user->name }}</h4>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="inner">
|
||||||
|
<div class="f-row">
|
||||||
|
<div class="f-col">
|
||||||
|
<a href="#">
|
||||||
|
<img loading="lazy" src="/resources/icons/add.png" alt=""> Add to Friends
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="f-col">
|
||||||
|
<a href="#">
|
||||||
|
<img loading="lazy" src="/resources/icons/award_star_add.png" alt=""> Add to Favorites
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="f-row">
|
||||||
|
<div class="f-col">
|
||||||
|
<a href="#">
|
||||||
|
<img loading="lazy" class="icon" src="/resources/icons/comment.png" alt=""> Send Message
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="f-col">
|
||||||
|
<a href="#">
|
||||||
|
<img loading="lazy" class="icon" src="/resources/icons/arrow_right.png" alt=""> Forward to Friend
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="f-row">
|
||||||
|
<div class="f-col">
|
||||||
|
<a href="#">
|
||||||
|
<img loading="lazy" class="icon" src="/resources/icons/email.png" alt=""> Instant Message
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="f-col">
|
||||||
|
<a href="#">
|
||||||
|
<img loading="lazy" class="icon" src="/resources/icons/exclamation.png" alt=""> Block User
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="f-row">
|
||||||
|
<div class="f-col">
|
||||||
|
<a href="#">
|
||||||
|
<img loading="lazy" class="icon" src="/resources/icons/group_add.png" alt=""> Add to Group
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="f-col">
|
||||||
|
<a href="#">
|
||||||
|
<img loading="lazy" class="icon" src="/resources/icons/flag_red.png" alt=""> Report User
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="url-info">
|
||||||
|
<p>
|
||||||
|
<b>OurSpace URL:</b>
|
||||||
|
</p>
|
||||||
|
<p>{{ route ('users.show', [ 'user' => $user ]) }}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="table-section">
|
||||||
|
<div class="heading">
|
||||||
|
<h4>{{ $user->name }}'s Interests</h4>
|
||||||
|
</div>
|
||||||
|
<div class="inner">
|
||||||
|
<table class="details-table" cellspacing="3" cellpadding="3">
|
||||||
|
<tbody>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>General</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>{{ $user->interests_general }}</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>Music</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>{{ $user->interests_music }}</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>Movies</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>{{ $user->interests_movies }}</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>Television</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>{{ $user->interests_television }}</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>Books</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>{{ $user->interests_books }}</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p>Heroes</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>{{ $user->interests_heroes }}</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col right">
|
||||||
|
@auth
|
||||||
|
@if (auth()->user()->is($user))
|
||||||
|
<div class="profile-info">
|
||||||
|
<h3>
|
||||||
|
<a href="#">Edit Your Profile</a>
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
@endauth
|
||||||
|
|
||||||
|
<div class="blog-preview">
|
||||||
|
<h4>
|
||||||
|
{{ $user->name }}'s Latest Blog Entries [<a href="#">View Blog</a>]
|
||||||
|
</h4>
|
||||||
|
<p>
|
||||||
|
<i>There are no Blog Entries yet.</i>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="blurbs">
|
||||||
|
<div class="heading">
|
||||||
|
<h4>
|
||||||
|
{{ $user->name }}'s Bio
|
||||||
|
</h4>
|
||||||
|
</div>
|
||||||
|
<div class="inner">
|
||||||
|
<div class="section">
|
||||||
|
<p>{{ $user->bio }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="friends">
|
||||||
|
<div class="heading">
|
||||||
|
<h4>
|
||||||
|
{{ $user->name }}'s Friend Space
|
||||||
|
</h4>
|
||||||
|
<a href="#" class="more">[view all]</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="inner">
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<b>
|
||||||
|
{{ $user->name }} has <span class="count">{{ $user->friends }}</span> friends.
|
||||||
|
</b>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div class="friends-grid"></div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="comments" class="friends">
|
||||||
|
<div class="heading">
|
||||||
|
<h4>{{ $user->name }}'s Friends Comments</h4>
|
||||||
|
</div>
|
||||||
|
<div class="inner">
|
||||||
|
<p>
|
||||||
|
<b>
|
||||||
|
Displaying <span class="count">0</span> of <span class="count">0</span> comments (<a href="#">View all</a> | <a href="#">Add Comment</a>)
|
||||||
|
</b>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<table class="comments-table" cellspacing="0" cellpadding="3" bordercollor="#ffffff" border="1">
|
||||||
|
<tbody></tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
@endsection
|
@ -14,4 +14,6 @@ Route::get ("/auth/logout", [ UserController::class, "logout" ])->name ("logout"
|
|||||||
Route::post ("/auth/signup", [ UserController::class, "do_signup" ])->middleware ("guest");
|
Route::post ("/auth/signup", [ UserController::class, "do_signup" ])->middleware ("guest");
|
||||||
Route::post ("/auth/login", [ UserController::class, "do_login" ])->middleware ("guest");
|
Route::post ("/auth/login", [ UserController::class, "do_login" ])->middleware ("guest");
|
||||||
|
|
||||||
|
Route::get ("/user/{user:name}", [ UserController::class, "show" ])->name ("users.show");
|
||||||
|
|
||||||
require __DIR__ . "/api.php";
|
require __DIR__ . "/api.php";
|
||||||
|