2012-01-24 09:03:21 +00:00
|
|
|
wn.provide('erpnext.topbar');
|
|
|
|
wn.require('lib/css/bootstrap/bootstrap-topbar.css');
|
|
|
|
wn.require('lib/js/bootstrap/bootstrap-dropdown.js');
|
|
|
|
|
|
|
|
/*
|
|
|
|
<li class="dropdown">\
|
|
|
|
<a class="dropdown-toggle" href="#" onclick="return false;"></a>\
|
|
|
|
<ul class="dropdown-menu" id="toolbar-user">\
|
|
|
|
</ul>\
|
|
|
|
</li>\
|
|
|
|
*/
|
|
|
|
|
|
|
|
erpnext.topbar.TopBar = Class.extend({
|
|
|
|
init: function() {
|
|
|
|
this.make();
|
|
|
|
$('.brand').html(wn.boot.topbar.brand_html);
|
|
|
|
this.make_items();
|
|
|
|
},
|
|
|
|
make: function() {
|
|
|
|
$('header').append('<div class="topbar">\
|
|
|
|
<div class="topbar-inner">\
|
|
|
|
<div class="container">\
|
2012-01-27 12:30:14 +00:00
|
|
|
<a class="brand" href="#!home">[brand]</a>\
|
2012-01-24 09:03:21 +00:00
|
|
|
<ul class="nav">\
|
|
|
|
</ul>\
|
|
|
|
<img src="lib/images/ui/spinner.gif" id="spinner"/>\
|
|
|
|
<ul class="nav secondary-nav">\
|
|
|
|
<li><a href="#!Login Page">Login</a></li>\
|
|
|
|
</ul>\
|
|
|
|
</div>\
|
|
|
|
</div>\
|
|
|
|
</div>');
|
|
|
|
},
|
|
|
|
make_items: function() {
|
|
|
|
var items = wn.boot.topbaritems
|
|
|
|
for(var i=0;i<items.length;i++) {
|
|
|
|
var item = items[i];
|
2012-01-31 12:31:16 +00:00
|
|
|
if(!item.parent_label && item.parentfield=='top_bar_items') {
|
|
|
|
item.route = item.std_page ? item.std_page.toLowerCase() : item.custom_page;
|
2012-01-25 05:07:35 +00:00
|
|
|
$('header .nav:first').append(repl('<li><a href="#!%(route)s" \
|
|
|
|
data-label="%(label)s">%(label)s</a></li>', item))
|
2012-01-24 09:03:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2012-01-31 12:31:16 +00:00
|
|
|
erpnext.topbar.topbar = new erpnext.topbar.TopBar();
|
|
|
|
|
|
|
|
// footer
|
|
|
|
erpnext.Footer = Class.extend({
|
|
|
|
init: function() {
|
|
|
|
$('footer').html(repl('<div class="web-footer">\
|
|
|
|
<div class="web-footer-menu"><ul></ul></div>\
|
|
|
|
<div class="web-footer-address">%(address)s</div>\
|
|
|
|
<div class="web-footer-copyright">© %(copyright)s</div>\
|
|
|
|
<div class="web-footer-powered">Powered by \
|
|
|
|
<a href="https://erpnext.com">erpnext.com</a></div>\
|
|
|
|
</div>', wn.boot.topbar));
|
|
|
|
this.make_items();
|
|
|
|
},
|
|
|
|
make_items: function() {
|
|
|
|
var items = wn.boot.topbaritems
|
|
|
|
for(var i=0;i<items.length;i++) {
|
|
|
|
var item = items[i];
|
|
|
|
if(!item.parent_label && item.parentfield=='footer_items') {
|
|
|
|
item.route = item.std_page ? item.std_page.toLowerCase() : item.custom_page;
|
|
|
|
$('.web-footer-menu ul').append(repl('<li><a href="#!%(route)s" \
|
|
|
|
data-label="%(label)s">%(label)s</a></li>', item))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
erpnext.footer = new erpnext.Footer();
|