summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js/lib/blogs/HubView.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-11-19 23:17:05 -0500
committerJules Laplace <jules@okfoc.us>2015-11-19 23:17:05 -0500
commit0805b9a105f6cb12ffb23349e1458d13ffd90d4f (patch)
treeb3ae97ace949963b0e6d9ae1df6be74046f5fd12 /StoneIsland/www/js/lib/blogs/HubView.js
parenteac52234321adbbb0c97c0bfedf4c7bcc64d7397 (diff)
dates and some cart auth
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