mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-24 14:03:16 +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();
|
$user = Profile::whereUsername($username)->firstOrFail();
|
||||||
|
|
||||||
$status = Status::whereProfileId($user->id)
|
$status = Status::whereProfileId($user->id)
|
||||||
|
->where('visibility', '!=', 'draft')
|
||||||
->withCount(['likes', 'comments', 'media'])
|
->withCount(['likes', 'comments', 'media'])
|
||||||
->findOrFail($id);
|
->findOrFail($id);
|
||||||
|
|
||||||
|
@ -41,7 +42,7 @@ class StatusController extends Controller
|
||||||
|
|
||||||
$template = $this->detectTemplate($status);
|
$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'));
|
return view($template, compact('user', 'status', 'replies'));
|
||||||
}
|
}
|
||||||
|
@ -59,6 +60,9 @@ class StatusController extends Controller
|
||||||
if ($status->viewType() == 'video') {
|
if ($status->viewType() == 'video') {
|
||||||
$template = 'status.show.video';
|
$template = 'status.show.video';
|
||||||
}
|
}
|
||||||
|
if ($status->viewType() == 'video-album') {
|
||||||
|
$template = 'status.show.video-album';
|
||||||
|
}
|
||||||
|
|
||||||
return $template;
|
return $template;
|
||||||
});
|
});
|
||||||
|
@ -85,13 +89,7 @@ class StatusController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->validate($request, [
|
$this->validate($request, [
|
||||||
'photo.*' => function() {
|
'photo.*' => 'required|mimetypes:' . config('pixelfed.media_types').'|max:' . config('pixelfed.max_photo_size'),
|
||||||
return [
|
|
||||||
'required',
|
|
||||||
'mimes:' . config('pixelfed.media_types'),
|
|
||||||
'max:' . config('pixelfed.max_photo_size'),
|
|
||||||
];
|
|
||||||
},
|
|
||||||
'caption' => 'string|max:'.config('pixelfed.max_caption_length'),
|
'caption' => 'string|max:'.config('pixelfed.max_caption_length'),
|
||||||
'cw' => 'nullable|string',
|
'cw' => 'nullable|string',
|
||||||
'filter_class' => 'nullable|string',
|
'filter_class' => 'nullable|string',
|
||||||
|
|
Loading…
Reference in a new issue