refactoring of foursquare controller and template variable names
This commit is contained in:
@ -31,12 +31,12 @@ exports.foursquare = function(req, res) {
|
|||||||
var latitude = geo.ll[0];
|
var latitude = geo.ll[0];
|
||||||
var longitude = geo.ll[1];
|
var longitude = geo.ll[1];
|
||||||
foursquare.Venues.getTrending(latitude, longitude, { limit: 10 }, req.user.tokens.foursquare, function(err, results) {
|
foursquare.Venues.getTrending(latitude, longitude, { limit: 10 }, req.user.tokens.foursquare, function(err, results) {
|
||||||
callback(err, results.venues);
|
callback(err, results);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
venueDetail: function(callback) {
|
venueDetail: function(callback) {
|
||||||
foursquare.Venues.getVenue('40a55d80f964a52020f31ee3', req.user.tokens.foursquare, function(err, results) {
|
foursquare.Venues.getVenue('40a55d80f964a52020f31ee3', req.user.tokens.foursquare, function(err, results) {
|
||||||
callback(err, results.venue);
|
callback(err, results);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
userCheckins: function(callback) {
|
userCheckins: function(callback) {
|
||||||
@ -53,8 +53,8 @@ exports.foursquare = function(req, res) {
|
|||||||
message: req.flash('info'),
|
message: req.flash('info'),
|
||||||
user: req.user,
|
user: req.user,
|
||||||
trendingVenues: results.trendingVenues,
|
trendingVenues: results.trendingVenues,
|
||||||
venue: results.venueDetail,
|
venueDetail: results.venueDetail,
|
||||||
checkins: results.userCheckins
|
userCheckins: results.userCheckins
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -31,7 +31,7 @@ block content
|
|||||||
th Checkins
|
th Checkins
|
||||||
th Here Now
|
th Here Now
|
||||||
tbody
|
tbody
|
||||||
for venue in trendingVenues
|
for venue in trendingVenues.venues
|
||||||
tr
|
tr
|
||||||
td= venue.name
|
td= venue.name
|
||||||
td #{venue.location.address}, #{venue.location.city}, #{venue.location.state}
|
td #{venue.location.address}, #{venue.location.city}, #{venue.location.state}
|
||||||
@ -40,13 +40,13 @@ block content
|
|||||||
|
|
||||||
.lead Venue Detail
|
.lead Venue Detail
|
||||||
img.img-thumbnail(src='https://irs3.4sqi.net/img/general/200x200/11109710_xePHC-bh76LL_EaG-tsM1lUV6Bp-VUG1r_haDSqSvBM.jpg')
|
img.img-thumbnail(src='https://irs3.4sqi.net/img/general/200x200/11109710_xePHC-bh76LL_EaG-tsM1lUV6Bp-VUG1r_haDSqSvBM.jpg')
|
||||||
p.text-danger Name: #{venue.name}
|
p.text-danger Name: #{venueDetail.venue.name}
|
||||||
p.text-muted Location: #{venue.location.address}, #{venue.location.city}, #{venue.location.state}
|
p.text-muted Location: #{venueDetail.venue.location.address}, #{venueDetail.venue.location.city}, #{venueDetail.venue.location.state}
|
||||||
p.text-success Categories:
|
p.text-success Categories:
|
||||||
for category in venue.categories
|
for category in venueDetail.venue.categories
|
||||||
span #{category.shortName} |
|
span #{category.shortName} |
|
||||||
p.text-info Likes: #{venue.likes.count}
|
p.text-info Likes: #{venueDetail.venue.likes.count}
|
||||||
p.text-warning Rating: #{venue.rating}
|
p.text-warning Rating: #{venueDetail.venue.rating}
|
||||||
|
|
||||||
#users.tab-pane.fade
|
#users.tab-pane.fade
|
||||||
.lead User Checkins
|
.lead User Checkins
|
||||||
@ -58,7 +58,7 @@ block content
|
|||||||
th Category
|
th Category
|
||||||
th Checkins
|
th Checkins
|
||||||
tbody
|
tbody
|
||||||
for checkin in checkins
|
for checkin in userCheckins.checkins.items
|
||||||
tr
|
tr
|
||||||
td= checkin.venue.name
|
td= checkin.venue.name
|
||||||
td #{checkin.venue.location.address}, #{checkin.venue.location.city}, #{checkin.venue.location.state}
|
td #{checkin.venue.location.address}, #{checkin.venue.location.city}, #{checkin.venue.location.state}
|
||||||
|
Reference in New Issue
Block a user