-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace an include with TalksList component
- Loading branch information
Showing
9 changed files
with
61 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
declare(strict_types = 1); | ||
|
||
namespace MichalSpacekCz\Talks; | ||
|
||
use MichalSpacekCz\Application\UiControl; | ||
|
||
class TalksList extends UiControl | ||
{ | ||
|
||
/** | ||
* @param list<Talk> $talks | ||
*/ | ||
public function render(array $talks): void | ||
{ | ||
$this->template->talks = $talks; | ||
$this->template->render(__DIR__ . '/talksList.latte'); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
declare(strict_types = 1); | ||
|
||
namespace MichalSpacekCz\Talks; | ||
|
||
interface TalksListFactory | ||
{ | ||
|
||
public function create(): TalksList; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{varType MichalSpacekCz\Talks\Talk[] $talks} | ||
<p class="indent" n:foreach="$talks as $talk"> | ||
<a href="{plink Talks:talk $talk->getAction()}" n:tag-if="$talk->getAction()"><strong>{$talk->getTitle()}</strong></a><br> | ||
<small><strong class="date">{$talk->getDate()|localeDay}</strong>, {$talk->getEvent()}{if $talk->getDuration()} ({_messages.talks.durationshort|format:$talk->getDuration()}){/if}</small> | ||
<span n:if="$talk->isHasSlides()" title="{_messages.label.slides}">{icon images}</span> | ||
<span n:if="$talk->getVideo()->getVideoHref()" title="{_messages.label.videorecording}">{icon camera-video}</span> | ||
</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,17 +26,13 @@ | |
</ul> | ||
<h3>{_messages.label.upcomingtalks}</h3> | ||
{if $upcomingTalks} | ||
<p class="indent" n:foreach="$upcomingTalks as $talk"> | ||
{include "../Talks/common/itemTalk.latte", talk: $talk} | ||
</p> | ||
{control talksList $upcomingTalks} | ||
<p>{_messages.talks.atyourevent.upcoming|format:'[email protected]'}</p> | ||
{else} | ||
<p>{_messages.talks.atyourevent.noupcoming|format:'[email protected]'}</p> | ||
{/if} | ||
<h3>{_messages.label.pasttalks}</h3> | ||
<p class="indent" n:foreach="$talks as $talk"> | ||
{include "../Talks/common/itemTalk.latte", talk: $talk} | ||
</p> | ||
{control talksList $talks} | ||
<p><a n:href="Talks:">{_messages.label.alltalks}</a></p> | ||
<hr> | ||
<h2 id="{_html.id.interviews}">{_messages.label.myinterviews}</h2> | ||
|
4 changes: 0 additions & 4 deletions
4
site/app/Www/Presenters/templates/Talks/common/itemTalk.latte
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,9 +11,7 @@ | |
</ul> | ||
<h2>{_messages.label.upcomingtalks}</h2> | ||
{if $upcomingTalks} | ||
<p n:foreach="$upcomingTalks as $talk"> | ||
{include "common/itemTalk.latte", talk: $talk} | ||
</p> | ||
{control talksList $upcomingTalks} | ||
<p>{_messages.talks.atyourevent.upcoming|format:'[email protected]'}</p> | ||
{else} | ||
<p>{_messages.talks.atyourevent.noupcoming|format:'[email protected]'}</p> | ||
|
@@ -24,9 +22,7 @@ | |
</p> | ||
{foreach $talks as $year => $items} | ||
<h3>{$year}</h3> | ||
<p class="indent" n:foreach="$items as $talk"> | ||
{include "common/itemTalk.latte", talk: $talk} | ||
</p> | ||
{control talksList $items} | ||
{/foreach} | ||
{_messages.talks.more|format:'https://www.slideshare.net/spaze/presentations', 'https://speakerdeck.com/u/spaze'} | ||
{/define} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters