diff --git a/erpnext/home/page/profile_settings/profile_settings.html b/erpnext/home/page/profile_settings/profile_settings.html index e69de29bb2..49b1990efa 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 f1ee6ffc6d..667265e88b 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 dc82812ee7..631d22a62e 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/patches/patch_list.py b/erpnext/patches/patch_list.py index 9d9e5a3340..8002078883 100644 --- a/erpnext/patches/patch_list.py +++ b/erpnext/patches/patch_list.py @@ -237,6 +237,11 @@ patch_list = [ 'patch_file': 'clean_property_setter', 'description': 'Patch related to property setter cleanup' }, + { + 'patch_module': 'patches.april_2012', + 'patch_file': 'naming_series_patch', + 'description': 'Move naming series options into property setter' + }, { 'patch_module': 'patches.jan_mar_2012', 'patch_file': 'rename_dt', @@ -267,11 +272,6 @@ patch_list = [ 'patch_file': 'reload_c_form', 'description': 'Added attchemnt option and total field' }, - { - 'patch_module': 'patches.april_2012', - 'patch_file': 'naming_series_patch', - 'description': 'Move naming series options into property setter' - }, { 'patch_module': 'patches.april_2012', 'patch_file': 'after_sync_cleanup', diff --git a/erpnext/startup/event_handlers.py b/erpnext/startup/event_handlers.py index c58d378bd5..a67a2148b9 100644 --- a/erpnext/startup/event_handlers.py +++ b/erpnext/startup/event_handlers.py @@ -60,9 +60,9 @@ def boot_session(bootinfo): import webnotes.model.doc bootinfo['custom_css'] = webnotes.conn.get_value('Style Settings', None, 'custom_css') or '' + bootinfo['website_settings'] = webnotes.model.doc.getsingle('Website Settings') if webnotes.session['user']=='Guest': - bootinfo['website_settings'] = webnotes.model.doc.getsingle('Website Settings') bootinfo['website_menus'] = webnotes.conn.sql("""select label, url, custom_page, parent_label, parentfield from `tabTop Bar Item` where parent='Website Settings' order by idx asc""", as_dict=1) diff --git a/erpnext/startup/startup.js b/erpnext/startup/startup.js index 321149cf81..455b850ca0 100644 --- a/erpnext/startup/startup.js +++ b/erpnext/startup/startup.js @@ -72,10 +72,6 @@ erpnext.startup.start = function() { // always allow apps wn.boot.profile.allow_modules = wn.boot.profile.allow_modules.concat( ['To Do', 'Knowledge Base', 'Calendar', 'Activity', 'Messages']) - // allow dashboard to accounts manager - if(user_roles.indexOf('Accounts Manager')!=-1) { - wn.boot.profile.allow_modules.push('Dashboard'); - } // setup toolbar erpnext.toolbar.setup(); @@ -85,8 +81,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')) { @@ -106,7 +102,7 @@ erpnext.startup.start = function() { ', { expiry_string: expiry_string })); } else if (diff < 0) { $('header').append(repl('
\ - This ERPNext subscription has expired and should be deleted. \ + This ERPNext subscription has expired. \
', { expiry_string: expiry_string })); } } diff --git a/erpnext/utilities/page/users/users.js b/erpnext/utilities/page/users/users.js index 704682eafc..757b1a3bda 100644 --- a/erpnext/utilities/page/users/users.js +++ b/erpnext/utilities/page/users/users.js @@ -64,7 +64,8 @@ $.extend(wn.pages.users, { } }); if(!$('.subscription-info').length && (wn.boot.max_users || wn.boot.expires_on)) { - var $sub_info = $('
').insertAfter('.help'); + var $sub_info = $('
') + .insertAfter($(wn.pages.users).find('.help')); if(wn.boot.max_users) { $sub_info.append(repl('\ \ diff --git a/erpnext/utilities/page/users/users.py b/erpnext/utilities/page/users/users.py index 819f7bb1da..7da8003a3d 100644 --- a/erpnext/utilities/page/users/users.py +++ b/erpnext/utilities/page/users/users.py @@ -112,7 +112,7 @@ def add_profile(args): active_users = sql("""select count(*) from tabProfile where ifnull(enabled, 0)=1 and docstatus<2 and name not in ('Administrator', 'Guest')""")[0][0] - if active_users >= conf.max_users: + if active_users >= conf.max_users and conf.max_users: # same message as in users.js webnotes.msgprint("""Alas!
\ You already have %(active_users)s active users, \ diff --git a/erpnext/website/doctype/style_settings/custom_template.css b/erpnext/website/doctype/style_settings/custom_template.css index 4866ac7be5..6fe8ce5872 100644 --- a/erpnext/website/doctype/style_settings/custom_template.css +++ b/erpnext/website/doctype/style_settings/custom_template.css @@ -19,18 +19,6 @@ } {% endif %} -{% if doc.footer_font_color %} -footer { - color: {{ doc.footer_font_color }}; -} -footer a, footer a:visited, footer a:hover { - color: {{ doc.footer_font_color }}; -} -.web-footer-menu ul li { - border-right: 1px solid {{ doc.footer_font_color }}; -} -{% endif %} - {% if doc.heading_font %} h1, h2, h3, h4, h5 { font-family: '{{ doc.heading_font}}', Arial, 'Helvetica Neue' !important; diff --git a/erpnext/website/doctype/style_settings/style_settings.py b/erpnext/website/doctype/style_settings/style_settings.py index db26a15e80..f47a427bae 100644 --- a/erpnext/website/doctype/style_settings/style_settings.py +++ b/erpnext/website/doctype/style_settings/style_settings.py @@ -25,6 +25,9 @@ class DocType: with open('erpnext/website/doctype/style_settings/custom_template.css', 'r') as f: temp = Template(f.read()) + if not self.doc.font_size: + self.doc.font_size = '13px' + self.doc.small_font_size = str(int(self.doc.font_size[:-2])-2) + 'px' self.doc.custom_css = temp.render(doc = self.doc) diff --git a/erpnext/website/doctype/style_settings/style_settings.txt b/erpnext/website/doctype/style_settings/style_settings.txt index dd962d5459..d5a9e803ef 100644 --- a/erpnext/website/doctype/style_settings/style_settings.txt +++ b/erpnext/website/doctype/style_settings/style_settings.txt @@ -5,7 +5,7 @@ { 'creation': '2012-04-02 16:02:43', 'docstatus': 0, - 'modified': '2012-04-25 10:00:35', + 'modified': '2012-05-01 15:58:16', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -23,7 +23,7 @@ 'name': '__common__', 'section_style': u'Simple', 'show_in_menu': 0, - 'version': 23 + 'version': 1 }, # These values are common for all DocField @@ -89,23 +89,10 @@ 'permlevel': 0 }, - # DocField - { - 'colour': u'White:FFF', - 'description': u'Select a white footer foreground color if you have a dark background', - 'doctype': u'DocField', - 'fieldname': u'footer_font_color', - 'fieldtype': u'Select', - 'label': u'Footer Font Color', - 'options': u'\nwhite', - 'permlevel': 0 - }, - # DocField { 'doctype': u'DocField', 'fieldtype': u'Column Break', - 'label': u'Fonts', 'permlevel': 0, 'width': u'50%' }, @@ -143,6 +130,7 @@ # DocField { 'doctype': u'DocField', + 'fieldname': u'css', 'fieldtype': u'Section Break', 'label': u'CSS', 'permlevel': 0 diff --git a/erpnext/website/js/topbar.js b/erpnext/website/js/topbar.js index 8caf8dcf1c..b004a6f15a 100644 --- a/erpnext/website/js/topbar.js +++ b/erpnext/website/js/topbar.js @@ -27,7 +27,7 @@ wn.provide('erpnext.navbar'); erpnext.navbar.Navbar = Class.extend({ init: function() { this.make(); - $('.brand').html(wn.boot.website_settings.brand_html); + $('.brand').html(wn.boot.website_settings.brand_html || sys_defaults.company); this.make_items(); $('.dropdown-toggle').dropdown(); }, @@ -54,9 +54,11 @@ erpnext.navbar.Navbar = Class.extend({ for(var i=0;i\ - %(label)s', item)) + %(label)s', item)); } } @@ -77,21 +79,26 @@ erpnext.navbar.Navbar = Class.extend({ }); $parent_li.append(''); } - item.route = item.url || item.custom_page; + erpnext.header_link_settings(item); $parent_li.find('.dropdown-menu').append(repl('
  • \ - %(label)s
  • ', item)) + %(label)s', item)) } } } }); - // footer erpnext.Footer = Class.extend({ init: function() { + if(!wn.boot.website_settings.copyright) { + wn.boot.website_settings.copyright = sys_defaults.company; + } + if(!wn.boot.website_settings.address) { + wn.boot.website_settings.address = ''; + } $('footer').html(repl('', wn.boot.website_settings)); @@ -102,14 +109,25 @@ erpnext.Footer = Class.extend({ for(var i=0;i%(label)s', item)) } } } }); +// customize hard / soft links +erpnext.header_link_settings = function(item) { + item.route = item.url || item.custom_page; + if(item.route.substr(0,4)=='http') { + item.target = 'target="_blank"'; + } else { + item.target = ''; + item.route = '#!' + item.route; + } +} + $(document).bind('startup', function() { erpnext.footer = new erpnext.Footer(); erpnext.navbar.navbar = new erpnext.navbar.Navbar(); diff --git a/erpnext/website/page/blog/blog.js b/erpnext/website/page/blog/blog.js index 3836f909ee..184424b203 100644 --- a/erpnext/website/page/blog/blog.js +++ b/erpnext/website/page/blog/blog.js @@ -21,7 +21,8 @@ pscript.onload_blog = function(wrapper) { query: 'select tabBlog.name, title, left(content, 1000) as content, tabBlog.modified, \ ifnull(first_name, "") as first_name, ifnull(last_name, "") as last_name \ from tabProfile, tabBlog\ - where ifnull(published,0)=1 and tabBlog.owner = tabProfile.name', + where ifnull(published,0)=1 and tabBlog.owner = tabProfile.name \ + order by tabBlog.modified desc', hide_refresh: true, no_toolbar: true, render_row: function(parent, data) { diff --git a/images/erpnext1.png b/images/erpnext1.png new file mode 100644 index 0000000000..cfc3d84d24 Binary files /dev/null and b/images/erpnext1.png differ diff --git a/js/all-app.js b/js/all-app.js index 071cdf3230..2526a05313 100644 --- a/js/all-app.js +++ b/js/all-app.js @@ -516,7 +516,7 @@ me.list.run();});this.dialog.show();},add_column:function(c){var 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('
    \ @@ -2219,8 +2220,7 @@ $(favicon).appendTo('head');}}) * js/app.js */ wn.provide('erpnext');erpnext.set_about=function(){wn.provide('wn.app');$.extend(wn.app,{name:'ERPNext',license:'GNU/GPL - Usage Condition: All "erpnext" branding must be kept as it is',source:'https://github.com/webnotes/erpnext',publisher:'Web Notes Technologies Pvt Ltd, Mumbai',copyright:'© Web Notes Technologies Pvt Ltd',version:'2'});} -wn.modules_path='erpnext';$(document).bind('toolbar_setup',function(){$('.brand').html('erpnext\ - ').hover(function(){$(this).find('.icon-home').addClass('navbar-icon-home-hover');},function(){$(this).find('.icon-home').removeClass('navbar-icon-home-hover');});}); +wn.modules_path='erpnext';$(document).bind('toolbar_setup',function(){$('.brand').html((wn.boot.website_settings.brand_html||'erpnext')+' ').css('max-width','200px').css('overflow','hidden').hover(function(){$(this).find('.icon-home').addClass('navbar-icon-home-hover');},function(){$(this).find('.icon-home').removeClass('navbar-icon-home-hover');});}); /* * erpnext/startup/startup.js */ @@ -2230,14 +2230,14 @@ erpnext.startup.start=function(){console.log('Starting up...');$('#startup_div') 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 \ (and remove this annoying banner). \
    ',{expiry_string:expiry_string}));}else if(diff<0){$('header').append(repl('
    \ - This ERPNext subscription has expired and should be deleted. \ + This ERPNext subscription has expired. \
    ',{expiry_string:expiry_string}));}}} erpnext.set_about();$('#startup_div').toggle(false);} show_chart_browser=function(nm,chart_type){var call_back=function(){if(nm=='Sales Browser'){var sb_obj=new SalesBrowser();sb_obj.set_val(chart_type);} diff --git a/js/all-web.js b/js/all-web.js index 253ae70ba9..a91934bfa1 100644 --- a/js/all-web.js +++ b/js/all-web.js @@ -403,7 +403,7 @@ me.list.run();});this.dialog.show();},add_column:function(c){var 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('
    \ @@ -830,8 +831,7 @@ $(favicon).appendTo('head');}}) * js/app.js */ wn.provide('erpnext');erpnext.set_about=function(){wn.provide('wn.app');$.extend(wn.app,{name:'ERPNext',license:'GNU/GPL - Usage Condition: All "erpnext" branding must be kept as it is',source:'https://github.com/webnotes/erpnext',publisher:'Web Notes Technologies Pvt Ltd, Mumbai',copyright:'© Web Notes Technologies Pvt Ltd',version:'2'});} -wn.modules_path='erpnext';$(document).bind('toolbar_setup',function(){$('.brand').html('erpnext\ - ').hover(function(){$(this).find('.icon-home').addClass('navbar-icon-home-hover');},function(){$(this).find('.icon-home').removeClass('navbar-icon-home-hover');});}); +wn.modules_path='erpnext';$(document).bind('toolbar_setup',function(){$('.brand').html((wn.boot.website_settings.brand_html||'erpnext')+' ').css('max-width','200px').css('overflow','hidden').hover(function(){$(this).find('.icon-home').addClass('navbar-icon-home-hover');},function(){$(this).find('.icon-home').removeClass('navbar-icon-home-hover');});}); /* * erpnext/startup/startup.js */ @@ -841,14 +841,14 @@ erpnext.startup.start=function(){console.log('Starting up...');$('#startup_div') 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 \ (and remove this annoying banner). \
    ',{expiry_string:expiry_string}));}else if(diff<0){$('header').append(repl('
    \ - This ERPNext subscription has expired and should be deleted. \ + This ERPNext subscription has expired. \
    ',{expiry_string:expiry_string}));}}} erpnext.set_about();$('#startup_div').toggle(false);} show_chart_browser=function(nm,chart_type){var call_back=function(){if(nm=='Sales Browser'){var sb_obj=new SalesBrowser();sb_obj.set_val(chart_type);} @@ -869,7 +869,7 @@ erpnext.hide_naming_series=function(){if(cur_frm.fields_dict.naming_series){hide /* * erpnext/website/js/topbar.js */ -wn.provide('erpnext.navbar');erpnext.navbar.Navbar=Class.extend({init:function(){this.make();$('.brand').html(wn.boot.website_settings.brand_html);this.make_items();$('.dropdown-toggle').dropdown();},make:function(){$('header').append('');$('.brand').attr('href','#!'+(wn.boot.website_settings.home_page||'Login Page'))},make_items:function(){var items=wn.boot.website_menus;for(var i=0;i\ + %(label)s',item));}} for(var i=0;i').click(function(){return false;});$parent_li.append('');} -item.route=item.url||item.custom_page;$parent_li.find('.dropdown-menu').append(repl('
  • \ - %(label)s
  • ',item))}}}});erpnext.Footer=Class.extend({init:function(){$('footer').html(repl('