diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-11-19 23:17:05 -0500 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-11-19 23:17:05 -0500 |
| commit | 0805b9a105f6cb12ffb23349e1458d13ffd90d4f (patch) | |
| tree | b3ae97ace949963b0e6d9ae1df6be74046f5fd12 /StoneIsland/www/js/lib/blogs/HubView.js | |
| parent | eac52234321adbbb0c97c0bfedf4c7bcc64d7397 (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.js | 15 |
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 |
