Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'develop' of github.com:nko2/sf2-boys into develop

  • Loading branch information...
commit 9ecbaa5e910497c28ab24f028541abb3c7a2dd2f 2 parents b1df4d9 + da22755
@jmikola jmikola authored
Showing with 12 additions and 2 deletions.
  1. +10 −0 server.js
  2. +2 −2 views/backbone/_events.ejs
View
10 server.js
@@ -231,7 +231,9 @@ app.get('/events.json', function(req, res){
}
event.set("tweetsCount", event.tweets.length);
+ event.set("assetsCount", event.assets.length);
event.tweets = [];
+ event.assets = [];
eventList.push(event);
});
@@ -259,7 +261,9 @@ app.get('/events/my.json', andRequireUser, function(req, res) {
return aTime > bTime ? -1 : 1
}).forEach(function(event, i) {
event.set("tweetsCount", event.tweets.length);
+ event.set("assetsCount", event.assets.length);
event.tweets = [];
+ event.assets = [];
eventList.push(event);
});
@@ -287,7 +291,9 @@ app.get('/events/current.json', function(req, res){
return aTime > bTime ? -1 : 1
}).forEach(function(event, i) {
event.set("tweetsCount", event.tweets.length);
+ event.set("assetsCount", event.assets.length);
event.tweets = [];
+ event.assets = [];
eventList.push(event);
});
@@ -315,7 +321,9 @@ app.get('/events/upcoming.json', function(req, res){
return aTime > bTime ? -1 : 1
}).forEach(function(event, i) {
event.set("tweetsCount", event.tweets.length);
+ event.set("assetsCount", event.assets.length);
event.tweets = [];
+ event.assets = [];
eventList.push(event);
});
@@ -333,7 +341,9 @@ app.get('/events/:id.json', function(req, res) {
}
event.set("tweetsCount", event.tweets.length);
+ event.set("assetsCount", event.assets.length);
event.tweets = [];
+ event.assets = [];
res.json(event, 200);
});
View
4 views/backbone/_events.ejs
@@ -66,7 +66,7 @@
{% } %}
</span>
{% if (typeof location != 'undefined') { %}
- <div class="img" style="width:150px; height:150px; background:url(http://maps.google.com/maps/api/staticmap?center={{ location }}&zoom=13&size=150x150&sensor=false);"></div>
+ <div class="img" style="width:150px; height:150px; background:url(http://maps.google.com/maps/api/staticmap?center={{ encodeURIComponent(location) }}&zoom=13&size=150x150&sensor=false);"></div>
{% } else { %}
<div class="img" style="width:150px; height:150px; background:url(http://maps.google.com/maps/api/staticmap?center=Unknown&zoom=13&size=150x150&sensor=false);"></div>
{% } %}
@@ -124,7 +124,7 @@
<article>
<header class="map">
{% if (typeof location != 'undefined') { %}
- <div class="img" style="width:300px; height:300px; background:url(http://maps.google.com/maps/api/staticmap?center={{ location }}&markers=size:mid|color:blue|{{ location }}&zoom=13&size=300x300&sensor=false);"></div>
+ <div class="img" style="width:300px; height:300px; background:url(http://maps.google.com/maps/api/staticmap?center={{ encodeURIComponent(location) }}&markers=size:mid|color:blue|{{ encodeURIComponent(location) }}&zoom=13&size=300x300&sensor=false);"></div>
{% } else { %}
<div class="img" style="width:300px; height:300px; background:url(http://maps.google.com/maps/api/staticmap?center=Unknown&markers=size:mid|color:blue|Unknown&zoom=13&size=300x300&sensor=false);"></div>
{% } %}
Please sign in to comment.
Something went wrong with that request. Please try again.