diff --git a/public/build.json b/public/build.json index 53f5beb0c8..80b79f70c8 100644 --- a/public/build.json +++ b/public/build.json @@ -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", diff --git a/public/css/legacy/dialog.css b/public/css/legacy/dialog.css deleted file mode 100644 index 22c5928e36..0000000000 --- a/public/css/legacy/dialog.css +++ /dev/null @@ -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; -} diff --git a/public/css/legacy/fields.css b/public/css/legacy/fields.css index 9a354e290e..314513fc4a 100644 --- a/public/css/legacy/fields.css +++ b/public/css/legacy/fields.css @@ -5,13 +5,6 @@ /* Documents */ -.help ol { - padding-left: 19px; -} - -.field_description_top { - margin-bottom: 3px; -} .link-field .btn { diff --git a/public/css/ui/common.css b/public/css/ui/common.css index f1aa7a10c8..5fc2e77016 100644 --- a/public/css/ui/common.css +++ b/public/css/ui/common.css @@ -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); diff --git a/public/js/wn/form/dashboard.js b/public/js/wn/form/dashboard.js index 5b9071d43d..73cf4195c2 100644 --- a/public/js/wn/form/dashboard.js +++ b/public/js/wn/form/dashboard.js @@ -1,19 +1,22 @@ wn.ui.form.Dashboard = Class.extend({ init: function(opts) { $.extend(this, opts); - this.wrapper = $('
') + this.wrapper = $('
') .prependTo(this.frm.layout.wrapper); + this.body = $('
').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 = - $('
').prependTo(this.wrapper); + $('
').prependTo(this.body); this.headline.html(html); + this.wrapper.toggle(true); }, set_headline_alert: function(text, alert_class, icon) { this.set_headline(repl('
%(icon)s%(text)s
', { @@ -37,9 +40,10 @@ wn.ui.form.Dashboard = Class.extend({ %(label)s\ -\
', {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 = $('
').appendTo(this.body); + } + $(repl('
\ +
%(title)s
\ +
\ +
\ +
\ +
', { + 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); + } }) \ No newline at end of file diff --git a/public/js/wn/form/layout.js b/public/js/wn/form/layout.js index 862a8f5462..b6c8684317 100644 --- a/public/js/wn/form/layout.js +++ b/public/js/wn/form/layout.js @@ -46,7 +46,7 @@ wn.ui.form.Layout = Class.extend({
\
\
\ -
').appendTo(this.section) +
').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 + "") .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) { $('
' + df.description + '
').appendTo(this.section); } + if(df.label || df.description) { + $('
') + .appendTo(this.section) + .css({"height": "20px"}); + } this.frm.fields_dict[df.fieldname] = section; this.frm.fields.push(section); } // for bc + this.section.body = $('
').appendTo(this.section); section.row = { wrapper: section }; diff --git a/public/js/wn/form/toolbar.js b/public/js/wn/form/toolbar.js index 6feda1635c..c51c9258d7 100644 --- a/public/js/wn/form/toolbar.js +++ b/public/js/wn/form/toolbar.js @@ -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 = $("

") - .css({"margin": "0px"}) + .css({"margin": "0px", "margin-top": "-15px"}) .appendTo(status_bar_parent); switch(this.frm.doc.docstatus) { diff --git a/public/js/wn/ui/appframe.js b/public/js/wn/ui/appframe.js index e7738ed27a..9c9d46f891 100644 --- a/public/js/wn/ui/appframe.js +++ b/public/js/wn/ui/appframe.js @@ -19,8 +19,7 @@ wn.ui.AppFrame = Class.extend({

\ \

\ -
\ +
 
\
\

\ \ @@ -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(' ') @@ -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"); }); } },