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 1490d32ffdccfae2a2bba48547def637f528279b 2 parents f63c222 + ad2f673
@jmikola jmikola authored
View
18 public/javascripts/twalks.js
@@ -211,15 +211,19 @@
this.collection.bind('reset', this.render);
}
, render: function() {
- var $list;
+ if (this.collection.length > 0) {
+ var $list;
- $(this.el).html(this.template({}));
- $list = this.$('.list');
+ $(this.el).html(this.template({}));
+ $list = this.$('.list');
- this.collection.each(function(event) {
- var view = new App.Views.EventsListEvent({ model: event });
- $list.append(view.render().el);
- });
+ this.collection.each(function(event) {
+ var view = new App.Views.EventsListEvent({ model: event });
+ $list.append(view.render().el);
+ });
+ } else {
+ $(this.el).html($('#events-list-empty-template').html());
+ }
return this;
}
View
5 scripts/poller.js
@@ -55,8 +55,8 @@ function processEvent(job, collection, event, eventsCollection) {
var poll = poller.createPoller(twit, event.hash);
poll.on('data', function(res) {
- console.log(res);
if (typeof res.results !== "undefined") {
+ console.log(res);
res.results.forEach(function(json) {
var tweet = {
tweetId : json.id_str
@@ -79,6 +79,7 @@ function processEvent(job, collection, event, eventsCollection) {
// don't process existing tweet
if (event.tweets.map(mapper('tweetId')).indexOf(tweet.tweetId) !== -1) {
+ console.log('tweet exists');
return;
}
@@ -88,6 +89,8 @@ function processEvent(job, collection, event, eventsCollection) {
event.tweets.push(tweet);
+ eventsCollection.save(event);
+
var relevantTalks = [];
event.talks.forEach(function(talk) {
View
8 views/backbone/_events.ejs
@@ -46,6 +46,14 @@
</div>
</script>
+<script type="text/template" id="events-list-empty-template">
+ <div id="events-list" class="row">
+ <section class="span16 columns list">
+ No Events Found
+ </section>
+ </div>
+</script>
+
<script type="text/template" id="events-list-event-template">
<header class="map">
<span class="time">
Please sign in to comment.
Something went wrong with that request. Please try again.