summaryrefslogtreecommitdiff
path: root/public/assets/js/lib/views/index/threadbox.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/assets/js/lib/views/index/threadbox.js')
-rw-r--r--public/assets/js/lib/views/index/threadbox.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/public/assets/js/lib/views/index/threadbox.js b/public/assets/js/lib/views/index/threadbox.js
index 01d1de4..157b672 100644
--- a/public/assets/js/lib/views/index/threadbox.js
+++ b/public/assets/js/lib/views/index/threadbox.js
@@ -9,6 +9,7 @@ var ThreadBox = View.extend({
this.template = this.$(".template").html()
this.keywordTemplate = this.$(".keywordTemplate").html()
this.welcomeTemplate = this.$(".welcomeTemplate").html()
+ this.profileTemplate = this.$(".profileTemplate").html()
},
load: function(data){
@@ -19,6 +20,10 @@ var ThreadBox = View.extend({
this.appendKeyword(data.keyword)
this.appendThreads(data.threads)
}
+ else if (data.user) {
+ this.appendProfile(data.user)
+ this.appendThreads(data.threads)
+ }
else {
if (this.options.latest) {
var latest = data.threads.sort( (a,b) => {
@@ -123,4 +128,8 @@ var ThreadBox = View.extend({
this.$el.append(this.welcomeTemplate)
},
+ appendProfile: function(user){
+ this.$el.append(this.profileTemplate.replace(/{{username}}/g, user.username))
+ },
+
})