public function reorganizeAction(Request $request)
    {
        if ($request->isMethod('POST')) {
            $this->get('victoire_sitemap.sort.handler')->handle(
                $request->request->get('sorted')
            );
            $response['message'] = $this->get('translator')->trans('sitemap.changed.success', [], 'victoire');
        }

        $basePageRepo = $this->getDoctrine()->getManager()->getRepository('VictoirePageBundle:BasePage');
        $basePages = $basePageRepo
            ->getAll()
            ->joinSeo()
            ->joinSeoTranslations($request->getLocale())
            ->run();

        $forms = [];
        foreach ($basePages as $_page) {
            $_pageSeo = $_page->getSeo() ?: new PageSeo();
            $forms[$_page->getId()] = $this->createSitemapPriorityType($_page, $_pageSeo)->createView();
        }

        $response['success'] = true;
        $response['html'] = $this->container->get('templating')->render(
            'VictoireSitemapBundle:Sitemap:reorganize.html.twig',
            [
                'pages' => $basePageRepo->findByParent(null, ['position' => 'ASC']),
                'forms' => $forms,
            ]
        );

        return new JsonResponse($response);
    }