| @@ 46-67 (lines=22) @@ | ||
| 43 | * @param Request $request |
|
| 44 | * @return Response |
|
| 45 | */ |
|
| 46 | public function indexAction(Request $request) |
|
| 47 | { |
|
| 48 | $params = $this->parseQueryParams($request); |
|
| 49 | ||
| 50 | // Redirect if at minimum project and username are provided. |
|
| 51 | if (isset($params['project']) && isset($params['username'])) { |
|
| 52 | return $this->redirectToRoute('TopEditsResults', $params); |
|
| 53 | } |
|
| 54 | ||
| 55 | // Convert the given project (or default project) into a Project instance. |
|
| 56 | $params['project'] = $this->getProjectFromQuery($params); |
|
| 57 | ||
| 58 | return $this->render('topedits/index.html.twig', array_merge([ |
|
| 59 | 'xtPageTitle' => 'tool-topedits', |
|
| 60 | 'xtSubtitle' => 'tool-topedits-desc', |
|
| 61 | 'xtPage' => 'topedits', |
|
| 62 | ||
| 63 | // Defaults that will get overriden if in $params. |
|
| 64 | 'namespace' => 0, |
|
| 65 | 'article' => '', |
|
| 66 | ], $params)); |
|
| 67 | } |
|
| 68 | ||
| 69 | /** |
|
| 70 | * Display the results. |
|
| @@ 49-71 (lines=23) @@ | ||
| 46 | * @param Request $request The HTTP request. |
|
| 47 | * @return Response |
|
| 48 | */ |
|
| 49 | public function indexAction(Request $request) |
|
| 50 | { |
|
| 51 | $params = $this->parseQueryParams($request); |
|
| 52 | ||
| 53 | // Redirect if at minimum project and username are provided. |
|
| 54 | if (isset($params['project']) && isset($params['username'])) { |
|
| 55 | return $this->redirectToRoute('autoeditsResult', $params); |
|
| 56 | } |
|
| 57 | ||
| 58 | // Convert the given project (or default project) into a Project instance. |
|
| 59 | $params['project'] = $this->getProjectFromQuery($params); |
|
| 60 | ||
| 61 | return $this->render('autoEdits/index.html.twig', array_merge([ |
|
| 62 | 'xtPageTitle' => 'tool-autoedits', |
|
| 63 | 'xtSubtitle' => 'tool-autoedits-desc', |
|
| 64 | 'xtPage' => 'autoedits', |
|
| 65 | ||
| 66 | // Defaults that will get overriden if in $params. |
|
| 67 | 'namespace' => 0, |
|
| 68 | 'start' => '', |
|
| 69 | 'end' => '', |
|
| 70 | ], $params)); |
|
| 71 | } |
|
| 72 | ||
| 73 | /** |
|
| 74 | * Display the results. |
|