Merge branch 'main' of https://github.com/gyorkistamas/afp1_nagy_ncob
This commit is contained in:
commit
fdb28cae26
@ -104,4 +104,9 @@ class UserController extends Controller
|
||||
User::where('id', $uid)->update([$field => $b]);
|
||||
}
|
||||
|
||||
//View User:
|
||||
public function view(User $user) {
|
||||
return view('users.view', ['user' => $user]);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -81,7 +81,7 @@
|
||||
@if (Auth::check())
|
||||
|
||||
<li class="nav-item mt-2 mt-lg-0">
|
||||
<a href="#" class="nav-link navitem mt-3 mt-xl-0 mb-2 mb-xl-0"><img
|
||||
<a href="/users/{{Auth::User()->id}}/view" class="nav-link navitem mt-3 mt-xl-0 {{ Request::is('users/*/view') ? 'active' : '' }} mb-2 mb-xl-0"><img
|
||||
src="/images/icons/viewProfileIcon.png">Profil megtekintése</a>
|
||||
</li>
|
||||
|
||||
|
55
picquiz/resources/views/users/view.blade.php
Normal file
55
picquiz/resources/views/users/view.blade.php
Normal file
@ -0,0 +1,55 @@
|
||||
@extends('template')
|
||||
|
||||
@section('title')
|
||||
<title>{{Str::title(Auth::User()->username)}} megtekintése</title>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
|
||||
<section class="vh-100">
|
||||
<div class="container py-5 h-100">
|
||||
<div class="row d-flex justify-content-center align-items-center h-100">
|
||||
<div class="col-md-12 col-xl-4">
|
||||
|
||||
<div class="card bg-dark text-white" style="border-radius: 15px;">
|
||||
<div class="card-body text-center">
|
||||
<div class="mt-3 mb-4">
|
||||
<img src="{{Auth::User()->profile_picture}}"
|
||||
class="rounded-circle img-fluid" style="width: 100px;" />
|
||||
</div>
|
||||
<h4 class="mb-2">{{Auth::User()->username}}</h4>
|
||||
<p class="text-white mb-4">{{Auth::User()->isAdmin == 1 ? '@Adminisztrátor' : '@Felhasználó'}} <span class="mx-2">|</span>
|
||||
<a href="#!">{{Auth::User()->email}}</a>
|
||||
</p>
|
||||
|
||||
<div class="mb-4 pb-2">
|
||||
<p class="mb-2 h5">{{Auth::User()->created_at}}</p>
|
||||
<p class="text-white mb-4">Csatlakozás ideje</p>
|
||||
</div>
|
||||
|
||||
<button type="button" class="btn btn-primary btn-rounded btn-lg">
|
||||
Profil szerkesztése
|
||||
</button>
|
||||
<div class="d-flex justify-content-between text-center mt-5 mb-2">
|
||||
<div>
|
||||
<p class="mb-2 h5">{{Auth::User()->numberOfGames}}</p>
|
||||
<p class="text-white mb-0">Játszmák száma</p>
|
||||
</div>
|
||||
<div class="px-3">
|
||||
<p class="mb-2 h5">{{Auth::User()->numberOfHits}}</p>
|
||||
<p class="text-white mb-0">Eltalált feladványok</p>
|
||||
</div>
|
||||
<div>
|
||||
<p class="mb-2 h5">{{ Auth::User()->numberOfGames == 0 ? 0 : (Auth::User()->numberOfHits / Auth::User()->numberOfGames) * 100 }} %</p>
|
||||
<p class="text-white mb-0">Találati arány</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
|
@ -30,13 +30,16 @@ Route::get('/register', [UserController::class, 'create']);
|
||||
Route::post('/users', [UserController::class, 'store']);
|
||||
|
||||
//Route to login form:
|
||||
Route::get('/login', [UserController::class, 'login']);
|
||||
Route::get('/login', [UserController::class, 'login'])->name('login');
|
||||
|
||||
//Route to login user (login logic):
|
||||
Route::post('/users/authenticate', [UserController::class, 'authenticate']);
|
||||
|
||||
Route::get('/logout', [UserController::class, 'logout']);
|
||||
|
||||
//----------------- User routes ---------------------
|
||||
Route::get('/users/{userID}/view', [UserController::class, 'view'])->middleware('auth');
|
||||
|
||||
|
||||
//--------- Feedback routes ----------------------------------------
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user