Skip to content

Commit

Permalink
Merge pull request #360 from jan-stanek/fotka-lektora
Browse files Browse the repository at this point in the history
fotka lektora
  • Loading branch information
Jan Staněk authored Oct 9, 2017
2 parents 2c738f2 + 4a222b2 commit 2f5764b
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
22 changes: 22 additions & 0 deletions app/ApiModule/DTO/Schedule/BlockDetailDTO.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ class BlockDetailDTO extends Nette\Object
*/
private $aboutLector;

/**
* @JMS\Type("string")
* @var string
*/
private $lectorPhoto;

/**
* @JMS\Type("int")
* @var int
Expand Down Expand Up @@ -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
*/
Expand Down
1 change: 1 addition & 0 deletions app/ApiModule/services/ScheduleService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
8 changes: 7 additions & 1 deletion app/WebModule/components/templates/blocks_content.latte
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,13 @@

{if $selectedBlock->getLector() && $selectedBlock->getLector()->getAbout()}
<h5>{_web.blocks_content.about_lector}</h5>
<p>{$selectedBlock->getLector()->getAbout()}</p>
<p>
{if $selectedBlock->getLector()->getPhoto()}
<img src="{$basePath}/files/user_photos/{$selectedBlock->getLector()->getPhoto()}"
style="float: left; margin: 0 10px 10px 0;"/>
{/if}
{$selectedBlock->getLector()->getAbout()}
</p>
{/if}
</div>
{else}
Expand Down
7 changes: 6 additions & 1 deletion app/WebModule/components/templates/programs_content.latte
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,12 @@
<div ng-bind-html="event.block.description"></div>

<h5><strong>{_web.programs_content.about_lector}</strong></h5>
<p>{{ event.block.about_lector }}</p>
<p>
<img ng-src="{$basePath}/files/user_photos/{{ event.block.lector_photo }}"
ng-if="event.block.lector_photo"
style="float: left; margin: 0 10px 10px 0;"/>
{{ event.block.about_lector }}
</p>
</div>

<div class="modal-footer">
Expand Down

0 comments on commit 2f5764b

Please sign in to comment.