|
|
@ -39,23 +39,14 @@ class UserController extends AbstractController |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#[Route( |
|
|
|
#[Route( |
|
|
|
'/{_locale}/{page}', |
|
|
|
'/{_locale}', |
|
|
|
name: 'user_dashboard', |
|
|
|
name: 'user_dashboard', |
|
|
|
requirements: |
|
|
|
|
|
|
|
[ |
|
|
|
|
|
|
|
'page' => '\d+', |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
defaults: |
|
|
|
|
|
|
|
[ |
|
|
|
|
|
|
|
'page' => 1, |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
methods: |
|
|
|
methods: |
|
|
|
[ |
|
|
|
[ |
|
|
|
'GET' |
|
|
|
'GET' |
|
|
|
] |
|
|
|
] |
|
|
|
)] |
|
|
|
)] |
|
|
|
public function index( |
|
|
|
public function index( |
|
|
|
int $page, |
|
|
|
|
|
|
|
Request $request, |
|
|
|
Request $request, |
|
|
|
UserService $userService, |
|
|
|
UserService $userService, |
|
|
|
ActivityService $activityService |
|
|
|
ActivityService $activityService |
|
|
@ -71,6 +62,8 @@ class UserController extends AbstractController |
|
|
|
$user->getEvents() |
|
|
|
$user->getEvents() |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$page = $request->get('page') ? (int) $request->get('page') : 1; |
|
|
|
|
|
|
|
|
|
|
|
return $this->render( |
|
|
|
return $this->render( |
|
|
|
'default/user/dashboard.html.twig', |
|
|
|
'default/user/dashboard.html.twig', |
|
|
|
[ |
|
|
|
[ |
|
|
@ -206,22 +199,18 @@ class UserController extends AbstractController |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#[Route( |
|
|
|
#[Route( |
|
|
|
'/{_locale}/profile/{userId}/{page}', |
|
|
|
'/{_locale}/profile/{userId}', |
|
|
|
name: 'user_info', |
|
|
|
name: 'user_info', |
|
|
|
defaults: [ |
|
|
|
defaults: [ |
|
|
|
'_locale' => '%app.locale%', |
|
|
|
'_locale' => '%app.locale%', |
|
|
|
'userId' => 0, |
|
|
|
'userId' => 0, |
|
|
|
'page' => 1, |
|
|
|
|
|
|
|
], |
|
|
|
], |
|
|
|
requirements: [ |
|
|
|
requirements: [ |
|
|
|
'_locale' => '%app.locales%', |
|
|
|
'_locale' => '%app.locales%', |
|
|
|
'userId' => '\d+', |
|
|
|
'userId' => '\d+', |
|
|
|
'page' => '\d+', |
|
|
|
|
|
|
|
], |
|
|
|
], |
|
|
|
)] |
|
|
|
)] |
|
|
|
public function info( |
|
|
|
public function info( |
|
|
|
int $userId, |
|
|
|
|
|
|
|
int $page, |
|
|
|
|
|
|
|
Request $request, |
|
|
|
Request $request, |
|
|
|
TranslatorInterface $translator, |
|
|
|
TranslatorInterface $translator, |
|
|
|
UserService $userService, |
|
|
|
UserService $userService, |
|
|
@ -245,7 +234,7 @@ class UserController extends AbstractController |
|
|
|
|
|
|
|
|
|
|
|
// Init target user |
|
|
|
// Init target user |
|
|
|
if (!$userTarget = $userService->getUser( |
|
|
|
if (!$userTarget = $userService->getUser( |
|
|
|
$userId ? $userId : $user->getId() |
|
|
|
$request->get('userId') ? $request->get('userId') : $user->getId() |
|
|
|
)) |
|
|
|
)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
throw $this->createNotFoundException(); |
|
|
|
throw $this->createNotFoundException(); |
|
|
@ -257,6 +246,9 @@ class UserController extends AbstractController |
|
|
|
$user->getEvents() |
|
|
|
$user->getEvents() |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Init page |
|
|
|
|
|
|
|
$page = $request->get('page') ? (int) $request->get('page') : 1; |
|
|
|
|
|
|
|
|
|
|
|
// Render template |
|
|
|
// Render template |
|
|
|
return $this->render( |
|
|
|
return $this->render( |
|
|
|
'default/user/info.html.twig', |
|
|
|
'default/user/info.html.twig', |
|
|
|