Rushabh Mehta | e67d1fb | 2013-08-05 14:59:54 +0530 | [diff] [blame] | 1 | // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. |
| 2 | // License: GNU General Public License v3. See license.txt |
Rushabh Mehta | 3966f1d | 2012-02-23 12:35:32 +0530 | [diff] [blame] | 3 | |
Rushabh Mehta | 8c309be | 2012-01-20 13:47:16 +0530 | [diff] [blame] | 4 | /* toolbar settings */ |
| 5 | wn.provide('erpnext.toolbar'); |
| 6 | |
| 7 | erpnext.toolbar.setup = function() { |
| 8 | // profile |
Rushabh Mehta | cc32b65 | 2013-04-19 13:01:32 +0530 | [diff] [blame] | 9 | var $user = $('#toolbar-user'); |
Anand Doshi | af1df68 | 2013-07-26 15:11:55 +0530 | [diff] [blame] | 10 | $user.append('<li><a href="#Form/Profile/'+user+'"><i class="icon-fixed-width icon-user"></i> ' |
Rushabh Mehta | 523aec4 | 2013-01-07 15:39:54 +0530 | [diff] [blame] | 11 | +wn._("My Settings")+'...</a></li>'); |
Rushabh Mehta | cc32b65 | 2013-04-19 13:01:32 +0530 | [diff] [blame] | 12 | $user.append('<li class="divider"></li>'); |
Anand Doshi | af1df68 | 2013-07-26 15:11:55 +0530 | [diff] [blame] | 13 | $user.append('<li><a href="https://erpnext.com/manual" target="_blank">\ |
Anand Doshi | 74458a9 | 2013-08-01 12:10:09 +0530 | [diff] [blame] | 14 | <i class="icon-fixed-width icon-file"></i> '+wn._('Documentation')+'</a></li>'); |
Anand Doshi | af1df68 | 2013-07-26 15:11:55 +0530 | [diff] [blame] | 15 | $user.append('<li><a href="http://groups.google.com/group/erpnext-user-forum" target="_blank">\ |
Anand Doshi | 74458a9 | 2013-08-01 12:10:09 +0530 | [diff] [blame] | 16 | <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 Mehta | cc32b65 | 2013-04-19 13:01:32 +0530 | [diff] [blame] | 22 | |
Anand Doshi | 2aa9ba6 | 2012-04-30 15:43:34 +0530 | [diff] [blame] | 23 | erpnext.toolbar.set_new_comments(); |
Rushabh Mehta | 3ed351d | 2013-07-09 14:36:41 +0530 | [diff] [blame] | 24 | |
Anand Doshi | af1df68 | 2013-07-26 15:11:55 +0530 | [diff] [blame] | 25 | $("#toolbar-tools").append('<li><a href="#latest-updates">\ |
| 26 | <i class="icon-fixed-width icon-rss"></i> Latest Updates</li>'); |
Anand Doshi | c3023be | 2012-02-20 16:31:55 +0530 | [diff] [blame] | 27 | } |
| 28 | |
Anand Doshi | 2aa9ba6 | 2012-04-30 15:43:34 +0530 | [diff] [blame] | 29 | erpnext.toolbar.set_new_comments = function(new_comments) { |
Rushabh Mehta | 4736c35 | 2013-06-18 15:46:32 +0530 | [diff] [blame] | 30 | return; |
Anand Doshi | 2aa9ba6 | 2012-04-30 15:43:34 +0530 | [diff] [blame] | 31 | var navbar_nc = $('.navbar-new-comments'); |
Rushabh Mehta | 9d0569a | 2012-11-13 11:42:42 +0530 | [diff] [blame] | 32 | if(cint(new_comments)) { |
Anand Doshi | 2aa9ba6 | 2012-04-30 15:43:34 +0530 | [diff] [blame] | 33 | navbar_nc.addClass('navbar-new-comments-true') |
Rushabh Mehta | 9d0569a | 2012-11-13 11:42:42 +0530 | [diff] [blame] | 34 | navbar_nc.text(new_comments); |
Anand Doshi | 2aa9ba6 | 2012-04-30 15:43:34 +0530 | [diff] [blame] | 35 | } else { |
| 36 | navbar_nc.removeClass('navbar-new-comments-true'); |
| 37 | navbar_nc.text(0); |
| 38 | } |
Rushabh Mehta | 523aec4 | 2013-01-07 15:39:54 +0530 | [diff] [blame] | 39 | } |