diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-01-25 02:15:48 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-01-25 02:15:48 +0100 |
| commit | f8055775f3ac74e9e6054aef102673cefcf27986 (patch) | |
| tree | 6c7c302746db594ff0d61863f533633c7259de33 /public/assets/js | |
| parent | 3975b8e7e2841298da1ad497ffe29ba004b55ec2 (diff) | |
more on profile
Diffstat (limited to 'public/assets/js')
| -rw-r--r-- | public/assets/js/lib/views/profile/profile.js | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/public/assets/js/lib/views/profile/profile.js b/public/assets/js/lib/views/profile/profile.js index 1064adb..4396414 100644 --- a/public/assets/js/lib/views/profile/profile.js +++ b/public/assets/js/lib/views/profile/profile.js @@ -5,19 +5,33 @@ var ProfileView = View.extend({ events: { }, - action: "/api/user/", + action: "/api/profile/", initialize: function(opt){ this.template = this.$(".template").html() + this.comments = new CommentsView ({ parent: this }) + this.files = new FilesView ({ parent: this }) + this.gallery = new GalleryView ({ parent: this }) + this.threadbox = new ThreadBox ({ parent: this }) }, load: function(username){ - $.get(this.action + username, this.populate.bind(this)) + $.get(this.action + username, this.loadProfile.bind(this)) + }, + + loadProfile: function(data){ + const { user, threads, topThreads, files, comments } = data + this.populate(user) + // this.populateComments(topComments) + // this.comments.load(data.comments, data.thread) + this.gallery.load(data.files) + this.files.load(data.files) + this.threadbox.load({ threads: data.threads }) }, populate: function(user){ $("body").removeClass('loading') - var $table = this.$("table") + var $table = this.$("table.profile_meta") var username = sanitizeHTML(user.username) var is_own_profile = (username === auth.user.username) if (is_own_profile) { |
