login, analytics fix

This commit is contained in:
Rushabh Mehta 2012-02-14 17:25:31 +05:30
parent ec6f9fedd6
commit eec8e92604
8 changed files with 73 additions and 34 deletions

View File

@ -1,6 +1,6 @@
pscript.onload_dashboard = function() {
// load jqplot
wn.require('lib/css/jqpot.css');
wn.require('lib/css/jqplot.css');
wn.require('lib/js/legacy/jquery/jquery.jqplot.min.js');
wn.require('lib/js/legacy/jquery/jqplot-plugins/jqplot.barRenderer.js');
wn.require('lib/js/legacy/jquery/jqplot-plugins/jqplot.canvasAxisTickRenderer.min.js');

View File

@ -0,0 +1,5 @@
def execute():
from webnotes.modules import reload_doc
reload_doc('website', 'doctype', 'website_settings')
reload_doc('website', 'doctype', 'product_settings')

View File

@ -56,6 +56,10 @@ def boot_session(bootinfo):
parent_label, parentfield
from `tabTop Bar Item` where parent='Website Settings' order by idx asc""", as_dict=1)
bootinfo['custom_css'] = webnotes.conn.get_value('Style Settings', None, 'custom_css') or ''
bootinfo['analytics_code'] = \
webnotes.conn.get_value('Website Settings', None, 'analytics_code')
bootinfo['analytics_call'] = \
webnotes.conn.get_value('Website Settings', None, 'analytics_call')
else:
bootinfo['letter_heads'] = get_letter_heads()

View File

@ -5,68 +5,68 @@
{
'creation': '2012-01-30 12:15:00',
'docstatus': 0,
'modified': '2012-01-30 13:50:53',
'modified_by': 'Administrator',
'owner': 'Administrator'
'modified': '2012-02-14 14:29:41',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
# These values are common for all DocType
{
'_last_update': '1327906116',
'colour': 'White:FFF',
'description': 'Products are automatically updated from the item master. To add products to the website, go to the <a href="#!List/Item">Item master</a> and check "Show in Website" in the "Website Details"\n\n',
'_last_update': u'1327911653',
'colour': u'White:FFF',
'description': u'\n\n',
'doctype': 'DocType',
'issingle': 1,
'module': 'Website',
'module': u'Website',
'name': '__common__',
'section_style': 'Simple',
'section_style': u'Simple',
'show_in_menu': 0,
'version': 3
'version': 4
},
# These values are common for all DocField
{
'colour': 'White:FFF',
'description': 'Product Groups that are listed on the website. The first product group from this list will be listed by default on the "Products Page"',
'doctype': 'DocField',
'fieldname': 'groups',
'fieldtype': 'Table',
'label': 'Groups',
'colour': u'White:FFF',
'description': u'Product Groups that are listed on the website. The first product group from this list will be listed by default on the "Products Page"',
'doctype': u'DocField',
'fieldname': u'groups',
'fieldtype': u'Table',
'label': u'Groups',
'name': '__common__',
'options': 'Product Group',
'parent': 'Products Settings',
'parentfield': 'fields',
'parenttype': 'DocType',
'options': u'Product Group',
'parent': u'Products Settings',
'parentfield': u'fields',
'parenttype': u'DocType',
'permlevel': 0
},
# These values are common for all DocPerm
{
'create': 1,
'doctype': 'DocPerm',
'doctype': u'DocPerm',
'name': '__common__',
'parent': 'Products Settings',
'parentfield': 'permissions',
'parenttype': 'DocType',
'parent': u'Products Settings',
'parentfield': u'permissions',
'parenttype': u'DocType',
'permlevel': 0,
'read': 1,
'role': 'Website Manager',
'role': u'Website Manager',
'write': 1
},
# DocType, Products Settings
{
'doctype': 'DocType',
'name': 'Products Settings'
'name': u'Products Settings'
},
# DocPerm
{
'doctype': 'DocPerm'
'doctype': u'DocPerm'
},
# DocField
{
'doctype': 'DocField'
'doctype': u'DocField'
}
]

View File

@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
'creation': '2012-02-02 13:51:29',
'creation': '2012-02-02 13:19:50',
'docstatus': 0,
'modified': '2012-02-13 12:23:36',
'modified': '2012-02-14 16:13:59',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
@ -23,7 +23,7 @@
'name': '__common__',
'section_style': u'Simple',
'show_in_menu': 0,
'version': 8
'version': 9
},
# These values are common for all DocField
@ -205,5 +205,35 @@
'label': u'Domain List',
'permlevel': 0,
'reqd': 0
},
# DocField
{
'doctype': u'DocField',
'fieldtype': u'Section Break',
'label': u'Analytics',
'permlevel': 0
},
# DocField
{
'colour': u'White:FFF',
'description': u'Code pasted in the head tag to start an Analytics engine like Google Analytics',
'doctype': u'DocField',
'fieldname': u'analytics_code',
'fieldtype': u'Text',
'label': u'Analytics Code',
'permlevel': 0
},
# DocField
{
'colour': u'White:FFF',
'description': u"Function to be called when page is changed. (_gaq.push['_trackPageview'] for Google Code)",
'doctype': u'DocField',
'fieldname': u'analytics_call',
'fieldtype': u'Text',
'label': u'Analytics Call',
'permlevel': 0
}
]

View File

@ -1027,7 +1027,7 @@ if(!(nav_obj.ol[i][0]==t&&nav_obj.ol[i][1]==dt&&nav_obj.ol[i][2]==dn))tmp.push(n
en_t=encodeURIComponent(t);en_dt=encodeURIComponent(dt);en_dn=dn?encodeURIComponent(dn):'';if(en_t=='Page'){var id=en_dt+(dn?('/'+en_dn):'')}else{var id=en_t+'/'+en_dt+(dn?('/'+en_dn):'')}
if(nav_obj.on_open)
nav_obj.on_open(id);if(window.location.hash!='!'+id){window.location.hash='!'+id;}}
nav_obj.notify_observers(t,dt,dn);}
nav_obj.notify_observers(t,dt,dn);if(wn.boot.analytics_code){try{eval(wn.boot.analytics_code);}catch(e){console.log(e);}}}
nav_obj.notify_observers=function(t,dt,dn){for(var i=0;i<nav_obj.observers.length;i++){var o=nav_obj.observers[i];if(o&&o.notify)o.notify(t,dt,dn);}}
nav_obj.rename_notify=function(dt,oldn,newn){for(var i=0;i<nav_obj.ol.length;i++){var o=nav_obj.ol[i];if(o[1]==dt&&o[2]==oldn)o[2]=newn;}}
nav_obj.show_last_open=function(){var l=nav_obj.ol[nav_obj.ol.length-2];delete nav_obj.ol[nav_obj.ol.length-1];if(!l)loadpage('_home');else if(l[0]=='Page'){loadpage(l[1]);}else if(l[0]=='Report'){loadreport(l[1],l[2]);}else if(l[0]=='Form'){loaddoc(l[1],l[2]);}else if(l[0]=='DocBrowser'||l[0]=='List'){loaddocbrowser(l[1]);}}

View File

@ -750,7 +750,7 @@ if(!(nav_obj.ol[i][0]==t&&nav_obj.ol[i][1]==dt&&nav_obj.ol[i][2]==dn))tmp.push(n
en_t=encodeURIComponent(t);en_dt=encodeURIComponent(dt);en_dn=dn?encodeURIComponent(dn):'';if(en_t=='Page'){var id=en_dt+(dn?('/'+en_dn):'')}else{var id=en_t+'/'+en_dt+(dn?('/'+en_dn):'')}
if(nav_obj.on_open)
nav_obj.on_open(id);if(window.location.hash!='!'+id){window.location.hash='!'+id;}}
nav_obj.notify_observers(t,dt,dn);}
nav_obj.notify_observers(t,dt,dn);if(wn.boot.analytics_code){try{eval(wn.boot.analytics_code);}catch(e){console.log(e);}}}
nav_obj.notify_observers=function(t,dt,dn){for(var i=0;i<nav_obj.observers.length;i++){var o=nav_obj.observers[i];if(o&&o.notify)o.notify(t,dt,dn);}}
nav_obj.rename_notify=function(dt,oldn,newn){for(var i=0;i<nav_obj.ol.length;i++){var o=nav_obj.ol[i];if(o[1]==dt&&o[2]==oldn)o[2]=newn;}}
nav_obj.show_last_open=function(){var l=nav_obj.ol[nav_obj.ol.length-2];delete nav_obj.ol[nav_obj.ol.length-1];if(!l)loadpage('_home');else if(l[0]=='Page'){loadpage(l[1]);}else if(l[0]=='Report'){loadreport(l[1],l[2]);}else if(l[0]=='Form'){loaddoc(l[1],l[2]);}else if(l[0]=='DocBrowser'||l[0]=='List'){loaddocbrowser(l[1]);}}

View File

@ -1 +1 @@
422
423