|
@@ 117-183 (lines=67) @@
|
| 114 |
|
/** |
| 115 |
|
* @Route("/ec-generalstats/{project}/{username}", name="EditCounterGeneralStats") |
| 116 |
|
*/ |
| 117 |
|
public function generalStatsAction($project, $username) |
| 118 |
|
{ |
| 119 |
|
$this->setUpEditCounter($project, $username); |
| 120 |
|
|
| 121 |
|
// $revisionCounts = $this->editCounterHelper->getRevisionCounts($user->getId($project)); |
| 122 |
|
// $pageCounts = $this->editCounterHelper->getPageCounts($username, $revisionCounts['total']); |
| 123 |
|
// $logCounts = $this->editCounterHelper->getLogCounts($user->getId($project)); |
| 124 |
|
// $automatedEditsSummary = $automatedEditsHelper->getEditsSummary($user->getId($project)); |
| 125 |
|
// $topProjectsEditCounts = $this->editCounterHelper->getTopProjectsEditCounts($project->getUrl(), |
| 126 |
|
// $user->getUsername()); |
| 127 |
|
|
| 128 |
|
// Render view. |
| 129 |
|
$isSubRequest = $this->get('request_stack')->getParentRequest() !== null; |
| 130 |
|
return $this->render('editCounter/general_stats.html.twig', [ |
| 131 |
|
'xtPage' => 'ec', |
| 132 |
|
'is_sub_request' => $isSubRequest, |
| 133 |
|
'is_labs' => $this->project->getRepository()->isLabs(), |
| 134 |
|
'user' => $this->user, |
| 135 |
|
'project' => $this->project, |
| 136 |
|
'ec' => $this->editCounter, |
| 137 |
|
|
| 138 |
|
// Revision counts. |
| 139 |
|
// 'deleted_edits' => $revisionCounts['deleted'], |
| 140 |
|
// 'total_edits' => $revisionCounts['total'], |
| 141 |
|
// 'live_edits' => $revisionCounts['live'], |
| 142 |
|
// 'first_rev' => $revisionCounts['first'], |
| 143 |
|
// 'latest_rev' => $revisionCounts['last'], |
| 144 |
|
// 'days' => $revisionCounts['days'], |
| 145 |
|
// 'avg_per_day' => $revisionCounts['avg_per_day'], |
| 146 |
|
// 'rev_24h' => $revisionCounts['24h'], |
| 147 |
|
// 'rev_7d' => $revisionCounts['7d'], |
| 148 |
|
// 'rev_30d' => $revisionCounts['30d'], |
| 149 |
|
// 'rev_365d' => $revisionCounts['365d'], |
| 150 |
|
// 'rev_small' => $revisionCounts['small'], |
| 151 |
|
// 'rev_large' => $revisionCounts['large'], |
| 152 |
|
// 'with_comments' => $revisionCounts['with_comments'], |
| 153 |
|
// 'without_comments' => $revisionCounts['live'] - $revisionCounts['with_comments'], |
| 154 |
|
// 'minor_edits' => $revisionCounts['minor_edits'], |
| 155 |
|
// 'nonminor_edits' => $revisionCounts['live'] - $revisionCounts['minor_edits'], |
| 156 |
|
// 'auto_edits_total' => array_sum($automatedEditsSummary), |
| 157 |
|
// |
| 158 |
|
// // Page counts. |
| 159 |
|
// 'uniquePages' => $pageCounts['unique'], |
| 160 |
|
// 'pagesCreated' => $pageCounts['created'], |
| 161 |
|
// 'pagesMoved' => $pageCounts['moved'], |
| 162 |
|
// 'editsPerPage' => $pageCounts['edits_per_page'], |
| 163 |
|
// |
| 164 |
|
// // Log counts (keys are 'log name'-'action'). |
| 165 |
|
// 'pagesThanked' => $logCounts['thanks-thank'], |
| 166 |
|
// 'pagesApproved' => $logCounts['review-approve'], // Merged -a, -i, and -ia approvals. |
| 167 |
|
// 'pagesPatrolled' => $logCounts['patrol-patrol'], |
| 168 |
|
// 'usersBlocked' => $logCounts['block-block'], |
| 169 |
|
// 'usersUnblocked' => $logCounts['block-unblock'], |
| 170 |
|
// 'pagesProtected' => $logCounts['protect-protect'], |
| 171 |
|
// 'pagesUnprotected' => $logCounts['protect-unprotect'], |
| 172 |
|
// 'pagesDeleted' => $logCounts['delete-delete'], |
| 173 |
|
// 'pagesDeletedRevision' => $logCounts['delete-revision'], |
| 174 |
|
// 'pagesRestored' => $logCounts['delete-restore'], |
| 175 |
|
// 'pagesImported' => $logCounts['import-import'], |
| 176 |
|
// 'files_uploaded' => $logCounts['upload-upload'], |
| 177 |
|
// 'files_modified' => $logCounts['upload-overwrite'], |
| 178 |
|
// 'files_uploaded_commons' => $logCounts['files_uploaded_commons'], |
| 179 |
|
// |
| 180 |
|
// // Other projects. |
| 181 |
|
// 'top_projects_edit_counts' => $topProjectsEditCounts, |
| 182 |
|
]); |
| 183 |
|
} |
| 184 |
|
|
| 185 |
|
/** |
| 186 |
|
* @Route("/ec-namespacetotals/{project}/{username}", name="EditCounterNamespaceTotals") |
|
@@ 188-201 (lines=14) @@
|
| 185 |
|
/** |
| 186 |
|
* @Route("/ec-namespacetotals/{project}/{username}", name="EditCounterNamespaceTotals") |
| 187 |
|
*/ |
| 188 |
|
public function namespaceTotalsAction($project, $username) |
| 189 |
|
{ |
| 190 |
|
$this->setUpEditCounter($project, $username); |
| 191 |
|
$isSubRequest = $this->get('request_stack')->getParentRequest() !== null; |
| 192 |
|
return $this->render('editCounter/namespace_totals.html.twig', [ |
| 193 |
|
'xtTitle' => 'namespacetotals', |
| 194 |
|
'xtPage' => 'ec', |
| 195 |
|
'is_sub_request' => $isSubRequest, |
| 196 |
|
'is_labs' => $this->project->getRepository()->isLabs(), |
| 197 |
|
'user' => $this->user, |
| 198 |
|
'project' => $this->project, |
| 199 |
|
'ec' => $this->editCounter, |
| 200 |
|
]); |
| 201 |
|
} |
| 202 |
|
|
| 203 |
|
/** |
| 204 |
|
* @Route("/ec-timecard/{project}/{username}", name="EditCounterTimeCard") |
|
@@ 206-221 (lines=16) @@
|
| 203 |
|
/** |
| 204 |
|
* @Route("/ec-timecard/{project}/{username}", name="EditCounterTimeCard") |
| 205 |
|
*/ |
| 206 |
|
public function timecardAction($project, $username) |
| 207 |
|
{ |
| 208 |
|
$this->setUpEditCounter($project, $username); |
| 209 |
|
$isSubRequest = $this->get('request_stack')->getParentRequest() !== null; |
| 210 |
|
//$datasets = $this->editCounterHelper->getTimeCard($username); |
| 211 |
|
return $this->render('editCounter/timecard.html.twig', [ |
| 212 |
|
'xtTitle' => 'tool-ec', |
| 213 |
|
'xtPage' => 'ec', |
| 214 |
|
'is_sub_request' => $isSubRequest, |
| 215 |
|
//'datasets' => $datasets, |
| 216 |
|
'is_labs' => $this->project->getRepository()->isLabs(), |
| 217 |
|
'user' => $this->user, |
| 218 |
|
'project' => $this->project, |
| 219 |
|
'ec' => $this->editCounter, |
| 220 |
|
]); |
| 221 |
|
} |
| 222 |
|
|
| 223 |
|
/** |
| 224 |
|
* @Route("/ec-yearcounts/{project}/{username}", name="EditCounterYearCounts") |
|
@@ 226-242 (lines=17) @@
|
| 223 |
|
/** |
| 224 |
|
* @Route("/ec-yearcounts/{project}/{username}", name="EditCounterYearCounts") |
| 225 |
|
*/ |
| 226 |
|
public function yearcountsAction($project, $username) |
| 227 |
|
{ |
| 228 |
|
$this->setUpEditCounter($project, $username); |
| 229 |
|
$isSubRequest = $this->container->get('request_stack')->getParentRequest() !== null; |
| 230 |
|
//$yearcounts = $this->editCounterHelper->getYearCounts($username); |
| 231 |
|
return $this->render('editCounter/yearcounts.html.twig', [ |
| 232 |
|
'xtTitle' => 'tool-ec', |
| 233 |
|
'xtPage' => 'ec', |
| 234 |
|
'is_sub_request' => $isSubRequest, |
| 235 |
|
//'namespaces' => $this->apiHelper->namespaces($project), |
| 236 |
|
//'yearcounts' => $yearcounts, |
| 237 |
|
'is_labs' => $this->project->getRepository()->isLabs(), |
| 238 |
|
'user' => $this->user, |
| 239 |
|
'project' => $this->project, |
| 240 |
|
'ec' => $this->editCounter, |
| 241 |
|
]); |
| 242 |
|
} |
| 243 |
|
|
| 244 |
|
/** |
| 245 |
|
* @Route("/ec-monthcounts/{project}/{username}", name="EditCounterMonthCounts") |
|
@@ 247-260 (lines=14) @@
|
| 244 |
|
/** |
| 245 |
|
* @Route("/ec-monthcounts/{project}/{username}", name="EditCounterMonthCounts") |
| 246 |
|
*/ |
| 247 |
|
public function monthcountsAction($project, $username) |
| 248 |
|
{ |
| 249 |
|
$this->setUpEditCounter($project, $username); |
| 250 |
|
$isSubRequest = $this->container->get('request_stack')->getParentRequest() !== null; |
| 251 |
|
return $this->render('editCounter/monthcounts.html.twig', [ |
| 252 |
|
'xtTitle' => 'tool-ec', |
| 253 |
|
'xtPage' => 'ec', |
| 254 |
|
'is_sub_request' => $isSubRequest, |
| 255 |
|
'is_labs' => $this->project->getRepository()->isLabs(), |
| 256 |
|
'user' => $this->user, |
| 257 |
|
'project' => $this->project, |
| 258 |
|
'ec' => $this->editCounter, |
| 259 |
|
]); |
| 260 |
|
} |
| 261 |
|
|
| 262 |
|
/** |
| 263 |
|
* @Route("/ec-latestglobal/{project}/{username}", name="EditCounterLatestGlobal") |
|
@@ 265-277 (lines=13) @@
|
| 262 |
|
/** |
| 263 |
|
* @Route("/ec-latestglobal/{project}/{username}", name="EditCounterLatestGlobal") |
| 264 |
|
*/ |
| 265 |
|
public function latestglobalAction($project, $username) |
| 266 |
|
{ |
| 267 |
|
$this->setUpEditCounter($project, $username); |
| 268 |
|
$isSubRequest = $this->container->get('request_stack')->getParentRequest() !== null; |
| 269 |
|
return $this->render('editCounter/latest_global.html.twig', [ |
| 270 |
|
'xtTitle' => 'tool_ec', |
| 271 |
|
'xtPage' => 'ec', |
| 272 |
|
'is_sub_request' => $isSubRequest, |
| 273 |
|
'user' => $this->user, |
| 274 |
|
'project' => $this->project, |
| 275 |
|
'ec' => $this->editCounter, |
| 276 |
|
]); |
| 277 |
|
} |
| 278 |
|
} |
| 279 |
|
|