mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-30 02:03:16 +00:00
Update ProfileController
This commit is contained in:
parent
3abd5d9b1a
commit
ad5551ed5e
1 changed files with 12 additions and 11 deletions
|
@ -66,18 +66,9 @@ class ProfileController extends Controller
|
||||||
if ($isPrivate == true || $isBlocked == true) {
|
if ($isPrivate == true || $isBlocked == true) {
|
||||||
return view('profile.private', compact('user', 'is_following'));
|
return view('profile.private', compact('user', 'is_following'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$is_admin = is_null($user->domain) ? $user->user->is_admin : false;
|
$is_admin = is_null($user->domain) ? $user->user->is_admin : false;
|
||||||
$timeline = $user->statuses()
|
$profile = $user;
|
||||||
->whereHas('media')
|
return view('profile.show', compact('user', 'profile', 'settings', 'owner', 'is_following', 'is_admin', 'timeline'));
|
||||||
->whereNull('in_reply_to_id')
|
|
||||||
->whereNull('reblog_of_id')
|
|
||||||
->whereIn('visibility', ['public', 'unlisted'])
|
|
||||||
->orderBy('created_at', 'desc')
|
|
||||||
->withCount(['comments', 'likes'])
|
|
||||||
->simplePaginate(21);
|
|
||||||
|
|
||||||
return view('profile.show', compact('user', 'settings', 'owner', 'is_following', 'is_admin', 'timeline'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function permalinkRedirect(Request $request, $username)
|
public function permalinkRedirect(Request $request, $username)
|
||||||
|
@ -130,6 +121,7 @@ class ProfileController extends Controller
|
||||||
{
|
{
|
||||||
switch ($profile->status) {
|
switch ($profile->status) {
|
||||||
case 'disabled':
|
case 'disabled':
|
||||||
|
case 'suspended':
|
||||||
case 'delete':
|
case 'delete':
|
||||||
return view('profile.disabled');
|
return view('profile.disabled');
|
||||||
break;
|
break;
|
||||||
|
@ -248,4 +240,13 @@ class ProfileController extends Controller
|
||||||
$is_admin = is_null($user->domain) ? $user->user->is_admin : false;
|
$is_admin = is_null($user->domain) ? $user->user->is_admin : false;
|
||||||
return view('profile.show', compact('user', 'settings', 'owner', 'following', 'timeline', 'is_following', 'is_admin'));
|
return view('profile.show', compact('user', 'settings', 'owner', 'following', 'timeline', 'is_following', 'is_admin'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function createCollection(Request $request)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function collections(Request $request)
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue