Merge branch 'develop'
This commit is contained in:
commit
01ac59dad0
5 changed files with 33 additions and 22 deletions
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"base_template": "lib/website/templates/base.html",
|
||||
"framework_version": "3.7.1",
|
||||
"framework_version": "3.7.2",
|
||||
"modules": {
|
||||
"Calendar": {
|
||||
"color": "#2980b9",
|
||||
|
|
|
|||
|
|
@ -53,13 +53,13 @@ wn.print.Table = Class.extend({
|
|||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
var columns = [],
|
||||
widths = [],
|
||||
head_labels = [];
|
||||
|
||||
// make new arrays to remove empty cols, widths and head labels
|
||||
$.each(cols_with_value, function(i, col_idx) {
|
||||
$.each(cols_with_value.sort(), function(i, col_idx) {
|
||||
columns.push(me.columns[col_idx]);
|
||||
me.widths && widths.push(me.widths[col_idx]);
|
||||
me.head_labels && head_labels.push(me.head_labels[col_idx]);
|
||||
|
|
|
|||
|
|
@ -123,8 +123,10 @@ bsEditor = Class.extend({
|
|||
},
|
||||
|
||||
clean_html: function() {
|
||||
|
||||
var html = this.editor.html() || "";
|
||||
html = html.replace(/(<br>|\s|<div><br><\/div>| )*$/, '');
|
||||
if(!strip(this.editor.text())) html = "";
|
||||
// html = html.replace(/(<br>|\s|<div><br><\/div>| )*$/, '');
|
||||
|
||||
// remove custom typography (use CSS!)
|
||||
if(this.options.remove_typography) {
|
||||
|
|
|
|||
|
|
@ -87,25 +87,26 @@ wn.views.ListView = Class.extend({
|
|||
var overridden = $.map(this.settings.add_columns || [], function(d) {
|
||||
return d.content;
|
||||
});
|
||||
var docfields_in_list_view = wn.model.get("DocField", {"parent":this.doctype,
|
||||
"in_list_view":1}).sort(function(a, b) { return a.idx - b.idx })
|
||||
|
||||
$.each(wn.model.get("DocField", {"parent":this.doctype, "in_list_view":1}),
|
||||
function(i,d) {
|
||||
if(in_list(overridden, d.fieldname)) {
|
||||
return;
|
||||
}
|
||||
// field width
|
||||
var colspan = "3";
|
||||
if(in_list(["Int", "Percent", "Select"], d.fieldtype)) {
|
||||
colspan = "2";
|
||||
} else if(d.fieldtype=="Check") {
|
||||
colspan = "1";
|
||||
} else if(in_list(["name", "subject", "title"], d.fieldname)) { // subjects are longer
|
||||
colspan = "4";
|
||||
} else if(d.fieldtype=="Text Editor" || d.fieldtype=="Text") {
|
||||
colspan = "4";
|
||||
}
|
||||
me.columns.push({colspan: colspan, content: d.fieldname,
|
||||
type:d.fieldtype, df:d, title:wn._(d.label) });
|
||||
$.each(docfields_in_list_view, function(i,d) {
|
||||
if(in_list(overridden, d.fieldname)) {
|
||||
return;
|
||||
}
|
||||
// field width
|
||||
var colspan = "3";
|
||||
if(in_list(["Int", "Percent", "Select"], d.fieldtype)) {
|
||||
colspan = "2";
|
||||
} else if(d.fieldtype=="Check") {
|
||||
colspan = "1";
|
||||
} else if(in_list(["name", "subject", "title"], d.fieldname)) { // subjects are longer
|
||||
colspan = "4";
|
||||
} else if(d.fieldtype=="Text Editor" || d.fieldtype=="Text") {
|
||||
colspan = "4";
|
||||
}
|
||||
me.columns.push({colspan: colspan, content: d.fieldname,
|
||||
type:d.fieldtype, df:d, title:wn._(d.label) });
|
||||
});
|
||||
|
||||
// additional columns
|
||||
|
|
|
|||
|
|
@ -38,10 +38,16 @@ wn.views.ReportViewPage = Class.extend({
|
|||
});
|
||||
},
|
||||
make_page: function() {
|
||||
var me = this;
|
||||
this.page = wn.container.add_page(this.page_name);
|
||||
wn.ui.make_app_page({parent:this.page,
|
||||
single_column:true});
|
||||
wn.container.change_to(this.page_name);
|
||||
|
||||
$(this.page).on('show', function(){
|
||||
if(me.page.reportview.set_route_filters())
|
||||
me.page.reportview.run();
|
||||
})
|
||||
},
|
||||
make_report_view: function() {
|
||||
var module = locals.DocType[this.doctype].module;
|
||||
|
|
@ -147,10 +153,12 @@ wn.views.ReportView = wn.ui.Listing.extend({
|
|||
set_route_filters: function() {
|
||||
var me = this;
|
||||
if(wn.route_options) {
|
||||
me.filter_list.clear_filters();
|
||||
$.each(wn.route_options, function(key, value) {
|
||||
me.filter_list.add_filter(me.doctype, key, "=", value);
|
||||
});
|
||||
wn.route_options = null;
|
||||
return true;
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue