[cleanup] [stock entry] [sales order]

This commit is contained in:
Rushabh Mehta 2013-07-03 18:32:26 +05:30
parent 2c3d549764
commit e8f3bc41f8
8 changed files with 77 additions and 102 deletions

View file

@ -17,9 +17,6 @@
"lib/public/css/bootstrap-responsive.css",
"lib/public/css/font-awesome.css",
"lib/public/css/legacy/forms.css",
"lib/public/css/legacy/fields.css",
"lib/public/css/legacy/dialog.css",
"lib/public/css/legacy/tabs.css",
"lib/public/css/ui/common.css",
"lib/public/css/views/tree_grid.css",
]
@ -38,9 +35,6 @@
"lib/public/js/lib/jquery/jquery.hotkeys.js",
"lib/public/js/lib/center_image.js",
"lib/public/js/lib/bootstrap.min.js",
"lib/public/js/lib/tiny_mce_3.5.7/jquery.tinymce.js:concat",
"lib/public/js/lib/mousetrap.min.js",
"lib/public/js/wn/provide.js",
"lib/public/js/wn/class.js",

View file

@ -1,75 +0,0 @@
/***** Dialogs *******/
div.dialog_wrapper {
position: absolute;
width: 440px;
display: none;
z-index: 2;
background-color: #FFF;
box-shadow:1px 1px 8px #444;
-moz-box-shadow: 1px 1px 8px #444;
-webkit-box-shadow: 1px 1px 8px #444;
border-radius: 5px;
overflow: hidden;
}
div.dialog_head {
height: 22px;
padding: 4px;
background-color: #222;
color: #FFF;
}
div.dialog_body {
padding: 8px 8px 16px;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
}
div#freeze {
position: fixed;
display: none;
top: 0px;
left: 0px;
bottom: 0px;
right: 0px;
background-color: #aaa;
opacity: 0.6;
z-index: 1;
text-align: center;
}
div.dialog_message {
display: none;
position: absolute;
width: 250px;
font-size: 12px;
z-index: 91;
background-color:#FFF;
padding: 12px;
border: 1px solid #444;
}
div.dialog_row {
padding: 8px 8px 0px 8px;
}
div.dialog_row table {
width: 100%;
}
div.dialog_row table td {
}
div.dialog_row input[type="text"], div.dialog_row input[type="password"], div.dialog_row textarea, div.dialog_row select {
width: 80%;
font-size: 14px;
}
div.dialog_row table td textarea {
width: 80%;
height: 200px;
font-size: 12px;
}

View file

@ -5,13 +5,6 @@
/* Documents */
.help ol {
padding-left: 19px;
}
.field_description_top {
margin-bottom: 3px;
}
.link-field .btn {

View file

@ -71,6 +71,18 @@ a {
border-bottom: 1px solid #ddd;
}
.help ol {
padding-left: 19px;
}
.field_description_top {
margin-bottom: 3px;
}
.link-field .btn {
padding-left: 6px;
padding-right: 6px;
}
/* module */
.module-item-progress {
@ -171,6 +183,12 @@ a {
font-size: 24px;
}
.appframe .sub-title-area {
margin-top: -25px;
margin-left: 75px;
font-size: 120%;
}
.appframe .title-icon:active {
-webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.3);
box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.3);

View file

@ -1,19 +1,22 @@
wn.ui.form.Dashboard = Class.extend({
init: function(opts) {
$.extend(this, opts);
this.wrapper = $('<div class="row form-dashboard">')
this.wrapper = $('<div class="form-dashboard row"></div>')
.prependTo(this.frm.layout.wrapper);
this.body = $('<div></div>').appendTo(this.wrapper);
},
reset: function(doc) {
this.wrapper.empty().toggle(doc.__islocal ? false : true);
reset: function() {
this.wrapper.toggle(false);
this.body.empty();
this.headline = null;
},
set_headline: function(html) {
if(!this.headline)
this.headline =
$('<div class="form-headline col col-lg-12">').prependTo(this.wrapper);
$('<div class="form-headline col col-lg-12">').prependTo(this.body);
this.headline.html(html);
this.wrapper.toggle(true);
},
set_headline_alert: function(text, alert_class, icon) {
this.set_headline(repl('<div class="alert %(alert_class)s">%(icon)s%(text)s</div>', {
@ -37,9 +40,10 @@ wn.ui.form.Dashboard = Class.extend({
<a class="badge-link">%(label)s</a>\
<span class="badge pull-right">-</span>\
</div></div>', {label:label}))
.appendTo(this.wrapper)
.appendTo(this.body)
badge.find(".badge-link").click(onclick);
this.wrapper.toggle(true);
return badge.find(".alert-badge");
},
@ -51,5 +55,36 @@ wn.ui.form.Dashboard = Class.extend({
.html(cint(count));
});
},
add_progress: function(title, percent) {
var width = cint(percent) < 1 ? 1 : percent;
var progress_class = "";
if(width < 10)
progress_class = "progress-bar-danger";
if(width > 99.9)
progress_class = "progress-bar-success";
var progress_area = this.body.find(".progress-area");
if(!progress_area.length) {
progress_area = $('<div class="progress-area">').appendTo(this.body);
}
$(repl('<div class="progress-chart">\
<h5>%(title)s</h5>\
<div class="progress">\
<div class="progress-bar %(progress_class)s" style="width: %(width)s%"></div>\
</div>\
</div>', {
title:title,
width: width,
progress_class: progress_class
})).appendTo(progress_area);
var n_charts = progress_area.find(".progress-chart").length,
cols = Math.floor(12 / n_charts);
progress_area.find(".progress-chart")
.removeClass().addClass("progress-chart col col-lg-" + cols);
this.wrapper.toggle(true);
}
})

View file

@ -46,7 +46,7 @@ wn.ui.form.Layout = Class.extend({
<form>\
<fieldset></fieldset>\
</form>\
</div>').appendTo(this.section)
</div>').appendTo(this.section.body)
.find("form")
.on("submit", function() { return false; })
.find("fieldset");
@ -83,11 +83,7 @@ wn.ui.form.Layout = Class.extend({
+ df.label
+ "</h3>")
.css({
"margin-bottom": "15px",
"font-weight": "bold",
// "color": "white",
// "background-color": "#16a085",
// "padding": "7px"
})
.appendTo(this.section);
if(this.frm.sections.length > 1)
@ -99,10 +95,16 @@ wn.ui.form.Layout = Class.extend({
if(df.description) {
$('<div class="col col-lg-12 small text-muted">' + df.description + '</div>').appendTo(this.section);
}
if(df.label || df.description) {
$('<div class="col col-lg-12"></div>')
.appendTo(this.section)
.css({"height": "20px"});
}
this.frm.fields_dict[df.fieldname] = section;
this.frm.fields.push(section);
}
// for bc
this.section.body = $('<div style="padding: 0px 3%">').appendTo(this.section);
section.row = {
wrapper: section
};

View file

@ -34,6 +34,7 @@ wn.ui.form.Toolbar = Class.extend({
title = title.substr(0,30) + "...";
}
this.appframe.set_title(title, wn._(this.frm.docname));
this.appframe.set_sub_title(wn._(this.frm.doctype));
},
show_infobar: function() {
/* docs:
@ -148,7 +149,7 @@ wn.ui.form.Toolbar = Class.extend({
var status_bar_parent = this.frm.appframe.$w.find(".status-bar").empty();
if(this.frm.meta.is_submittable && !this.frm.doc.__islocal) {
var status_bar = $("<h4>")
.css({"margin": "0px"})
.css({"margin": "0px", "margin-top": "-15px"})
.appendTo(status_bar_parent);
switch(this.frm.doc.docstatus) {

View file

@ -19,8 +19,7 @@ wn.ui.AppFrame = Class.extend({
<div class="title-area"><h2 style="display: inline-block">\
<span class="title-icon" style="display: none"></span>\
<span class="title-text"></span></h2></div>\
<div class="sub-title-area text-muted small" \
style="margin-top: -10px;"></div>\
<div class="sub-title-area text-muted small">&nbsp;</div>\
<div class="status-bar"></div>\
</div>\
</div>\
@ -71,6 +70,13 @@ wn.ui.AppFrame = Class.extend({
add_module_icon: function(module) {
var module_info = wn.modules[module];
if(!module_info) {
module_info = {
icon: "icon-question-sign",
color: "#eeeeee"
}
}
if(module_info && module_info.icon) {
this.$w.find(".title-icon").html('<i class="'
+module_info.icon+'"></i> ')
@ -80,7 +86,8 @@ wn.ui.AppFrame = Class.extend({
})
.attr("module-name", module)
.click(function() {
wn.set_route(wn.modules[$(this).attr("module-name")].link);
var module_info = wn.modules[$(this).attr("module-name")];
wn.set_route(module_info ? module_info.link : "desktop");
});
}
},