Added profile page

This commit is contained in:
Ghostie 2024-12-26 21:21:25 -05:00
parent 26800a3700
commit 5b6bbc6883
30 changed files with 336 additions and 3 deletions

View File

@ -7,7 +7,44 @@ Notice that the styles were taken from [AnySpace](https://anyspace.3to.moe/about
## Overview
![](img/OurSpaceHome.png)
![](img/OurSpaceProfile.png)
## 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

View File

@ -22,7 +22,7 @@ class UserController extends Controller
public function do_signup (Request $request)
{
$incoming_fields = $request->validate ([
"name" => "required",
"name" => "required|alpha_dash",
"email" => "required|email|unique:users",
"password" => "required|confirmed"
]);
@ -55,4 +55,9 @@ class UserController extends Controller
return redirect ()->route ("login")->with ("success", "You have successfuly logged out!");
}
public function show (User $user)
{
return view ("users.profile", compact ("user"));
}
}

View File

@ -21,7 +21,21 @@ class User extends Authenticatable
protected $fillable = [
'name',
'email',
'password'
'password',
"bio",
"avatar",
"status",
"mood",
"about_you",
// interests
"interests_general",
"interests_music",
"interests_movies",
"interests_television",
"interests_books",
"interests_heroes"
];
/**

View File

@ -14,6 +14,19 @@ return new class extends Migration
Schema::table('users', function (Blueprint $table) {
$table->text ("bio")->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);
});
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 204 KiB

After

Width:  |  Height:  |  Size: 136 KiB

BIN
img/OurSpaceProfile.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 679 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 685 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 795 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 827 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 360 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 660 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 584 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 646 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 606 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 751 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 691 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 693 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 313 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 479 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 685 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 864 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@ -3718,3 +3718,15 @@ audio {
.main-header a:visited {
color: #ffffff;
}
.profile-info {
height: 82px;
}
#music {
position: fixed;
bottom: 10px;
left: 10px;
width: 80px;
transition: 0.5s width;
}

View File

@ -6,6 +6,8 @@
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>@yield ("title") | OurSpace</title>
<link rel="icon" href="/resources/img/favicon.ico" type="image/x-icon">
@vite(["/resources/css/app.css"])
</head>
<body>

View 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

View File

@ -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/login", [ UserController::class, "do_login" ])->middleware ("guest");
Route::get ("/user/{user:name}", [ UserController::class, "show" ])->name ("users.show");
require __DIR__ . "/api.php";