Skip to content

Commit 2f5764b

Browse files
author
Jan Staněk
authored
Merge pull request #360 from jan-stanek/fotka-lektora
fotka lektora
2 parents 2c738f2 + 4a222b2 commit 2f5764b

File tree

4 files changed

+36
-2
lines changed

4 files changed

+36
-2
lines changed

app/ApiModule/DTO/Schedule/BlockDetailDTO.php

+22
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ class BlockDetailDTO extends Nette\Object
4343
*/
4444
private $aboutLector;
4545

46+
/**
47+
* @JMS\Type("string")
48+
* @var string
49+
*/
50+
private $lectorPhoto;
51+
4652
/**
4753
* @JMS\Type("int")
4854
* @var int
@@ -184,6 +190,22 @@ public function setAboutLector($aboutLector)
184190
$this->aboutLector = $aboutLector;
185191
}
186192

193+
/**
194+
* @return string
195+
*/
196+
public function getLectorPhoto()
197+
{
198+
return $this->lectorPhoto;
199+
}
200+
201+
/**
202+
* @param string $lectorPhoto
203+
*/
204+
public function setLectorPhoto($lectorPhoto)
205+
{
206+
$this->lectorPhoto = $lectorPhoto;
207+
}
208+
187209
/**
188210
* @return int
189211
*/

app/ApiModule/services/ScheduleService.php

+1
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ private function convertBlockToBlockDetailDTO(Block $block)
380380
$blockDetailDTO->setCategory($block->getCategory() ? $block->getCategory()->getName() : '');
381381
$blockDetailDTO->setLector($block->getLector() ? $block->getLector()->getDisplayName() : '');
382382
$blockDetailDTO->setAboutLector($block->getLector() ? $block->getLector()->getAbout() : '');
383+
$blockDetailDTO->setLectorPhoto($block->getLector() ? $block->getLector()->getPhoto() : NULL);
383384
$blockDetailDTO->setDurationHours(floor($block->getDuration() / 60));
384385
$blockDetailDTO->setDurationMinutes($block->getDuration() % 60);
385386
$blockDetailDTO->setCapacity($block->getCapacity());

app/WebModule/components/templates/blocks_content.latte

+7-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,13 @@
9999

100100
{if $selectedBlock->getLector() && $selectedBlock->getLector()->getAbout()}
101101
<h5>{_web.blocks_content.about_lector}</h5>
102-
<p>{$selectedBlock->getLector()->getAbout()}</p>
102+
<p>
103+
{if $selectedBlock->getLector()->getPhoto()}
104+
<img src="{$basePath}/files/user_photos/{$selectedBlock->getLector()->getPhoto()}"
105+
style="float: left; margin: 0 10px 10px 0;"/>
106+
{/if}
107+
{$selectedBlock->getLector()->getAbout()}
108+
</p>
103109
{/if}
104110
</div>
105111
{else}

app/WebModule/components/templates/programs_content.latte

+6-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,12 @@
118118
<div ng-bind-html="event.block.description"></div>
119119

120120
<h5><strong>{_web.programs_content.about_lector}</strong></h5>
121-
<p>{{ event.block.about_lector }}</p>
121+
<p>
122+
<img ng-src="{$basePath}/files/user_photos/{{ event.block.lector_photo }}"
123+
ng-if="event.block.lector_photo"
124+
style="float: left; margin: 0 10px 10px 0;"/>
125+
{{ event.block.about_lector }}
126+
</p>
122127
</div>
123128

124129
<div class="modal-footer">

0 commit comments

Comments
 (0)