some css tweaks and other minor improvements/fixes

This commit is contained in:
noxy
2019-11-27 15:23:48 +00:00
parent 5fc7bf3036
commit 50ba00431b
35 changed files with 880 additions and 104 deletions

View File

@@ -145,8 +145,8 @@ class UserController extends Controller
$validator = \Validator::make($request->all(), [
'username' => 'required|unique:users|min:3|max:25|alpha_num',
'email' => 'required|email|unique:users|confirmed',
'password' => 'required|min:6|confirmed'
//'g-recaptcha-response' => 'required|recaptcha'
'password' => 'required|min:6|confirmed',
'captcha' => 'required|captcha'
]);
if($validator->fails()) {
@@ -368,6 +368,31 @@ class UserController extends Controller
]);
}
public function bestof() {
$user = UserFavorite::where('username', '=', sirx)->first();
if (!$user) {
return redirect()->back()->with('error', 'Unknown username');
}
$vid = $user->videos()->filtered()->find($id);
if (!$vid) {
return redirect()->back()->with('error', 'Video not found on user');
}
$sfw = $vid->tags->contains(function($key, $tag) {
return $tag->normalized === 'sfw';
});
return view('best', [
'video' => $vid,
'related' => $user,
'banner' => Banner::getRandom($vid->isSfw()),
'sfw' => $sfw,
]);
}
// TODO: Cleanup. less Repetion between random and random_vav/play and play_fav
// Only difference are the redirect urls and the Base Model
public function random_fav($username) {