diff --git a/erpnext/home/page/profile_settings/profile_settings.html b/erpnext/home/page/profile_settings/profile_settings.html index e69de29bb2d..49b1990efad 100644 --- a/erpnext/home/page/profile_settings/profile_settings.html +++ b/erpnext/home/page/profile_settings/profile_settings.html @@ -0,0 +1,5 @@ +
+
+
+
+
\ No newline at end of file diff --git a/erpnext/home/page/profile_settings/profile_settings.js b/erpnext/home/page/profile_settings/profile_settings.js index f1ee6ffc6da..667265e88b9 100644 --- a/erpnext/home/page/profile_settings/profile_settings.js +++ b/erpnext/home/page/profile_settings/profile_settings.js @@ -16,7 +16,6 @@ pscript['onload_profile-settings'] = function() { var wrapper = wn.pages['profile-settings']; - wrapper.className = 'layout_wrapper'; pscript.myprofile = new MyProfile(wrapper) } @@ -25,11 +24,11 @@ MyProfile = function(wrapper) { var me = this; this.make = function() { - this.head = new PageHeader(this.wrapper, 'My Profile Settings'); - this.head.add_button('Change Password', this.change_password); - this.head.add_button('Change Background', this.change_background); + this.wrapper.appframe = new wn.ui.AppFrame($(this.wrapper).find('.layout-appframe'), 'Profile Settings'); + this.wrapper.appframe.add_button('Change Password', this.change_password); + this.wrapper.appframe.add_button('Change Background', this.change_background); - this.tab = make_table($a(this.wrapper, 'div', '', {marginTop:'19px'}), + this.tab = make_table($a($(this.wrapper).find('.layout-main').get(0), 'div', '', {marginTop:'19px'}), 1, 2, '90%', ['50%', '50%'], {padding:'11px'}) this.img = $a($td(this.tab, 0, 0), 'img', '', {width: '120px', maxHeight:'200px'}); this.img.src = wn.user_info(user).image; diff --git a/erpnext/home/page/profile_settings/profile_settings.py b/erpnext/home/page/profile_settings/profile_settings.py index dc82812ee76..631d22a62e6 100644 --- a/erpnext/home/page/profile_settings/profile_settings.py +++ b/erpnext/home/page/profile_settings/profile_settings.py @@ -18,11 +18,19 @@ import webnotes from webnotes.utils import load_json, cint, nowdate + +def check_demo(): + demo_user = 'demo@webnotestech.com' + if webnotes.session['user']==demo_user: + webnotes.msgprint("Can't change in demo", raise_exception=1) + + @webnotes.whitelist() def change_password(arg): """ Change password """ + check_demo() arg = load_json(arg) if not webnotes.conn.sql('select name from tabProfile where name=%s and password=password(%s)', (webnotes.session['user'], arg['old_password'])): @@ -44,6 +52,7 @@ def set_user_details(arg=None): """ updates user details given in argument """ + check_demo() from webnotes.model.doc import Document p = Document('Profile', webnotes.user.name) @@ -59,6 +68,7 @@ def set_user_image(fid, fname): """ Set uploaded image as user image """ + check_demo() from webnotes.utils.file_manager import add_file_list, remove_file user = webnotes.session['user'] @@ -76,6 +86,7 @@ def set_user_background(fid, fname): """ Set uploaded image as user image """ + check_demo() from webnotes.utils.file_manager import add_file_list, remove_file user = webnotes.session['user'] diff --git a/erpnext/startup/startup.js b/erpnext/startup/startup.js index 9ca3adc84c6..785b8ad2a28 100644 --- a/erpnext/startup/startup.js +++ b/erpnext/startup/startup.js @@ -85,8 +85,8 @@ erpnext.startup.start = function() { // border to the body // ------------------ - //$('footer').html(''); + $('footer').html(''); // complete registration if(in_list(user_roles,'System Manager') && (wn.boot.setup_complete=='No')) { diff --git a/js/all-app.js b/js/all-app.js index 44275e2cdc3..870a3da1900 100644 --- a/js/all-app.js +++ b/js/all-app.js @@ -982,10 +982,11 @@ if(f.init)f.init();f.make_body();return f;} /* * lib/js/wn/ui/appframe.js */ -wn.ui.AppFrame=Class.extend({init:function(parent){this.buttons={};this.$w=$('
').appendTo(parent);this.$titlebar=$('
\ +wn.ui.AppFrame=Class.extend({init:function(parent,title){this.buttons={};this.$w=$('
').appendTo(parent);this.$titlebar=$('
\ \ ×\ -
').appendTo(this.$w);this.$w.find('.close').click(function(){window.history.back();})},title:function(txt){this.$titlebar.find('.appframe-title').html(txt);},add_button:function(label,click,icon){if(!this.$w.find('.appframe-toolbar').length) +
').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);},add_button:function(label,click,icon){if(!this.$w.find('.appframe-toolbar').length) this.$w.append('
');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];},clear_buttons:function(){this.$w.find('.appframe-toolbar').empty();}});wn.ui.make_app_page=function(opts){if(opts.single_column){$(opts.parent).html('
\ @@ -2230,7 +2231,8 @@ if(user=='Guest'){if(wn.boot.custom_css){set_style(wn.boot.custom_css);} if(wn.boot.website_settings.title_prefix){wn.title_prefix=wn.boot.website_settings.title_prefix;} if(wn.boot.startup_code){eval(wn.boot.startup_code);}}else{wn.boot.profile.allow_modules=wn.boot.profile.allow_modules.concat(['To Do','Knowledge Base','Calendar','Activity','Messages']) if(user_roles.indexOf('Accounts Manager')!=-1){wn.boot.profile.allow_modules.push('Dashboard');} -erpnext.toolbar.setup();erpnext.startup.set_periodic_updates();if(in_list(user_roles,'System Manager')&&(wn.boot.setup_complete=='No')){wn.require("erpnext/startup/js/complete_setup.js");erpnext.complete_setup.show();} +erpnext.toolbar.setup();erpnext.startup.set_periodic_updates();$('footer').html('');if(in_list(user_roles,'System Manager')&&(wn.boot.setup_complete=='No')){wn.require("erpnext/startup/js/complete_setup.js");erpnext.complete_setup.show();} if(wn.boot.expires_on&&in_list(user_roles,'System Manager')){var today=dateutil.str_to_obj(dateutil.get_today());var expires_on=dateutil.str_to_obj(wn.boot.expires_on);var diff=dateutil.get_diff(expires_on,today);if(0<=diff&&diff<=15){var expiry_string=diff==0?"today":repl("in %(diff)s day(s)",{diff:diff});$('header').append(repl('
\ Your ERPNext subscription will expire %(expiry_string)s. \ Please renew your subscription to continue using ERPNext \ diff --git a/js/all-web.js b/js/all-web.js index 2071afbe847..14975f945b2 100644 --- a/js/all-web.js +++ b/js/all-web.js @@ -642,10 +642,11 @@ $(wrapper).hide().fadeIn(1000);} /* * lib/js/wn/ui/appframe.js */ -wn.ui.AppFrame=Class.extend({init:function(parent){this.buttons={};this.$w=$('
').appendTo(parent);this.$titlebar=$('
\ +wn.ui.AppFrame=Class.extend({init:function(parent,title){this.buttons={};this.$w=$('
').appendTo(parent);this.$titlebar=$('
\ \ ×\ -
').appendTo(this.$w);this.$w.find('.close').click(function(){window.history.back();})},title:function(txt){this.$titlebar.find('.appframe-title').html(txt);},add_button:function(label,click,icon){if(!this.$w.find('.appframe-toolbar').length) +
').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);},add_button:function(label,click,icon){if(!this.$w.find('.appframe-toolbar').length) this.$w.append('
');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];},clear_buttons:function(){this.$w.find('.appframe-toolbar').empty();}});wn.ui.make_app_page=function(opts){if(opts.single_column){$(opts.parent).html('
\ @@ -841,7 +842,8 @@ if(user=='Guest'){if(wn.boot.custom_css){set_style(wn.boot.custom_css);} if(wn.boot.website_settings.title_prefix){wn.title_prefix=wn.boot.website_settings.title_prefix;} if(wn.boot.startup_code){eval(wn.boot.startup_code);}}else{wn.boot.profile.allow_modules=wn.boot.profile.allow_modules.concat(['To Do','Knowledge Base','Calendar','Activity','Messages']) if(user_roles.indexOf('Accounts Manager')!=-1){wn.boot.profile.allow_modules.push('Dashboard');} -erpnext.toolbar.setup();erpnext.startup.set_periodic_updates();if(in_list(user_roles,'System Manager')&&(wn.boot.setup_complete=='No')){wn.require("erpnext/startup/js/complete_setup.js");erpnext.complete_setup.show();} +erpnext.toolbar.setup();erpnext.startup.set_periodic_updates();$('footer').html('');if(in_list(user_roles,'System Manager')&&(wn.boot.setup_complete=='No')){wn.require("erpnext/startup/js/complete_setup.js");erpnext.complete_setup.show();} if(wn.boot.expires_on&&in_list(user_roles,'System Manager')){var today=dateutil.str_to_obj(dateutil.get_today());var expires_on=dateutil.str_to_obj(wn.boot.expires_on);var diff=dateutil.get_diff(expires_on,today);if(0<=diff&&diff<=15){var expiry_string=diff==0?"today":repl("in %(diff)s day(s)",{diff:diff});$('header').append(repl('
\ Your ERPNext subscription will expire %(expiry_string)s. \ Please renew your subscription to continue using ERPNext \