From 4a222b2abea35c84f859e42416c329fde2968fe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Stan=C4=9Bk?= Date: Tue, 10 Oct 2017 00:01:53 +0200 Subject: [PATCH] fotka lektora --- app/ApiModule/DTO/Schedule/BlockDetailDTO.php | 22 +++++++++++++++++++ app/ApiModule/services/ScheduleService.php | 1 + .../components/templates/blocks_content.latte | 8 ++++++- .../templates/programs_content.latte | 7 +++++- 4 files changed, 36 insertions(+), 2 deletions(-) diff --git a/app/ApiModule/DTO/Schedule/BlockDetailDTO.php b/app/ApiModule/DTO/Schedule/BlockDetailDTO.php index 3ef1a8a5d..1f4723881 100644 --- a/app/ApiModule/DTO/Schedule/BlockDetailDTO.php +++ b/app/ApiModule/DTO/Schedule/BlockDetailDTO.php @@ -43,6 +43,12 @@ class BlockDetailDTO extends Nette\Object */ private $aboutLector; + /** + * @JMS\Type("string") + * @var string + */ + private $lectorPhoto; + /** * @JMS\Type("int") * @var int @@ -184,6 +190,22 @@ public function setAboutLector($aboutLector) $this->aboutLector = $aboutLector; } + /** + * @return string + */ + public function getLectorPhoto() + { + return $this->lectorPhoto; + } + + /** + * @param string $lectorPhoto + */ + public function setLectorPhoto($lectorPhoto) + { + $this->lectorPhoto = $lectorPhoto; + } + /** * @return int */ diff --git a/app/ApiModule/services/ScheduleService.php b/app/ApiModule/services/ScheduleService.php index 4622f4594..759df04f4 100644 --- a/app/ApiModule/services/ScheduleService.php +++ b/app/ApiModule/services/ScheduleService.php @@ -380,6 +380,7 @@ private function convertBlockToBlockDetailDTO(Block $block) $blockDetailDTO->setCategory($block->getCategory() ? $block->getCategory()->getName() : ''); $blockDetailDTO->setLector($block->getLector() ? $block->getLector()->getDisplayName() : ''); $blockDetailDTO->setAboutLector($block->getLector() ? $block->getLector()->getAbout() : ''); + $blockDetailDTO->setLectorPhoto($block->getLector() ? $block->getLector()->getPhoto() : NULL); $blockDetailDTO->setDurationHours(floor($block->getDuration() / 60)); $blockDetailDTO->setDurationMinutes($block->getDuration() % 60); $blockDetailDTO->setCapacity($block->getCapacity()); diff --git a/app/WebModule/components/templates/blocks_content.latte b/app/WebModule/components/templates/blocks_content.latte index 4cde16aac..64942289b 100644 --- a/app/WebModule/components/templates/blocks_content.latte +++ b/app/WebModule/components/templates/blocks_content.latte @@ -99,7 +99,13 @@ {if $selectedBlock->getLector() && $selectedBlock->getLector()->getAbout()}
{_web.blocks_content.about_lector}
-

{$selectedBlock->getLector()->getAbout()}

+

+ {if $selectedBlock->getLector()->getPhoto()} + + {/if} + {$selectedBlock->getLector()->getAbout()} +

{/if} {else} diff --git a/app/WebModule/components/templates/programs_content.latte b/app/WebModule/components/templates/programs_content.latte index 4fb0f668f..36ab66506 100644 --- a/app/WebModule/components/templates/programs_content.latte +++ b/app/WebModule/components/templates/programs_content.latte @@ -118,7 +118,12 @@
{_web.programs_content.about_lector}
-

{{ event.block.about_lector }}

+

+ + {{ event.block.about_lector }} +