summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js/lib/blogs/HubView.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-09-17 08:12:18 -0400
committerJules Laplace <jules@okfoc.us>2015-09-17 08:12:18 -0400
commit18eecb2faa34cbdfe558e3941c9ec0f5019a3ff9 (patch)
treec476e5ab9ccb2d799df19b21c70d6f9d15382f87 /StoneIsland/www/js/lib/blogs/HubView.js
parent7eb327b13bd9ee241f47f22ba1c3db3c90e8e942 (diff)
fetch blogviews from cms database and populate based on presumed schema
Diffstat (limited to 'StoneIsland/www/js/lib/blogs/HubView.js')
-rw-r--r--StoneIsland/www/js/lib/blogs/HubView.js17
1 files changed, 16 insertions, 1 deletions
diff --git a/StoneIsland/www/js/lib/blogs/HubView.js b/StoneIsland/www/js/lib/blogs/HubView.js
index 430464b1..ce035c7d 100644
--- a/StoneIsland/www/js/lib/blogs/HubView.js
+++ b/StoneIsland/www/js/lib/blogs/HubView.js
@@ -8,13 +8,28 @@ var HubView = View.extend({
initialize: function(){
this.$content = this.$(".content")
+ this.$loader = this.$(".loader")
},
show: function(){
document.body.className = "hub"
},
- populate: function(){
+ populate: function(data){
+ this.data = data
+ this.$loader.hide()
+ this.$content.empty()
+ this.data.forEach(function(row){
+ var t = this.template.replace({{image}}, row.image.url)
+ .replace({{date}}, row.date)
+ .replace({{code}}, row.code)
+ .replace({{title}}, row.title)
+ .replace({{subtitle}}, row.subtitle)
+ .replace({{link}}, row.link)
+ .replace({{body}}, row.body)
+ this.$content.append(t)
+ }.bind(this))
},
+
}) \ No newline at end of file