[tree] [ui]

This commit is contained in:
Rushabh Mehta 2015-01-01 12:49:18 +05:30
parent 7a8f009116
commit bfaf0a8f43
4 changed files with 11 additions and 30 deletions

View File

@ -19,7 +19,7 @@ pscript['onload_Accounts Browser'] = function(wrapper){
chart_area = $("<div>")
.css({"margin-bottom": "15px", "min-height": "200px"})
.appendTo(main),
help_area = $('<div class="msg-box">'+
help_area = $('<hr><div style="padding: 0px 15px;">'+
'<h4>'+__('Quick Help')+'</h4>'+
'<ol>'+
'<li>'+__('To add child nodes, explore tree and click on the node under which you want to add more nodes.')+'</li>'+
@ -41,8 +41,7 @@ pscript['onload_Accounts Browser'] = function(wrapper){
'<p>'+__('Please setup your chart of accounts before you start Accounting Entries')+'</p></div>').appendTo(main);
if (frappe.boot.user.can_create.indexOf("Company") !== -1) {
wrapper.page.add_button(__('New Company'), function() { newdoc('Company'); },
'icon-plus');
wrapper.page.add_menu_item(__('New Company'), function() { newdoc('Company'); }, true);
}
wrapper.page.set_primary_action(__('Refresh'), function() {
@ -169,9 +168,11 @@ erpnext.AccountsChart = Class.extend({
}
],
onrender: function(node) {
var dr_or_cr = node.data.balance < 0 ? "Cr" : "Dr";
if (me.ctype == 'Account' && node.data && node.data.balance!==undefined) {
$('<span class="balance-area pull-right text-muted">'
+ format_currency(node.data.balance, node.data.currency)
$('<span class="balance-area pull-right text-muted small">'
+ format_currency(Math.abs(node.data.balance), node.data.currency)
+ " " + dr_or_cr
+ '</span>').insertBefore(node.$ul);
}
}

View File

@ -158,7 +158,7 @@ erpnext.POS = Class.extend({
image = '<img src="' + obj.image + '" class="img-responsive" \
style="border:1px solid #eee; max-height: 140px;">';
else
image = '<div class="missing-image"><i class="icon-camera"></i></div>';
image = '<div class="missing-image"><i class="octicon octicon-circle-slash"></i></div>';
$(repl('<div class="col-xs-3 pos-item" data-item_code="%(item_code)s">\
<div style="height: 140px; overflow: hidden;">%(item_image)s</div>\

View File

@ -1,14 +0,0 @@
span.tree-node-toolbar {
padding: 2px;
margin-left: 15px;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
background-color: #ddd;
}
.tree-area a.selected {
font-weight: bold;
text-decoration: underline;
}

View File

@ -4,6 +4,7 @@
pscript['onload_Sales Browser'] = function(wrapper){
frappe.ui.make_app_page({
parent: wrapper,
single_column: true,
})
frappe.add_breadcrumbs("Selling")
@ -12,13 +13,6 @@ pscript['onload_Sales Browser'] = function(wrapper){
wrapper.make_tree();
});
$(wrapper)
.find(".layout-side-section")
.html('<div class="text-muted">'+
__('Click on a link to get options to expand get options ') +
__('Add') + ' / ' + __('Edit') + ' / '+ __('Delete') + '.</div>')
wrapper.make_tree = function() {
var ctype = frappe.get_route()[1] || 'Territory';
return frappe.call({
@ -114,8 +108,7 @@ erpnext.SalesChart = Class.extend({
{fieldtype:'Data', fieldname: 'name_field',
label:__('New {0} Name',[__(me.ctype)]), reqd:true},
{fieldtype:'Select', fieldname:'is_group', label:__('Group Node'), options:'No\nYes',
description: __("Further nodes can be only created under 'Group' type nodes")},
{fieldtype:'Button', fieldname:'create_new', label:__('Create New') }
description: __("Further nodes can be only created under 'Group' type nodes")}
]
if(me.ctype == "Sales Person") {
@ -131,7 +124,7 @@ erpnext.SalesChart = Class.extend({
d.set_value("is_group", "No");
// create
$(d.fields_dict.create_new.input).click(function() {
d.set_primary_action(__("Create New"), function() {
var btn = this;
var v = d.get_values();
if(!v) return;
@ -155,6 +148,7 @@ erpnext.SalesChart = Class.extend({
}
});
});
d.show();
},
});