summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js/lib/blogs/HubView.js
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/www/js/lib/blogs/HubView.js')
-rw-r--r--StoneIsland/www/js/lib/blogs/HubView.js15
1 files changed, 12 insertions, 3 deletions
diff --git a/StoneIsland/www/js/lib/blogs/HubView.js b/StoneIsland/www/js/lib/blogs/HubView.js
index 3ed45b7c..3b2900ad 100644
--- a/StoneIsland/www/js/lib/blogs/HubView.js
+++ b/StoneIsland/www/js/lib/blogs/HubView.js
@@ -4,6 +4,7 @@ var HubView = ScrollableView.extend({
template: $("#hub .template").html(),
events: {
+ "click .store": "store_link",
},
initialize: function(){
@@ -22,16 +23,20 @@ var HubView = ScrollableView.extend({
this.data = data
this.$loader.hide()
this.$content.empty()
- // id date subtitle body link image[uri caption]
+ // id date subtitle body link store image[uri caption]
this.data.forEach(function(row){
// console.log(row)
var t = this.template.replace(/{{id}}/, row.id)
- .replace(/{{date}}/, row.date)
+ .replace(/{{date}}/, moment(row.date).format("MM.DD.YYYY"))
.replace(/{{title}}/, row.title)
.replace(/{{subtitle}}/, row.subtitle)
.replace(/{{link}}/, row.link)
.replace(/{{body}}/, row.body.replace(/\n/g, "<br>"))
- this.$content.append(t)
+ var $t = $(t)
+ if (row.store != "true") {
+ $t.find(".store").remove()
+ }
+ this.$content.append($t)
if (row.image.length > 1) {
// image gallery
@@ -74,5 +79,9 @@ var HubView = ScrollableView.extend({
this.deferScrollToTop()
},
+
+ store_link: function(){
+ app.router.go("store")
+ },
}) \ No newline at end of file