WIP: Symfony 6 project remake #2
|
@ -6,7 +6,7 @@
|
|||
|
||||
index:
|
||||
path: /
|
||||
defaults: { _controller: App\Controller\MainController::indexAction }
|
||||
defaults: { _controller: App\Controller\MainController::index }
|
||||
methods: [POST, GET]
|
||||
|
||||
user_search_ajax:
|
||||
|
|
|
@ -15,7 +15,7 @@ class ApiController
|
|||
*
|
||||
* @ParamConverter("user", class="SkobkinPointToolsBundle:User")
|
||||
*/
|
||||
public function lastUserSubscribersByIdAction(User $user, SubscriptionEventRepository $subscriptionEventRepository): Response
|
||||
public function lastUserSubscribersById(User $user, SubscriptionEventRepository $subscriptionEventRepository): Response
|
||||
{
|
||||
$qb = $subscriptionEventRepository->createQueryBuilder('se');
|
||||
$qb
|
||||
|
|
|
@ -10,7 +10,7 @@ use Symfony\Component\HttpFoundation\{Request, Response};
|
|||
|
||||
class EventsController extends AbstractController
|
||||
{
|
||||
public function lastAction(Request $request, SubscriptionEventRepository $eventRepository, PaginatorInterface $paginator): Response
|
||||
public function last(Request $request, SubscriptionEventRepository $eventRepository, PaginatorInterface $paginator): Response
|
||||
{
|
||||
$eventsPagination = $paginator->paginate(
|
||||
$eventRepository->createLastSubscriptionEventsQuery(),
|
||||
|
|
|
@ -19,7 +19,7 @@ class MainController extends AbstractController
|
|||
) {
|
||||
}
|
||||
|
||||
public function indexAction(
|
||||
public function index(
|
||||
Request $request,
|
||||
UserRepository $userRepository,
|
||||
SubscriptionRepository $subscriptionRepository,
|
||||
|
@ -56,7 +56,7 @@ class MainController extends AbstractController
|
|||
}
|
||||
|
||||
/** Returns user search autocomplete data in JSON */
|
||||
public function searchUserAjaxAction(string $login, UserRepository $userRepository): JsonResponse
|
||||
public function searchUserAjax(string $login, UserRepository $userRepository): JsonResponse
|
||||
{
|
||||
$result = [];
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ class PostController extends AbstractController
|
|||
/**
|
||||
* @ParamConverter("post", class="SkobkinPointToolsBundle:Blogs\Post")
|
||||
*/
|
||||
public function showAction(Post $post, PostRepository $postRepository): Response
|
||||
public function show(Post $post, PostRepository $postRepository): Response
|
||||
{
|
||||
if ((!$post->getAuthor()->isPublic()) || $post->getAuthor()->isWhitelistOnly()) {
|
||||
/**
|
||||
|
|
|
@ -12,7 +12,7 @@ class PublicFeedController extends AbstractController
|
|||
{
|
||||
private const POSTS_PER_PAGE = 20;
|
||||
|
||||
public function indexAction(Request $request, PostRepository $postRepository, PaginatorInterface $paginator): Response
|
||||
public function index(Request $request, PostRepository $postRepository, PaginatorInterface $paginator): Response
|
||||
{
|
||||
$postsPagination = $paginator->paginate(
|
||||
$postRepository->createPublicFeedPostsQuery(),
|
||||
|
|
|
@ -19,7 +19,7 @@ class UserController extends AbstractController
|
|||
) {
|
||||
}
|
||||
|
||||
public function showAction(
|
||||
public function show(
|
||||
Request $request,
|
||||
string $login,
|
||||
SubscriptionEventRepository $subscriptionEventRepository,
|
||||
|
@ -40,7 +40,7 @@ class UserController extends AbstractController
|
|||
10
|
||||
);
|
||||
|
||||
return $this->render('SkobkinPointToolsBundle:User:show.html.twig', [
|
||||
return $this->render('Web/User/show.html.twig', [
|
||||
'user' => $user,
|
||||
'subscribers' => $userRepository->findUserSubscribersById($user->getId()),
|
||||
'subscriptions_log' => $subscriberEventsPagination,
|
||||
|
@ -48,12 +48,12 @@ class UserController extends AbstractController
|
|||
]);
|
||||
}
|
||||
|
||||
public function topAction(UserRepository $userRepository, SubscriptionEventRepository $subscriptionEventRepository): Response
|
||||
public function top(UserRepository $userRepository, SubscriptionEventRepository $subscriptionEventRepository): Response
|
||||
{
|
||||
$topUsers = $userRepository->getTopUsers();
|
||||
$eventsByDay = $subscriptionEventRepository->getLastEventsByDay();
|
||||
|
||||
return $this->render('@SkobkinPointTools/User/top.html.twig', [
|
||||
return $this->render('Web/User/top.html.twig', [
|
||||
'events_dynamic_chat' => $this->createEventsDynamicChart($eventsByDay),
|
||||
'top_chart' => $this->createTopUsersGraph($topUsers),
|
||||
]);
|
||||
|
|
Loading…
Reference in a new issue