blob: d2ca512fa6f9260cdaf95c560e0609e32f82b3e8 [file] [log] [blame]
Rushabh Mehtae67d1fb2013-08-05 14:59:54 +05301// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
2// License: GNU General Public License v3. See license.txt
Rushabh Mehta3966f1d2012-02-23 12:35:32 +05303
Rushabh Mehta8c309be2012-01-20 13:47:16 +05304/* toolbar settings */
5wn.provide('erpnext.toolbar');
6
7erpnext.toolbar.setup = function() {
8 // profile
Rushabh Mehtacc32b652013-04-19 13:01:32 +05309 var $user = $('#toolbar-user');
Anand Doshiaf1df682013-07-26 15:11:55 +053010 $user.append('<li><a href="#Form/Profile/'+user+'"><i class="icon-fixed-width icon-user"></i> '
Rushabh Mehta523aec42013-01-07 15:39:54 +053011 +wn._("My Settings")+'...</a></li>');
Rushabh Mehtacc32b652013-04-19 13:01:32 +053012 $user.append('<li class="divider"></li>');
Anand Doshiaf1df682013-07-26 15:11:55 +053013 $user.append('<li><a href="https://erpnext.com/manual" target="_blank">\
Anand Doshi74458a92013-08-01 12:10:09 +053014 <i class="icon-fixed-width icon-file"></i> '+wn._('Documentation')+'</a></li>');
Anand Doshiaf1df682013-07-26 15:11:55 +053015 $user.append('<li><a href="http://groups.google.com/group/erpnext-user-forum" target="_blank">\
Anand Doshi74458a92013-08-01 12:10:09 +053016 <i class="icon-fixed-width icon-quote-left"></i> '+wn._('Forum')+'</a></li>');
17
18 if(wn.boot.expires_on) {
19 $user.append('<li><a href="http://www.providesupport.com?messenger=iwebnotes" target="_blank">\
20 <i class="icon-fixed-width icon-comments"></i> '+wn._('Live Chat')+'</a></li>');
21 }
Rushabh Mehtacc32b652013-04-19 13:01:32 +053022
Anand Doshi2aa9ba62012-04-30 15:43:34 +053023 erpnext.toolbar.set_new_comments();
Rushabh Mehta3ed351d2013-07-09 14:36:41 +053024
Anand Doshiaf1df682013-07-26 15:11:55 +053025 $("#toolbar-tools").append('<li><a href="#latest-updates">\
26 <i class="icon-fixed-width icon-rss"></i> Latest Updates</li>');
Anand Doshic3023be2012-02-20 16:31:55 +053027}
28
Anand Doshi2aa9ba62012-04-30 15:43:34 +053029erpnext.toolbar.set_new_comments = function(new_comments) {
Rushabh Mehta4736c352013-06-18 15:46:32 +053030 return;
Anand Doshi2aa9ba62012-04-30 15:43:34 +053031 var navbar_nc = $('.navbar-new-comments');
Rushabh Mehta9d0569a2012-11-13 11:42:42 +053032 if(cint(new_comments)) {
Anand Doshi2aa9ba62012-04-30 15:43:34 +053033 navbar_nc.addClass('navbar-new-comments-true')
Rushabh Mehta9d0569a2012-11-13 11:42:42 +053034 navbar_nc.text(new_comments);
Anand Doshi2aa9ba62012-04-30 15:43:34 +053035 } else {
36 navbar_nc.removeClass('navbar-new-comments-true');
37 navbar_nc.text(0);
38 }
Rushabh Mehta523aec42013-01-07 15:39:54 +053039}