blob: 1d3d1e7682f47e15b5ca5b65ada40a4a97d492f2 [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');
23 $user.append('<li><a href="#Form/Profile/'+user+'">'
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>');
26 $user.append('<li><a href="https://erpnext.com/manual" target="_blank">'
27 +wn._('Documentation')+'</a></li>')
28 $user.append('<li><a href="http://groups.google.com/group/erpnext-user-forum" target="_blank">'
29 +wn._('Forum')+'</a></li>')
30 $user.append('<li><a href="http://www.providesupport.com?messenger=iwebnotes" target="_blank">\
31 '+wn._('Live Chat')+'</a></li>')
32
Rushabh Mehtad0251332012-02-21 17:26:50 +053033
Anand Doshi5b1beeb2012-02-27 17:17:48 +053034 $('.navbar .pull-right').append('\
Rushabh Mehta523aec42013-01-07 15:39:54 +053035 <li><a href="#!messages" title="'+wn._('Unread Messages')
36 +'"><span class="navbar-new-comments"></span></a></li>');
Rushabh Mehta8c309be2012-01-20 13:47:16 +053037
Anand Doshi2aa9ba62012-04-30 15:43:34 +053038 erpnext.toolbar.set_new_comments();
Anand Doshic3023be2012-02-20 16:31:55 +053039}
40
Anand Doshi2aa9ba62012-04-30 15:43:34 +053041erpnext.toolbar.set_new_comments = function(new_comments) {
42 var navbar_nc = $('.navbar-new-comments');
Rushabh Mehta9d0569a2012-11-13 11:42:42 +053043 if(cint(new_comments)) {
Anand Doshi2aa9ba62012-04-30 15:43:34 +053044 navbar_nc.addClass('navbar-new-comments-true')
Rushabh Mehta9d0569a2012-11-13 11:42:42 +053045 navbar_nc.text(new_comments);
Anand Doshi2aa9ba62012-04-30 15:43:34 +053046 } else {
47 navbar_nc.removeClass('navbar-new-comments-true');
48 navbar_nc.text(0);
49 }
Rushabh Mehta523aec42013-01-07 15:39:54 +053050}