| @@ 80-105 (lines=26) @@ | ||
| 77 | * @return Response |
|
| 78 | * @codeCoverageIgnore |
|
| 79 | */ |
|
| 80 | public function resultAction(Request $request, $namespace = 0) |
|
| 81 | { |
|
| 82 | $ret = $this->validateProjectAndUser($request, 'es'); |
|
| 83 | if ($ret instanceof RedirectResponse) { |
|
| 84 | return $ret; |
|
| 85 | } else { |
|
| 86 | list($project, $user) = $ret; |
|
| 87 | } |
|
| 88 | ||
| 89 | // Instantiate an EditSummary, treating the past 150 edits as 'recent'. |
|
| 90 | $editSummary = new EditSummary($project, $user, $namespace, 150, $this->container); |
|
| 91 | $editSummary->prepareData(); |
|
| 92 | ||
| 93 | // Assign the values and display the template |
|
| 94 | return $this->render( |
|
| 95 | 'editSummary/result.html.twig', |
|
| 96 | [ |
|
| 97 | 'xtPage' => 'es', |
|
| 98 | 'xtTitle' => $user->getUsername(), |
|
| 99 | 'user' => $user, |
|
| 100 | 'project' => $project, |
|
| 101 | 'namespace' => $namespace, |
|
| 102 | 'es' => $editSummary, |
|
| 103 | ] |
|
| 104 | ); |
|
| 105 | } |
|
| 106 | ||
| 107 | /************************ API endpoints ************************/ |
|
| 108 | ||
| @@ 80-107 (lines=28) @@ | ||
| 77 | * @return RedirectResponse|Response |
|
| 78 | * @codeCoverageIgnore |
|
| 79 | */ |
|
| 80 | public function resultAction(Request $request, $namespace = '0', $redirects = 'noredirects', $offset = 0) |
|
| 81 | { |
|
| 82 | $ret = $this->validateProjectAndUser($request, 'pages'); |
|
| 83 | if ($ret instanceof RedirectResponse) { |
|
| 84 | return $ret; |
|
| 85 | } else { |
|
| 86 | list($projectData, $user) = $ret; |
|
| 87 | } |
|
| 88 | ||
| 89 | $pages = new Pages( |
|
| 90 | $projectData, |
|
| 91 | $user, |
|
| 92 | $namespace, |
|
| 93 | $redirects, |
|
| 94 | $offset |
|
| 95 | ); |
|
| 96 | $pages->prepareData(); |
|
| 97 | ||
| 98 | // Assign the values and display the template |
|
| 99 | return $this->render('pages/result.html.twig', [ |
|
| 100 | 'xtPage' => 'pages', |
|
| 101 | 'xtTitle' => $user->getUsername(), |
|
| 102 | 'project' => $projectData, |
|
| 103 | 'user' => $user, |
|
| 104 | 'summaryColumns' => $this->getSummaryColumns($redirects), |
|
| 105 | 'pages' => $pages, |
|
| 106 | ]); |
|
| 107 | } |
|
| 108 | ||
| 109 | /** |
|
| 110 | * What columns to show in namespace totals table. |
|