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
-
- Add User
-
-
-
-
-
\ 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 = '\
+ $(wn.pages.users).find('.layout-main').append(repl('
\
%(delete_html)s\
\
\
@@ -103,7 +114,7 @@ $.extend(wn.pages.users, {
', 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('
\
%(icon)s %(label)s ',args)).click(click).appendTo(this.$w.find('.appframe-toolbar'));return this.buttons[label];},add_help_button:function(txt){this.make_toolbar();$('
\
@@ -1375,7 +1375,7 @@ return;}
var _save=function(){$c('webnotes.widgets.form.save.savedocs',{'docs':compress_doclist(doclist),'docname':dn,'action':save_action,'user':user},function(r,rtxt){if(f){f.savingflag=false;}
if(r.saved){if(onsave)onsave(r);}else{if(onerr)onerr(r);}},function(){if(f){f.savingflag=false;}},0,(f?'Saving...':''));}
if(doc.__islocal&&(doctype&&doctype.autoname&&doctype.autoname.toLowerCase()=='prompt')){var newname=prompt('Enter the name of the new '+dt,'');if(newname){doc.__newname=strip(newname);_save();}else{msgprint('Not Saved');onerr();}}else{_save();}}
-function check_required(dt,dn,parent_dt){var doc=locals[dt][dn];if(doc.docstatus>1)return true;var fl=wn.meta.docfield_list[dt];if(!fl)return true;var all_clear=true;var errfld=[];for(var i=0;i1)return true;var fl=wn.meta.docfield_list[dt];if(!fl)return true;var all_clear=true;var errfld=[];for(var i=0;iMandatory fields required in '+
diff --git a/public/js/all-web.js b/public/js/all-web.js
index 9142b962ef..91f52cb43c 100644
--- a/public/js/all-web.js
+++ b/public/js/all-web.js
@@ -508,7 +508,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('