diff --git a/erpnext/utilities/page/users/users.html b/erpnext/utilities/page/users/users.html index fe2f000413..e69de29bb2 100644 --- a/erpnext/utilities/page/users/users.html +++ b/erpnext/utilities/page/users/users.html @@ -1,13 +0,0 @@ -
- × -

Users

-
-
Add, disable, delete users and change their roles, passwords and security settings
-
- -
-
-
-
-
\ No newline at end of file diff --git a/erpnext/utilities/page/users/users.js b/erpnext/utilities/page/users/users.js index 517c3cf0ce..ee05001edf 100644 --- a/erpnext/utilities/page/users/users.js +++ b/erpnext/utilities/page/users/users.js @@ -16,26 +16,37 @@ $.extend(wn.pages.users, { onload: function(wrapper) { - wn.pages.users.profiles = {}; - wn.pages.users.refresh(); - wn.pages.users.setup(); - wn.pages.users.role_editor = new erpnext.RoleEditor(); + var w = wn.pages.users; + wn.ui.make_app_page({ + parent: w, + title: "Users", + single_column: true + }); + w.profiles = {}; + w.refresh(); + w.setup(); + w.role_editor = new erpnext.RoleEditor(); }, setup: function() { + wn.pages.users.appframe.add_button('+ Add User', function() { + wn.pages.users.add_user(); + }); + // set roles - $('.users-area').on('click', '.btn.user-roles', function() { + var w = wn.pages.users; + $(w).on('click', '.btn.user-roles', function() { var uid = $(this).parent().parent().attr('data-name'); wn.pages.users.role_editor.show(uid); }); // settings - $('.users-area').on('click', '.btn.user-settings', function() { + $(w).on('click', '.btn.user-settings', function() { var uid = $(this).parent().parent().attr('data-name'); wn.pages.users.show_settings(uid); }); // delete - $('.users-area').on('click', 'a.close', function() { + $(w).on('click', 'a.close', function() { $card = $(this).parent(); var uid = $card.attr('data-name'); $card.css('opacity', 0.6); @@ -55,7 +66,7 @@ $.extend(wn.pages.users, { wn.call({ method:'utilities.page.users.users.get', callback: function(r, rt) { - $('.users-area').empty(); + $(wn.pages.users).find('.layout-main').empty(); for(var i in r.message) { var p = r.message[i]; wn.pages.users.profiles[p.name] = p; @@ -91,7 +102,7 @@ $.extend(wn.pages.users, { if(!data.enabled) data.delete_html = '×'; - $('.users-area').append(repl('
\ + $(wn.pages.users).find('.layout-main').append(repl('
\ %(delete_html)s\ \ ', data)); if(!data.enabled) { - $('.users-area .user-card:last') + $(wn.pages.users).find('.layout-main .user-card:last') .addClass('disabled') .find('.user-fullname').html('Disabled'); } @@ -225,8 +236,7 @@ $.extend(wn.pages.users, { var me = wn.pages.users; var active_users = $('.user-card:not(.disabled)'); if(wn.boot.max_users && (active_users.length >= wn.boot.max_users)) { - msgprint(repl("Alas!
\ - You already have %(active_users)s active users, \ + msgprint(repl("You already have %(active_users)s active users, \ which is the maximum number that you are currently allowed to add.

\ So, to add more users, you can:
\ 1. Upgrade to the unlimited users plan, or
\ diff --git a/public/js/all-app.js b/public/js/all-app.js index a86eba999a..ef3b4e38e4 100644 --- a/public/js/all-app.js +++ b/public/js/all-app.js @@ -850,7 +850,7 @@ wn.ui.AppFrame=Class.extend({init:function(parent,title){this.buttons={};this.$w \ ×\
').appendTo(this.$w);this.$w.find('.close').click(function(){window.history.back();}) -if(title)this.title(title);},title:function(txt){this.$titlebar.find('.appframe-title').html(txt);},make_toolbar:function(){if(!this.$w.find('.appframe-toolbar').length) +if(title)this.title(title);},title:function(txt){this.clear_breadcrumbs();this.add_breadcrumb(txt);},make_toolbar:function(){if(!this.$w.find('.appframe-toolbar').length) this.$w.append('
');},add_button:function(label,click,icon){this.make_toolbar();args={label:label,icon:''};if(icon){args.icon='';} this.buttons[label]=$(repl('',args)).click(click).appendTo(this.$w.find('.appframe-toolbar'));return this.buttons[label];},add_help_button:function(txt){this.make_toolbar();$('
').appendTo(this.$w);this.$w.find('.close').click(function(){window.history.back();}) -if(title)this.title(title);},title:function(txt){this.$titlebar.find('.appframe-title').html(txt);},make_toolbar:function(){if(!this.$w.find('.appframe-toolbar').length) +if(title)this.title(title);},title:function(txt){this.clear_breadcrumbs();this.add_breadcrumb(txt);},make_toolbar:function(){if(!this.$w.find('.appframe-toolbar').length) this.$w.append('
');},add_button:function(label,click,icon){this.make_toolbar();args={label:label,icon:''};if(icon){args.icon='';} this.buttons[label]=$(repl('',args)).click(click).appendTo(this.$w.find('.appframe-toolbar'));return this.buttons[label];},add_help_button:function(txt){this.make_toolbar();$('