mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 22:41:27 +00:00
Update ProfileController and partial, fix status count
This commit is contained in:
parent
c636aae3b7
commit
f746299711
2 changed files with 8 additions and 2 deletions
|
@ -18,7 +18,12 @@ class ProfileController extends Controller
|
||||||
public function show(Request $request, $username)
|
public function show(Request $request, $username)
|
||||||
{
|
{
|
||||||
$user = Profile::whereUsername($username)->firstOrFail();
|
$user = Profile::whereUsername($username)->firstOrFail();
|
||||||
|
if($user->remote_url) {
|
||||||
|
$settings = new \StdClass;
|
||||||
|
$settings->crawlable = false;
|
||||||
|
} else {
|
||||||
$settings = User::whereUsername($username)->firstOrFail()->settings;
|
$settings = User::whereUsername($username)->firstOrFail()->settings;
|
||||||
|
}
|
||||||
|
|
||||||
if($request->wantsJson() && config('pixelfed.activitypub_enabled')) {
|
if($request->wantsJson() && config('pixelfed.activitypub_enabled')) {
|
||||||
return $this->showActivityPub($request, $user);
|
return $this->showActivityPub($request, $user);
|
||||||
|
@ -37,6 +42,7 @@ class ProfileController extends Controller
|
||||||
$timeline = $user->statuses()
|
$timeline = $user->statuses()
|
||||||
->whereHas('media')
|
->whereHas('media')
|
||||||
->whereNull('in_reply_to_id')
|
->whereNull('in_reply_to_id')
|
||||||
|
->whereNull('reblog_of_id')
|
||||||
->orderBy('created_at','desc')
|
->orderBy('created_at','desc')
|
||||||
->withCount(['comments', 'likes'])
|
->withCount(['comments', 'likes'])
|
||||||
->simplePaginate(21);
|
->simplePaginate(21);
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
<div class="profile-stats pb-3 d-inline-flex lead">
|
<div class="profile-stats pb-3 d-inline-flex lead">
|
||||||
<div class="font-weight-light pr-5">
|
<div class="font-weight-light pr-5">
|
||||||
<a class="text-dark" href="{{$user->url()}}">
|
<a class="text-dark" href="{{$user->url()}}">
|
||||||
<span class="font-weight-bold">{{$user->statuses()->whereNull('in_reply_to_id')->count()}}</span>
|
<span class="font-weight-bold">{{$user->statuses()->whereNull('reblog_of_id')->whereNull('in_reply_to_id')->count()}}</span>
|
||||||
Posts
|
Posts
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue