fixed conflict using theirs
This commit is contained in:
commit
5af62d0857
@ -0,0 +1,5 @@
|
||||
<div class="layout-wrapper layout-wrapper-appframe">
|
||||
<div class="layout-appframe"></div>
|
||||
<div class="layout-main">
|
||||
</div>
|
||||
</div>
|
@ -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;
|
||||
|
@ -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']
|
||||
|
||||
|
@ -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',
|
||||
|
@ -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)
|
||||
|
@ -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('<div class="web-footer erpnext-footer">\
|
||||
// <a href="#!attributions">ERPNext | Attributions and License</a></div>');
|
||||
$('footer').html('<div class="web-footer erpnext-footer">\
|
||||
<a href="#!attributions">ERPNext | Attributions and License</a></div>');
|
||||
|
||||
// complete registration
|
||||
if(in_list(user_roles,'System Manager') && (wn.boot.setup_complete=='No')) {
|
||||
@ -106,7 +102,7 @@ erpnext.startup.start = function() {
|
||||
</div>', { expiry_string: expiry_string }));
|
||||
} else if (diff < 0) {
|
||||
$('header').append(repl('<div class="expiry-info"> \
|
||||
This ERPNext subscription <b>has expired</b> and should be deleted. \
|
||||
This ERPNext subscription <b>has expired</b>. \
|
||||
</div>', { expiry_string: expiry_string }));
|
||||
}
|
||||
}
|
||||
|
@ -64,7 +64,8 @@ $.extend(wn.pages.users, {
|
||||
}
|
||||
});
|
||||
if(!$('.subscription-info').length && (wn.boot.max_users || wn.boot.expires_on)) {
|
||||
var $sub_info = $('<div class="subscription-info-box"><div>').insertAfter('.help');
|
||||
var $sub_info = $('<div class="subscription-info-box"><div>')
|
||||
.insertAfter($(wn.pages.users).find('.help'));
|
||||
if(wn.boot.max_users) {
|
||||
$sub_info.append(repl('\
|
||||
<span class="subscription-info"> \
|
||||
|
@ -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! <br />\
|
||||
You already have <b>%(active_users)s</b> active users, \
|
||||
|
@ -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;
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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<items.length;i++) {
|
||||
var item = items[i];
|
||||
if(!item.parent_label && item.parentfield=='top_bar_items') {
|
||||
item.route = item.url || item.custom_page;
|
||||
console.log(item)
|
||||
erpnext.header_link_settings(item);
|
||||
|
||||
$('header .nav:first').append(repl('<li data-label="%(label)s">\
|
||||
<a href="#!%(route)s">%(label)s</a></li>', item))
|
||||
<a href="%(route)s" %(target)s>%(label)s</a></li>', item));
|
||||
}
|
||||
}
|
||||
|
||||
@ -77,21 +79,26 @@ erpnext.navbar.Navbar = Class.extend({
|
||||
});
|
||||
$parent_li.append('<ul class="dropdown-menu"></ul>');
|
||||
}
|
||||
item.route = item.url || item.custom_page;
|
||||
erpnext.header_link_settings(item);
|
||||
$parent_li.find('.dropdown-menu').append(repl('<li data-label="%(label)s">\
|
||||
<a href="#!%(route)s">%(label)s</a></li>', item))
|
||||
<a href="%(route)s" %(target)s>%(label)s</a></li>', 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('<div class="web-footer">\
|
||||
<div class="web-footer-menu"><ul></ul></div>\
|
||||
<div class="web-footer-copyright">© %(copyright)s | %(address)s</div>\
|
||||
<div class="web-footer-copyright">© %(copyright)s</div>\
|
||||
<div class="web-footer-powered">Powered by \
|
||||
<a href="https://erpnext.com">erpnext.com</a></div>\
|
||||
</div>', wn.boot.website_settings));
|
||||
@ -102,14 +109,25 @@ erpnext.Footer = Class.extend({
|
||||
for(var i=0;i<items.length;i++) {
|
||||
var item = items[i];
|
||||
if(!item.parent_label && item.parentfield=='footer_items') {
|
||||
item.route = item.url || item.custom_page;
|
||||
$('.web-footer-menu ul').append(repl('<li><a href="#!%(route)s" \
|
||||
erpnext.header_link_settings(item);
|
||||
$('.web-footer-menu ul').append(repl('<li><a href="%(route)s" %(target)s\
|
||||
data-label="%(label)s">%(label)s</a></li>', 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();
|
||||
|
@ -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) {
|
||||
|
BIN
images/erpnext1.png
Normal file
BIN
images/erpnext1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 429 B |
@ -516,7 +516,7 @@ me.list.run();});this.dialog.show();},add_column:function(c){var w=$('<div style
|
||||
*/
|
||||
wn.provide('wn.request');wn.request.url='index.cgi';wn.request.prepare=function(opts){if(opts.btn)$(opts.btn).set_working();if(opts.show_spinner)set_loading();if(opts.freeze)freeze();if(!opts.args.cmd){console.log(opts)
|
||||
throw"Incomplete Request";}}
|
||||
wn.request.cleanup=function(opts,r){if(opts.btn)$(opts.btn).done_working();if(opts.show_spinner)hide_loading();if(opts.freeze)unfreeze();if(wn.boot.sid&&wn.get_cookie('sid')!=wn.boot.sid){msgprint('Session expired');setTimeout('wn.app.redirect_to_login()',3000);return;}
|
||||
wn.request.cleanup=function(opts,r){if(opts.btn)$(opts.btn).done_working();if(opts.show_spinner)hide_loading();if(opts.freeze)unfreeze();if(wn.boot.sid&&wn.get_cookie('sid')!=wn.boot.sid){msgprint('Session Expired. Logging you out');wn.app.logout();return;}
|
||||
if(r.server_messages)msgprint(r.server_messages)
|
||||
if(r.exc){console.log(r.exc);};if(r['403']){wn.container.change_to('403');}
|
||||
if(r.docs)LocalDB.sync(r.docs);}
|
||||
@ -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=$('<div></div>').appendTo(parent);this.$titlebar=$('<div class="appframe-titlebar">\
|
||||
wn.ui.AppFrame=Class.extend({init:function(parent,title){this.buttons={};this.$w=$('<div></div>').appendTo(parent);this.$titlebar=$('<div class="appframe-titlebar">\
|
||||
<span class="appframe-title"></span>\
|
||||
<span class="close">×</span>\
|
||||
</div>').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)
|
||||
</div>').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('<div class="appframe-toolbar"></div>');args={label:label,icon:''};if(icon){args.icon='<i class="'+icon+'"></i>';}
|
||||
this.buttons[label]=$(repl('<button class="btn btn-small">\
|
||||
%(icon)s %(label)s</button>',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('<div class="layout-wrapper layout-wrapper-appframe">\
|
||||
@ -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('<b>erp</b>next\
|
||||
<i class="icon-home icon-white navbar-icon-home" ></i>').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')+' <i class="icon-home icon-white navbar-icon-home" ></i>').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('<div class="web-footer erpnext-footer">\
|
||||
<a href="#!attributions">ERPNext | Attributions and License</a></div>');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('<div class="expiry-info"> \
|
||||
Your ERPNext subscription will <b>expire %(expiry_string)s</b>. \
|
||||
Please renew your subscription to continue using ERPNext \
|
||||
(and remove this annoying banner). \
|
||||
</div>',{expiry_string:expiry_string}));}else if(diff<0){$('header').append(repl('<div class="expiry-info"> \
|
||||
This ERPNext subscription <b>has expired</b> and should be deleted. \
|
||||
This ERPNext subscription <b>has expired</b>. \
|
||||
</div>',{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);}
|
||||
|
@ -403,7 +403,7 @@ me.list.run();});this.dialog.show();},add_column:function(c){var w=$('<div style
|
||||
*/
|
||||
wn.provide('wn.request');wn.request.url='index.cgi';wn.request.prepare=function(opts){if(opts.btn)$(opts.btn).set_working();if(opts.show_spinner)set_loading();if(opts.freeze)freeze();if(!opts.args.cmd){console.log(opts)
|
||||
throw"Incomplete Request";}}
|
||||
wn.request.cleanup=function(opts,r){if(opts.btn)$(opts.btn).done_working();if(opts.show_spinner)hide_loading();if(opts.freeze)unfreeze();if(wn.boot.sid&&wn.get_cookie('sid')!=wn.boot.sid){msgprint('Session expired');setTimeout('wn.app.redirect_to_login()',3000);return;}
|
||||
wn.request.cleanup=function(opts,r){if(opts.btn)$(opts.btn).done_working();if(opts.show_spinner)hide_loading();if(opts.freeze)unfreeze();if(wn.boot.sid&&wn.get_cookie('sid')!=wn.boot.sid){msgprint('Session Expired. Logging you out');wn.app.logout();return;}
|
||||
if(r.server_messages)msgprint(r.server_messages)
|
||||
if(r.exc){console.log(r.exc);};if(r['403']){wn.container.change_to('403');}
|
||||
if(r.docs)LocalDB.sync(r.docs);}
|
||||
@ -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=$('<div></div>').appendTo(parent);this.$titlebar=$('<div class="appframe-titlebar">\
|
||||
wn.ui.AppFrame=Class.extend({init:function(parent,title){this.buttons={};this.$w=$('<div></div>').appendTo(parent);this.$titlebar=$('<div class="appframe-titlebar">\
|
||||
<span class="appframe-title"></span>\
|
||||
<span class="close">×</span>\
|
||||
</div>').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)
|
||||
</div>').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('<div class="appframe-toolbar"></div>');args={label:label,icon:''};if(icon){args.icon='<i class="'+icon+'"></i>';}
|
||||
this.buttons[label]=$(repl('<button class="btn btn-small">\
|
||||
%(icon)s %(label)s</button>',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('<div class="layout-wrapper layout-wrapper-appframe">\
|
||||
@ -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('<b>erp</b>next\
|
||||
<i class="icon-home icon-white navbar-icon-home" ></i>').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')+' <i class="icon-home icon-white navbar-icon-home" ></i>').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('<div class="web-footer erpnext-footer">\
|
||||
<a href="#!attributions">ERPNext | Attributions and License</a></div>');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('<div class="expiry-info"> \
|
||||
Your ERPNext subscription will <b>expire %(expiry_string)s</b>. \
|
||||
Please renew your subscription to continue using ERPNext \
|
||||
(and remove this annoying banner). \
|
||||
</div>',{expiry_string:expiry_string}));}else if(diff<0){$('header').append(repl('<div class="expiry-info"> \
|
||||
This ERPNext subscription <b>has expired</b> and should be deleted. \
|
||||
This ERPNext subscription <b>has expired</b>. \
|
||||
</div>',{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('<div class="navbar navbar-fixed-top">\
|
||||
wn.provide('erpnext.navbar');erpnext.navbar.Navbar=Class.extend({init:function(){this.make();$('.brand').html(wn.boot.website_settings.brand_html||sys_defaults.company);this.make_items();$('.dropdown-toggle').dropdown();},make:function(){$('header').append('<div class="navbar navbar-fixed-top">\
|
||||
<div class="navbar-inner">\
|
||||
<div class="container">\
|
||||
<a class="brand">[brand]</a>\
|
||||
@ -881,15 +881,19 @@ wn.provide('erpnext.navbar');erpnext.navbar.Navbar=Class.extend({init:function()
|
||||
</ul>\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>');$('.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<items.length;i++){var item=items[i];if(!item.parent_label&&item.parentfield=='top_bar_items'){item.route=item.url||item.custom_page;$('header .nav:first').append(repl('<li data-label="%(label)s">\
|
||||
<a href="#!%(route)s">%(label)s</a></li>',item))}}
|
||||
</div>');$('.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<items.length;i++){var item=items[i];if(!item.parent_label&&item.parentfield=='top_bar_items'){console.log(item)
|
||||
erpnext.header_link_settings(item);$('header .nav:first').append(repl('<li data-label="%(label)s">\
|
||||
<a href="%(route)s" %(target)s>%(label)s</a></li>',item));}}
|
||||
for(var i=0;i<items.length;i++){var item=items[i];if(item.parent_label&&item.parentfield=='top_bar_items'){$parent_li=$(repl('header li[data-label="%(parent_label)s"]',item));if(!$parent_li.hasClass('dropdown')){$parent_li.addClass('dropdown');$parent_li.find('a:first').addClass('dropdown-toggle').attr('data-toggle','dropdown').attr('href','').append('<b class="caret"></b>').click(function(){return false;});$parent_li.append('<ul class="dropdown-menu"></ul>');}
|
||||
item.route=item.url||item.custom_page;$parent_li.find('.dropdown-menu').append(repl('<li data-label="%(label)s">\
|
||||
<a href="#!%(route)s">%(label)s</a></li>',item))}}}});erpnext.Footer=Class.extend({init:function(){$('footer').html(repl('<div class="web-footer">\
|
||||
erpnext.header_link_settings(item);$parent_li.find('.dropdown-menu').append(repl('<li data-label="%(label)s">\
|
||||
<a href="%(route)s" %(target)s>%(label)s</a></li>',item))}}}});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('<div class="web-footer">\
|
||||
<div class="web-footer-menu"><ul></ul></div>\
|
||||
<div class="web-footer-copyright">© %(copyright)s | %(address)s</div>\
|
||||
<div class="web-footer-copyright">© %(copyright)s</div>\
|
||||
<div class="web-footer-powered">Powered by \
|
||||
<a href="https://erpnext.com">erpnext.com</a></div>\
|
||||
</div>',wn.boot.website_settings));this.make_items();},make_items:function(){var items=wn.boot.website_menus
|
||||
for(var i=0;i<items.length;i++){var item=items[i];if(!item.parent_label&&item.parentfield=='footer_items'){item.route=item.url||item.custom_page;$('.web-footer-menu ul').append(repl('<li><a href="#!%(route)s" \
|
||||
data-label="%(label)s">%(label)s</a></li>',item))}}}});$(document).bind('startup',function(){erpnext.footer=new erpnext.Footer();erpnext.navbar.navbar=new erpnext.navbar.Navbar();})
|
||||
for(var i=0;i<items.length;i++){var item=items[i];if(!item.parent_label&&item.parentfield=='footer_items'){erpnext.header_link_settings(item);$('.web-footer-menu ul').append(repl('<li><a href="%(route)s" %(target)s\
|
||||
data-label="%(label)s">%(label)s</a></li>',item))}}}});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();})
|
@ -14,8 +14,9 @@ erpnext.set_about = function() {
|
||||
wn.modules_path = 'erpnext';
|
||||
|
||||
$(document).bind('toolbar_setup', function() {
|
||||
$('.brand').html('<b>erp</b>next\
|
||||
<i class="icon-home icon-white navbar-icon-home" ></i>')
|
||||
$('.brand').html((wn.boot.website_settings.brand_html || 'erpnext') +
|
||||
' <i class="icon-home icon-white navbar-icon-home" ></i>')
|
||||
.css('max-width', '200px').css('overflow', 'hidden')
|
||||
.hover(function() {
|
||||
$(this).find('.icon-home').addClass('navbar-icon-home-hover');
|
||||
}, function() {
|
||||
|
Loading…
Reference in New Issue
Block a user