diff options
Diffstat (limited to 'public/assets/js/lib/views/admin/adminz.js')
| -rw-r--r-- | public/assets/js/lib/views/admin/adminz.js | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/public/assets/js/lib/views/admin/adminz.js b/public/assets/js/lib/views/admin/adminz.js new file mode 100644 index 0000000..caed86d --- /dev/null +++ b/public/assets/js/lib/views/admin/adminz.js @@ -0,0 +1,39 @@ +var AdminView = View.extend({ + + events: { + }, + + action: "/api/admin", + + initialize: function(opt){ + // this.hootbox = new HootBox ({ parent: this }) + this.password = new ChangePasswordForm ({ parent: this }) + this.lastlog = new LastLog ({ parent: this }) + }, + + load: function(){ + $("body").addClass("index").addClass("admin") + $.get(this.action, this.populate.bind(this)) + }, + + populate: function(data){ + $("body").removeClass('loading') + console.log(data) + this.password.load(data.usernames) + this.lastlog.load(data.lastlog) + if (data.mail.count) { + $(".alert").show().html( + "<a href='/mail'>" + + "You have " + + data.mail.count + + " new message" + + courtesy_s(data.mail.count) + + "!</a>") + if (is_mobile) { + $("#content").prepend( $(".alert") ) + } + } + $(".search_form input").focus() + }, + +}) |
