blob: c50f1ed14bf12bae90bed04b0b98f1acf13d7fce [file] [log] [blame]
Rushabh Mehta3966f1d2012-02-23 12:35:32 +05301// ERPNext - web based ERP (http://erpnext.com)
2// Copyright (C) 2012 Web Notes Technologies Pvt Ltd
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program. If not, see <http://www.gnu.org/licenses/>.
16
Rushabh Mehta8c309be2012-01-20 13:47:16 +053017/* toolbar settings */
18wn.provide('erpnext.toolbar');
19
20erpnext.toolbar.setup = function() {
21 // profile
Rushabh Mehtacc32b652013-04-19 13:01:32 +053022 var $user = $('#toolbar-user');
Anand Doshiaf1df682013-07-26 15:11:55 +053023 $user.append('<li><a href="#Form/Profile/'+user+'"><i class="icon-fixed-width icon-user"></i> '
Rushabh Mehta523aec42013-01-07 15:39:54 +053024 +wn._("My Settings")+'...</a></li>');
Rushabh Mehtacc32b652013-04-19 13:01:32 +053025 $user.append('<li class="divider"></li>');
Anand Doshiaf1df682013-07-26 15:11:55 +053026 $user.append('<li><a href="https://erpnext.com/manual" target="_blank">\
27 <i class="icon-fixed-width icon-file"></i> '+wn._('Documentation')+'</a></li>')
28 $user.append('<li><a href="http://groups.google.com/group/erpnext-user-forum" target="_blank">\
29 <i class="icon-fixed-width icon-quote-left"></i> '+wn._('Forum')+'</a></li>')
Rushabh Mehtacc32b652013-04-19 13:01:32 +053030 $user.append('<li><a href="http://www.providesupport.com?messenger=iwebnotes" target="_blank">\
Anand Doshiaf1df682013-07-26 15:11:55 +053031 <i class="icon-fixed-width icon-comments"></i> '+wn._('Live Chat')+'</a></li>')
Rushabh Mehtacc32b652013-04-19 13:01:32 +053032
Anand Doshi2aa9ba62012-04-30 15:43:34 +053033 erpnext.toolbar.set_new_comments();
Rushabh Mehta3ed351d2013-07-09 14:36:41 +053034
Anand Doshiaf1df682013-07-26 15:11:55 +053035 $("#toolbar-tools").append('<li><a href="#latest-updates">\
36 <i class="icon-fixed-width icon-rss"></i> Latest Updates</li>');
Anand Doshic3023be2012-02-20 16:31:55 +053037}
38
Anand Doshi2aa9ba62012-04-30 15:43:34 +053039erpnext.toolbar.set_new_comments = function(new_comments) {
Rushabh Mehta4736c352013-06-18 15:46:32 +053040 return;
Anand Doshi2aa9ba62012-04-30 15:43:34 +053041 var navbar_nc = $('.navbar-new-comments');
Rushabh Mehta9d0569a2012-11-13 11:42:42 +053042 if(cint(new_comments)) {
Anand Doshi2aa9ba62012-04-30 15:43:34 +053043 navbar_nc.addClass('navbar-new-comments-true')
Rushabh Mehta9d0569a2012-11-13 11:42:42 +053044 navbar_nc.text(new_comments);
Anand Doshi2aa9ba62012-04-30 15:43:34 +053045 } else {
46 navbar_nc.removeClass('navbar-new-comments-true');
47 navbar_nc.text(0);
48 }
Rushabh Mehta523aec42013-01-07 15:39:54 +053049}