diff --git a/README.md b/README.md index 4d77cc1..eea5099 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 0d032ba..f910167 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -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")); + } } diff --git a/app/Models/User.php b/app/Models/User.php index 9d71f7b..b7755a8 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -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" ]; /** diff --git a/database/migrations/2024_12_25_222706_add_fields_to_user_table.php b/database/migrations/2024_12_25_222706_add_fields_to_user_table.php index 09312b3..dc3b4a4 100644 --- a/database/migrations/2024_12_25_222706_add_fields_to_user_table.php +++ b/database/migrations/2024_12_25_222706_add_fields_to_user_table.php @@ -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); }); } diff --git a/img/OurSpaceHome.png b/img/OurSpaceHome.png index c7d8691..5b36102 100644 Binary files a/img/OurSpaceHome.png and b/img/OurSpaceHome.png differ diff --git a/img/OurSpaceProfile.png b/img/OurSpaceProfile.png new file mode 100644 index 0000000..7db5d75 Binary files /dev/null and b/img/OurSpaceProfile.png differ diff --git a/public/resources/icons/add.png b/public/resources/icons/add.png new file mode 100644 index 0000000..105693f Binary files /dev/null and b/public/resources/icons/add.png differ diff --git a/public/resources/icons/arrow_right.png b/public/resources/icons/arrow_right.png new file mode 100644 index 0000000..62bc0b0 Binary files /dev/null and b/public/resources/icons/arrow_right.png differ diff --git a/public/resources/icons/asterisk_yellow.png b/public/resources/icons/asterisk_yellow.png new file mode 100644 index 0000000..0d7f5f3 Binary files /dev/null and b/public/resources/icons/asterisk_yellow.png differ diff --git a/public/resources/icons/award_star_add.png b/public/resources/icons/award_star_add.png new file mode 100644 index 0000000..5be957f Binary files /dev/null and b/public/resources/icons/award_star_add.png differ diff --git a/public/resources/icons/clock.png b/public/resources/icons/clock.png new file mode 100644 index 0000000..9dc1a85 Binary files /dev/null and b/public/resources/icons/clock.png differ diff --git a/public/resources/icons/comment.png b/public/resources/icons/comment.png new file mode 100644 index 0000000..0e848cc Binary files /dev/null and b/public/resources/icons/comment.png differ diff --git a/public/resources/icons/delete.png b/public/resources/icons/delete.png new file mode 100644 index 0000000..5df538d Binary files /dev/null and b/public/resources/icons/delete.png differ diff --git a/public/resources/icons/email.png b/public/resources/icons/email.png new file mode 100644 index 0000000..1f8d4a1 Binary files /dev/null and b/public/resources/icons/email.png differ diff --git a/public/resources/icons/exclamation.png b/public/resources/icons/exclamation.png new file mode 100644 index 0000000..831e996 Binary files /dev/null and b/public/resources/icons/exclamation.png differ diff --git a/public/resources/icons/flag_red.png b/public/resources/icons/flag_red.png new file mode 100644 index 0000000..648e5bf Binary files /dev/null and b/public/resources/icons/flag_red.png differ diff --git a/public/resources/icons/group_add.png b/public/resources/icons/group_add.png new file mode 100644 index 0000000..2726c5f Binary files /dev/null and b/public/resources/icons/group_add.png differ diff --git a/public/resources/icons/hourglass.png b/public/resources/icons/hourglass.png new file mode 100644 index 0000000..88cd668 Binary files /dev/null and b/public/resources/icons/hourglass.png differ diff --git a/public/resources/icons/script.png b/public/resources/icons/script.png new file mode 100644 index 0000000..7169ca1 Binary files /dev/null and b/public/resources/icons/script.png differ diff --git a/public/resources/icons/text_list_bullets.png b/public/resources/icons/text_list_bullets.png new file mode 100644 index 0000000..78d6c54 Binary files /dev/null and b/public/resources/icons/text_list_bullets.png differ diff --git a/public/resources/icons/tick.png b/public/resources/icons/tick.png new file mode 100644 index 0000000..3a34002 Binary files /dev/null and b/public/resources/icons/tick.png differ diff --git a/public/resources/icons/user.png b/public/resources/icons/user.png new file mode 100644 index 0000000..c72d2e7 Binary files /dev/null and b/public/resources/icons/user.png differ diff --git a/public/resources/icons/world.png b/public/resources/icons/world.png new file mode 100644 index 0000000..644068e Binary files /dev/null and b/public/resources/icons/world.png differ diff --git a/public/resources/img/divider_o.png b/public/resources/img/divider_o.png deleted file mode 100644 index 6e7f22b..0000000 Binary files a/public/resources/img/divider_o.png and /dev/null differ diff --git a/public/resources/img/favicon.ico b/public/resources/img/favicon.ico new file mode 100644 index 0000000..2db964e Binary files /dev/null and b/public/resources/img/favicon.ico differ diff --git a/public/resources/img/green_person.png b/public/resources/img/green_person.png new file mode 100644 index 0000000..b2af56e Binary files /dev/null and b/public/resources/img/green_person.png differ diff --git a/resources/css/style.css b/resources/css/style.css index 1e6455c..2cf73c6 100644 --- a/resources/css/style.css +++ b/resources/css/style.css @@ -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; +} diff --git a/resources/views/partials/layout.blade.php b/resources/views/partials/layout.blade.php index 626c48f..6d0d372 100644 --- a/resources/views/partials/layout.blade.php +++ b/resources/views/partials/layout.blade.php @@ -6,6 +6,8 @@ @yield ("title") | OurSpace + + @vite(["/resources/css/app.css"]) diff --git a/resources/views/users/profile.blade.php b/resources/views/users/profile.blade.php new file mode 100644 index 0000000..ec18c68 --- /dev/null +++ b/resources/views/users/profile.blade.php @@ -0,0 +1,248 @@ +@extends ("partials.layout") + +@section('title', "$user->name's Profile") + +@section('content') +
+ +
+ +

{{ $user->name }}

+
+ +
+ +
+ {{ $user->name }}'s pfp +
+ +
+

{{ $user->status }}

+

{{ $user->about_you }}

+

+ online ONLINE! +

+
+ +
+ + + +
+

Mood: {{ $user->mood }}

+

View my: Blog | Bulletins

+
+ +
+
+

Contacting {{ $user->name }}

+
+ + +
+ +
+

+ OurSpace URL: +

+

{{ route ('users.show', [ 'user' => $user ]) }}

+
+ +
+
+

{{ $user->name }}'s Interests

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

General

+
+

{{ $user->interests_general }}

+
+

Music

+
+

{{ $user->interests_music }}

+
+

Movies

+
+

{{ $user->interests_movies }}

+
+

Television

+
+

{{ $user->interests_television }}

+
+

Books

+
+

{{ $user->interests_books }}

+
+

Heroes

+
+

{{ $user->interests_heroes }}

+
+
+
+
+ +
+ @auth + @if (auth()->user()->is($user)) + + @endif + @endauth + +
+

+ {{ $user->name }}'s Latest Blog Entries [View Blog] +

+

+ There are no Blog Entries yet. +

+
+ +
+
+

+ {{ $user->name }}'s Bio +

+
+
+
+

{{ $user->bio }}

+
+
+
+ +
+
+

+ {{ $user->name }}'s Friend Space +

+ [view all] +
+ +
+ +

+ + {{ $user->name }} has {{ $user->friends }} friends. + +

+ +
+ +
+
+ +
+
+

{{ $user->name }}'s Friends Comments

+
+
+

+ + Displaying 0 of 0 comments (View all | Add Comment) + +

+ + + +
+
+
+
+ +
+@endsection diff --git a/routes/web.php b/routes/web.php index 65f754f..7ef5f40 100644 --- a/routes/web.php +++ b/routes/web.php @@ -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";