Skip to content

Commit

Permalink
AmsterdamPHP#72: Added list of AmsterdamPHP videos from youtube inste…
Browse files Browse the repository at this point in the history
…ad of the list of blog posts
  • Loading branch information
Pascal de Vink committed Apr 18, 2015
1 parent 7773665 commit 0add19f
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 9 deletions.
31 changes: 28 additions & 3 deletions app/Resources/less/amsterdamphp.less
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,27 @@ footer {
background-image: url('../images/speaker-call-bg.png');
}

.videos {
margin-bottom: 15px;
.text-center;

.more {
.more-button;
}
}

.video {
height: 110px;
position: relative;
padding-left: 140px;
.text-left;

.thumbnail {
position: absolute;
left: 0;
}
}

.blog-post {

margin-bottom: 20px;
Expand Down Expand Up @@ -392,12 +413,16 @@ footer {
.blog-posts {
.text-center;
.more {
border: 1px solid @amsRed;
font-size: 14px;
padding: 5px;
.more-button;
}
}

.more-button {
border: 1px solid @amsRed;
font-size: 14px;
padding: 5px;
}

.sponsor-box {

background-color: #ffffff;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,13 @@ public function indexAction()
$nextEvents = $eventService->getUpcomingEvents(true)->toArray();
$pastEvents = $eventService->getPastEvents(true)->toArray();

$blogService = $this->get('amsterdamphp_site.integration.blog');
$posts = $blogService->getLatestBlogPosts();

$youtubeService = $this->get('amsterdamphp_site.integration.youtube');
$videos = $youtubeService->getLatestVideos();

return [
'header_photo' => $headerPhoto,
'next_event' => array_shift($nextEvents),
'past_events' => array_splice($pastEvents, 0, 2),
'blog_posts' => $posts,
'sponsors' => $sponsors,
'videos' => $videos,
];
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<div class="videos">
{% for video in videos|slice(0, 4) %}
<div class="video">
<span>
<a href="https://www.youtube.com/watch?v={{ video.snippet.resourceId.videoId }}"
target="_blank"><img
class="thumbnail"
src="{{ video.snippet.thumbnails.default.url }}" /></a>
</span>
<span>
<a href="https://www.youtube.com/watch?v={{ video.snippet.resourceId.videoId }}"
target="_blank">{{ video.snippet.title }}</a>
</span>
</div>
{% endfor %}
<a class="more"
href="https://www.youtube.com/user/AmsterdamPHP/videos"
target="_blank">OLDER VIDEOS</a>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<p>Share your knowledge with the community!</p>
</a>

{% include 'AmsterdamPHPSiteBundle:Default:_blog_posts.html.twig' %}
{% include 'AmsterdamPHPSiteBundle:Default:_videos.html.twig' %}
</div>
<div class="col-md-8 col-lg-8">
<div class="row">
Expand Down
2 changes: 1 addition & 1 deletion web/css/amsterdamphp.css

Large diffs are not rendered by default.

0 comments on commit 0add19f

Please sign in to comment.