Skip to content

Commit

Permalink
E-mail vedoucího skupiny (#948)
Browse files Browse the repository at this point in the history
* troop leader email

* link
  • Loading branch information
jan-stanek committed Jan 21, 2023
1 parent b7785a5 commit 9bac705
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions app/AdminModule/UsersModule/Components/TroopsGridControl.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,16 @@ public function createComponentPatrolsGrid(string $name): DataGrid
return Html::el('a')->setAttribute('href', $this->getPresenter()->link('Users:detail', $leader->getId()))->setText($leader->getDisplayName());
});

$grid->addColumnText('leaderEmail', 'E-mail vedoucího')
->setRenderer(static function (Troop $t) {
$email = $t->getLeader()->getEmail();

return Html::el('a')->href('mailto:' . $email)->setText($email);
});

$grid->addColumnDateTime('applicationDate', 'Datum založení')
->setRenderer(static function (Troop $p) {
$date = $p->getApplicationDate();
->setRenderer(static function (Troop $t) {
$date = $t->getApplicationDate();

return $date ? $date->format(Helpers::DATETIME_FORMAT) : '';
})
Expand Down

0 comments on commit 9bac705

Please sign in to comment.