added event to extend detail pages (#3209)

This commit is contained in:
Kevin Papst
2022-03-19 23:54:40 +01:00
committed by GitHub
parent a8ac6b2eda
commit 4b069edd33
12 changed files with 225 additions and 1 deletions

View File

@@ -17,6 +17,7 @@ use App\Entity\ActivityRate;
use App\Entity\MetaTableTypeInterface;
use App\Entity\Project;
use App\Entity\Team;
use App\Event\ActivityDetailControllerEvent;
use App\Event\ActivityMetaDefinitionEvent;
use App\Event\ActivityMetaDisplayEvent;
use App\Export\Spreadsheet\EntityWithMetaFieldsExporter;
@@ -140,6 +141,11 @@ final class ActivityController extends AbstractController
$teams = $activity->getTeams();
}
// additional boxes by plugins
$event = new ActivityDetailControllerEvent($activity);
$this->dispatcher->dispatch($event);
$boxes = $event->getController();
return $this->render('activity/details.html.twig', [
'activity' => $activity,
'stats' => $stats,
@@ -147,6 +153,7 @@ final class ActivityController extends AbstractController
'team' => $defaultTeam,
'teams' => $teams,
'now' => $now,
'boxes' => $boxes
]);
}