Skip to content

Commit e9a71eb

Browse files
committedMay 30, 2015
Add Facebook event to camp page
1 parent 99e449f commit e9a71eb

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed
 

‎_layouts/camp.html

+18-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
---
44
<div class="camp">
55

6+
{% if page.fb_event %}
7+
<a href="{{ page.fb_event }}" class="pull-right fb-event-box">
8+
<i class="fa fa-facebook-square"></i>
9+
<span id="fb-event-visit">Visit</span> this event on Facebook
10+
</a>
11+
{% endif %}
12+
613
<header class="camp-header">
714
<h1 class="camp-title">{{ site.title }} {{ page.starts | date: '%Y' }} {{ page.city }}</h1>
815
</header>
@@ -38,10 +45,12 @@ <h2>
3845

3946
</article>
4047

41-
<!-- Find locations and create the map -->
4248
<script type="text/javascript" src="{{ site.baseurl }}/js/leaflet.min.js"></script>
4349
<script type="text/javascript" src="{{ site.baseurl }}/js/Control.Geocoder.js"></script>
4450
<script type="text/javascript"><!--
51+
//
52+
// Find locations and create the map
53+
//
4554
var map = L.map('map-map');
4655
L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
4756
maxZoom: 19,
@@ -69,5 +78,13 @@ <h2>
6978
map.fitBounds(L.latLngBounds(pts), {maxZoom: 12});
7079
}.bind(marker));
7180
}
81+
82+
//
83+
// Turn "visit" into "join" when the event is in the future
84+
//
85+
if (Date.parse("{{ page.ends | date_to_rfc822 }}") >= Date.now()) {
86+
document.getElementById('fb-event-visit').innerHTML = "<strong>Join</strong>";
87+
}
88+
7289
//--></script>
7390
</div>

‎_sass/_base.scss

+21
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,27 @@ body > .container:first-child {
6262
// Camps
6363
//
6464

65+
.fb-event-box {
66+
font-size: 15px;
67+
padding: 15px;
68+
padding-bottom: 10px;
69+
display: block;
70+
width: 13em;
71+
72+
border: 1px solid #ccc;
73+
border-radius: 10px;
74+
&:hover, &:active {
75+
background: #fcfcfc;
76+
}
77+
78+
.fa {
79+
float: left;
80+
margin-top: -4px;
81+
font-size: 350%;
82+
margin-right: 0.2em;
83+
}
84+
}
85+
6586
.centered-blocks {
6687
display: block;
6788

0 commit comments

Comments
 (0)
Please sign in to comment.