mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-23 21:43:17 +00:00
Update StatusController
This commit is contained in:
parent
4688e6c605
commit
8c111d22c6
1 changed files with 6 additions and 8 deletions
|
@ -22,6 +22,7 @@ class StatusController extends Controller
|
|||
$user = Profile::whereUsername($username)->firstOrFail();
|
||||
|
||||
$status = Status::whereProfileId($user->id)
|
||||
->where('visibility', '!=', 'draft')
|
||||
->withCount(['likes', 'comments', 'media'])
|
||||
->findOrFail($id);
|
||||
|
||||
|
@ -41,7 +42,7 @@ class StatusController extends Controller
|
|||
|
||||
$template = $this->detectTemplate($status);
|
||||
|
||||
$replies = Status::whereInReplyToId($status->id)->simplePaginate(30);
|
||||
$replies = Status::whereInReplyToId($status->id)->orderBy('created_at', 'desc')->simplePaginate(30);
|
||||
|
||||
return view($template, compact('user', 'status', 'replies'));
|
||||
}
|
||||
|
@ -59,6 +60,9 @@ class StatusController extends Controller
|
|||
if ($status->viewType() == 'video') {
|
||||
$template = 'status.show.video';
|
||||
}
|
||||
if ($status->viewType() == 'video-album') {
|
||||
$template = 'status.show.video-album';
|
||||
}
|
||||
|
||||
return $template;
|
||||
});
|
||||
|
@ -85,13 +89,7 @@ class StatusController extends Controller
|
|||
}
|
||||
|
||||
$this->validate($request, [
|
||||
'photo.*' => function() {
|
||||
return [
|
||||
'required',
|
||||
'mimes:' . config('pixelfed.media_types'),
|
||||
'max:' . config('pixelfed.max_photo_size'),
|
||||
];
|
||||
},
|
||||
'photo.*' => 'required|mimetypes:' . config('pixelfed.media_types').'|max:' . config('pixelfed.max_photo_size'),
|
||||
'caption' => 'string|max:'.config('pixelfed.max_caption_length'),
|
||||
'cw' => 'nullable|string',
|
||||
'filter_class' => 'nullable|string',
|
||||
|
|
Loading…
Reference in a new issue