mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2026-03-31 17:15:38 +00:00
update torrent features
This commit is contained in:
parent
d1f8c126b0
commit
e713c17333
16 changed files with 661 additions and 329 deletions
|
|
@ -31,57 +31,13 @@ class UserController extends AbstractController
|
|||
);
|
||||
|
||||
return $this->redirectToRoute(
|
||||
'user_dashboard',
|
||||
'torrent_recent',
|
||||
[
|
||||
'_locale' => $user->getLocale()
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
#[Route(
|
||||
'/{_locale}',
|
||||
name: 'user_dashboard',
|
||||
methods:
|
||||
[
|
||||
'GET'
|
||||
]
|
||||
)]
|
||||
public function index(
|
||||
Request $request,
|
||||
UserService $userService,
|
||||
ActivityService $activityService
|
||||
): Response
|
||||
{
|
||||
$user = $this->initUser(
|
||||
$request,
|
||||
$userService,
|
||||
$activityService
|
||||
);
|
||||
|
||||
$total = $activityService->findActivitiesTotal(
|
||||
$user->getEvents()
|
||||
);
|
||||
|
||||
$page = $request->get('page') ? (int) $request->get('page') : 1;
|
||||
|
||||
return $this->render(
|
||||
'default/user/dashboard.html.twig',
|
||||
[
|
||||
'activities' => $activityService->findLastActivities( // @TODO locale/sensitive filters
|
||||
$user->getEvents(),
|
||||
$this->getParameter('app.pagination'),
|
||||
($page - 1) * $this->getParameter('app.pagination')
|
||||
),
|
||||
'pagination' =>
|
||||
[
|
||||
'page' => $page,
|
||||
'pages' => ceil($total / $this->getParameter('app.pagination')),
|
||||
'total' => $total
|
||||
]
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
#[Route(
|
||||
'/{_locale}/settings',
|
||||
name: 'user_settings',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue