mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 11:49:10 +00:00
fixes to dashboard and setup wizard
This commit is contained in:
@@ -25,12 +25,7 @@ pscript.home_make_body = function() {
|
||||
|
||||
wrapper.banner_area = $a(wrapper.head, 'div');
|
||||
|
||||
wrapper.setup_wizard_area = $a(wrapper.body, 'div', 'setup-wizard')
|
||||
|
||||
wrapper.system_message_area = $a(wrapper.body, 'div', '',
|
||||
{marginBottom:'16px', padding:'8px', backgroundColor:'#FFD', border:'1px dashed #AA6', display:'none'})
|
||||
|
||||
|
||||
wrapper.setup_wizard_area = $a(wrapper.body, 'div', 'setup-wizard');
|
||||
}
|
||||
|
||||
// ==================================
|
||||
@@ -613,11 +608,7 @@ pscript.home_make_status = function() {
|
||||
$c_page('home', 'event_updates', 'get_status_details', user,
|
||||
function(r,rt) {
|
||||
home_status_bar.render(r.message);
|
||||
|
||||
// system_messages
|
||||
if(r.message.system_message)
|
||||
pscript.show_system_message(wrapper, r.message.system_message);
|
||||
|
||||
|
||||
// render online users
|
||||
pscript.online_users_obj.render(r.message.online_users);
|
||||
pscript.online_users = r.message.online_users;
|
||||
@@ -630,24 +621,6 @@ pscript.home_make_status = function() {
|
||||
);
|
||||
}
|
||||
|
||||
// show system message
|
||||
// -------------------
|
||||
pscript.show_system_message = function(wrapper, msg) {
|
||||
$ds(wrapper.system_message_area);
|
||||
var txt = $a(wrapper.system_message_area, 'div', '', {lineHeight:'1.6em'});
|
||||
txt.innerHTML = msg;
|
||||
|
||||
var span = $ln($a(wrapper.system_message_area, 'div', '', {textAlign:'right'}), 'Dismiss'.bold(),
|
||||
function(me) {
|
||||
me.set_working();
|
||||
$c_obj('Home Control', 'dismiss_message', '', function(r,rt) {
|
||||
me.done_working();
|
||||
$(wrapper.system_message_area).slideUp();
|
||||
});
|
||||
}, {fontSize:'11px'}
|
||||
)
|
||||
}
|
||||
|
||||
// complete my company registration
|
||||
// --------------------------------
|
||||
pscript.complete_registration = function()
|
||||
|
||||
@@ -28,18 +28,11 @@ def get_status_details(arg=None):
|
||||
|
||||
online = get_online_users()
|
||||
|
||||
# system messages
|
||||
msg_id = webnotes.conn.get_global('system_message_id')
|
||||
msg = ''
|
||||
|
||||
if msg_id and msg_id != webnotes.conn.get_global('system_message_id', webnotes.session['user']):
|
||||
msg = webnotes.conn.get_global('system_message')
|
||||
|
||||
# system messages
|
||||
ret = {
|
||||
'user_count': len(online) or 0,
|
||||
'unread_messages': get_unread_messages(),
|
||||
'online_users': online or [],
|
||||
'system_message':msg,
|
||||
'is_trial': webnotes.conn.get_global('is_trial'),
|
||||
'days_to_expiry': (webnotes.conn.get_global('days_to_expiry') or '0'),
|
||||
'setup_status': get_setup_status()
|
||||
@@ -56,9 +49,20 @@ def get_setup_status():
|
||||
percent = 20
|
||||
ret = []
|
||||
|
||||
header = webnotes.conn.get_value('Control Panel', None, 'client_name') or ''
|
||||
if header.startswith('<div style="padding:4px; font-size:20px;">'\
|
||||
+webnotes.conn.get_value('Control Panel', None, 'company_name')):
|
||||
def is_header_set():
|
||||
header = webnotes.conn.get_value('Control Panel', None, 'client_name') or ''
|
||||
|
||||
if header.startswith('<div style="padding:4px; font-size:20px;">'\
|
||||
+webnotes.conn.get_value('Control Panel', None, 'company_name')):
|
||||
return False
|
||||
|
||||
elif 'Banner Comes Here' in header:
|
||||
return False
|
||||
|
||||
else:
|
||||
return True
|
||||
|
||||
if not is_header_set():
|
||||
ret.append('<a href="#!Form/Personalize/Personalize">Upload your company banner</a>')
|
||||
else:
|
||||
percent += 20
|
||||
|
||||
Reference in New Issue
Block a user