created a new component for showing users
This commit is contained in:
parent
4cd0dc96df
commit
a2ddb90ae9
@ -41,6 +41,8 @@ Notice that the styles were taken from [AnySpace](https://anyspace.3to.moe/about
|
||||
- [ ] Delete posts
|
||||
- [ ] Like posts
|
||||
- [ ] Comment posts
|
||||
- [ ] Boost posts
|
||||
- [ ] Post tags
|
||||
- [ ] Blog
|
||||
- [ ] Bulletin
|
||||
- [ ] Groups
|
||||
|
@ -22,6 +22,7 @@ class APActorController extends Controller
|
||||
|
||||
public function followers (User $user)
|
||||
{
|
||||
// TODO: Rewrite this using the follow model
|
||||
$followers = Activity::where ("type", "Follow")->where ("object", $user->actor->actor_id);
|
||||
$ordered_collection = new TypeOrderedCollection ();
|
||||
$ordered_collection->collection = $followers->get ()->pluck ("actor")->toArray ();
|
||||
@ -38,6 +39,7 @@ class APActorController extends Controller
|
||||
|
||||
public function following (User $user)
|
||||
{
|
||||
// TODO: Rewrite this using the follow model
|
||||
$following = Activity::where ("type", "Follow")->where ("actor", $user->actor->actor_id);
|
||||
$ordered_collection = new TypeOrderedCollection ();
|
||||
$ordered_collection->collection = $following->get ()->pluck ("object")->toArray ();
|
||||
|
@ -22,7 +22,7 @@ class APInstanceInboxController extends Controller
|
||||
$activity_type = $activity['type'];
|
||||
|
||||
Log::info ("APInstanceInboxController:inbox");
|
||||
Log::info ($activity);
|
||||
Log::info (json_encode ($activity));
|
||||
|
||||
switch ($activity_type)
|
||||
{
|
||||
|
@ -71,8 +71,8 @@ class Actor extends Model
|
||||
|
||||
public function friends_with (Actor $actor)
|
||||
{
|
||||
$following = Activity::where ("actor", $this->actor_id)->where ("type", "Follow")->where ("object", '"' . $actor->actor_id . '"')->first ();
|
||||
$followers = Activity::where ("actor", $actor->actor_id)->where ("type", "Follow")->where ("object", '"' . $this->actor_id . '"')->first ();
|
||||
$following = Follow::where ("actor", $this->id)->where ("object", $actor->id)->first ();
|
||||
$followers = Follow::where ("actor", $actor->id)->where ("object", $this->id)->first ();
|
||||
|
||||
return $following && $followers;
|
||||
}
|
||||
|
9
resources/views/components/user_block.blade.php
Normal file
9
resources/views/components/user_block.blade.php
Normal file
@ -0,0 +1,9 @@
|
||||
<div class="person">
|
||||
<a href="{{ route ('users.show', [ 'user_name' => $user->name ]) }}">
|
||||
<p>{{ $user->name }}</p>
|
||||
</a>
|
||||
<a href="{{ route ('users.show', [ 'user_name' => $user->name ]) }}">
|
||||
<img loading="lazy" src="{{ $user->avatar }}" alt="{{ $user->name }}'s profile picture"
|
||||
class="pfp-fallback" style="width: 100%; max-height: 95px; aspect-ratio: 1/1">
|
||||
</a>
|
||||
</div>
|
@ -14,15 +14,7 @@
|
||||
</div>
|
||||
<div class="inner">
|
||||
@foreach ($latest_users as $user)
|
||||
<div class="person">
|
||||
<a href="{{ route ('users.show', [ 'user_name' => $user->name ]) }}">
|
||||
<p>{{ $user->name }}</p>
|
||||
</a>
|
||||
<a href="{{ route ('users.show', [ 'user_name' => $user->name ]) }}">
|
||||
<img loading="lazy" src="{{ $user->avatar }}" alt="{{ $user->name }}'s profile picture"
|
||||
class="pfp-fallback" style="width: 100%; max-height: 95px; aspect-ratio: 1/1">
|
||||
</a>
|
||||
</div>
|
||||
<x-user_block :user="$user" />
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
@ -100,6 +100,19 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="new-people cool">
|
||||
<div class="top">
|
||||
<h4>Cool New People</h4>
|
||||
<a href="#" class="more">[view more]</a>
|
||||
</div>
|
||||
|
||||
<div class="inner">
|
||||
@foreach ($latest_users as $user)
|
||||
<x-user_block :user="$user" />
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="friends">
|
||||
<div class="heading">
|
||||
<h4>Friend Requests</h4>
|
||||
@ -119,8 +132,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="new-people cool">
|
||||
<div class="top">
|
||||
<div class="bulletin-preview">
|
||||
<div class="heading">
|
||||
<h4>Feed</h4>
|
||||
</div>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user