Skip to content

Commit ada6560

Browse files
committed
Podcasts: Show upcoming episodes
1 parent 78ed244 commit ada6560

File tree

7 files changed

+70
-30
lines changed

7 files changed

+70
-30
lines changed

assets/css/custom.css

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -928,6 +928,32 @@ a.carousel-arrow-next {
928928

929929
/* Blog */
930930

931+
.podcast .future-show {
932+
display: none;
933+
}
934+
.podcast-future {
935+
background-color: #ecf8f0;
936+
padding: 1rem 2rem;
937+
margin: 0 -2rem;
938+
}
939+
.podcast-future .future-hide {
940+
display: none;
941+
}
942+
.podcast-future .future-show {
943+
display: inherit;
944+
}
945+
.podcast-future h3 {
946+
margin-top: 0;
947+
}
948+
.podcast-future .timeline-info {
949+
left: -115px;
950+
}
951+
.podcast-future .timeline-info:after {
952+
content: "\f017";
953+
}
954+
.podcast-future .timeline-info img.blg-author {
955+
border-radius: 0;
956+
}
931957
.podcast-thumb-img {
932958
max-width: 250px;
933959
border: 1px solid #cfcfcfcf;

assets/img/coming-soon.png

12.4 KB
Loading

assets/js/custom.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,17 +128,17 @@ $('#search-btn').on('click', function() {
128128
// Error page
129129
// ==========
130130

131-
var divs = $("i.random").get().sort(function(){
131+
var divs = $("i.random").get().sort(function(){
132132
return Math.round(Math.random())-0.5; //random so we get the right +/- combo
133133
}).slice(0,1)
134134
$(divs).show();
135135

136-
var divs = $("i.random2").get().sort(function(){
136+
var divs = $("i.random2").get().sort(function(){
137137
return Math.round(Math.random())-0.5; //random so we get the right +/- combo
138138
}).slice(0,1)
139139
$(divs).show();
140140

141-
var divs = $("i.random3").get().sort(function(){
141+
var divs = $("i.random3").get().sort(function(){
142142
return Math.round(Math.random())-0.5; //random so we get the right +/- combo
143143
}).slice(0,1)
144144
$(divs).show();
@@ -152,7 +152,7 @@ $('.crp-ft').hover (function() {
152152
return false;
153153
});
154154

155-
// Smooth scroll
155+
// Smooth scroll
156156
// =================
157157

158158
$(".scroll").click(function (event) {
@@ -168,4 +168,14 @@ $(".scroll").click(function (event) {
168168
$('html,body').animate({
169169
scrollTop: dest
170170
}, 1000, 'swing');
171-
});
171+
});
172+
173+
// Podcast - styling for future events
174+
// ====================================
175+
$('.podcast').each(function () {
176+
var golive = parseFloat($(this).data("golive"));
177+
var now = new Date().getTime();
178+
if (golive > now) {
179+
$(this).addClass('podcast-future')
180+
}
181+
});

templates/footer.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ while(x=eval(x));
5454
<script src="/js/bootstrap.min.js"></script>
5555
<script src="/js/highlight.min.js"></script>
5656
<script>hljs.highlightAll();</script>
57-
<script src="/js/custom.js"></script>
57+
<script src="/js/custom.js?${.now?long?c}"></script>
5858
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
5959
<#if (content.syntaxhighlighter)?? >
6060
<!-- Syntax highlight -->

templates/header.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<!-- Custom styles for this template -->
4747
<link href="/css/color-styles.css" rel="stylesheet">
4848
<link href="/css/ui-elements.css" rel="stylesheet">
49-
<link href="/css/custom.css" rel="stylesheet">
49+
<link href="/css/custom.css?${.now?long?c}" rel="stylesheet">
5050

5151
<!-- Resources -->
5252
<link href="/css/animate.css" rel="stylesheet">

templates/podcast.ftl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<div class="container">
77
<div class="row">
88
<div class="col-sm-8">
9-
<div class="blg-summary">
9+
<div class="blg-summary podcast" data-golive='${content.date?long?c}'>
1010
<h2><a href="${content.uri}"><span class="label label-success">Episode ${content.episode}</span> ${content.subtype?cap_first}: <#escape x as x?xml>${content.title}</#escape></a></h2>
1111
<h4 class="text-muted blg-description"><#escape x as x?xml>${content.description}</#escape></h4>
1212
<ul class="text-muted list-inline blg-header">
@@ -20,7 +20,8 @@
2020
<iframe width="560" height="315" src="https://www.youtube.com/embed/${content.youtubeid}" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
2121
<hr>
2222
</#if>
23-
${content.body}
23+
<div class="future-hide">${content.body}</div>
24+
<div class="future-show">Episode coming soon..</div>
2425
</div>
2526

2627
<p class="tags">

templates/podcastsindex.ftl

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,36 +19,39 @@
1919
<div class="row">
2020
<div class="col-sm-8">
2121
<div class="timeline">
22-
<#assign count = 0>
23-
<#list podcasts as post>
24-
<div class="blg-summary">
22+
<#list podcasts as post>
23+
<div class="blg-summary podcast" data-golive='${post.date?long?c}'>
2524
<h3 style="line-height: 1.5;"><a href="${post.uri}"><span class="label label-success">Episode ${post.episode}</span> ${post.subtype?cap_first}: <#escape x as x?xml>${post.title}</#escape></a></h3>
26-
<h4 class="text-muted blg-description"><#escape x as x?xml>${post.description}</#escape></h4>
25+
<h4 class="text-muted blg-description future-show">Episode coming soon! Subscribe to listen live..</h4>
26+
<h4 class="text-muted blg-description future-hide"><#escape x as x?xml>${post.description}</#escape></h4>
2727
<div class="timeline-info hidden-xs">
28-
<img src="/img/${post.icon}" class="blg-author" alt="${post.author}">
28+
<img src="/img/coming-soon.png" class="blg-author future-show" alt="Coming soon">
29+
<img src="/img/${post.icon}" class="blg-author future-hide" alt="${post.author}">
2930
</div>
3031
<ul class="text-muted list-inline blg-header">
3132
<li><i class="fa fa-info-circle"></i> ${post.subtype}</li>
3233
<li><i class="fa fa-calendar"></i> ${post.date?string("dd MMMM yyyy")} </li>
3334
<!--<li><i class="fa fa-comments-o"></i> 21 comments</li> -->
3435
</ul>
35-
<hr>
36-
<#if post.image??>
37-
<a href="${post.uri}"><img src="${post.image}" class="podcast-thumb-img"></a>
38-
</#if>
39-
<p class="blg-text">
40-
<#assign post_intro = post.body?split("<!-- end-archive-description -->")[0]>
41-
<#assign MAX = 150>
42-
<#assign words = post_intro?word_list>
43-
<#if words?size gt 150 >
44-
<#assign body = words[0..MAX-1]?join(' ') >
45-
${body} .. (<a href="${post.uri}">click here to read more</a>)
46-
<#else>
47-
<#assign body = words?join(' ') >
48-
${body}
49-
</#if>
36+
<div class="future-hide">
37+
<hr>
38+
<#if post.image??>
39+
<a href="${post.uri}"><img src="${post.image}" class="podcast-thumb-img"></a>
40+
</#if>
41+
<p class="blg-text">
42+
<#assign post_intro = post.body?split("<!-- end-archive-description -->")[0]>
43+
<#assign MAX = 150>
44+
<#assign words = post_intro?word_list>
45+
<#if words?size gt 150 >
46+
<#assign body = words[0..MAX-1]?join(' ') >
47+
${body} .. (<a href="${post.uri}">click here to read more</a>)
48+
<#else>
49+
<#assign body = words?join(' ') >
50+
${body}
51+
</#if>
5052

51-
</p>
53+
</p>
54+
</div>
5255

5356
</div>
5457
</#list>

0 commit comments

Comments
 (0)