[cleanups] fixes to v7 changes
This commit is contained in:
parent
bf93df0989
commit
adc5e877d5
7 changed files with 46 additions and 22 deletions
|
|
@ -2,6 +2,7 @@
|
|||
"allow_copy": 0,
|
||||
"allow_import": 0,
|
||||
"allow_rename": 1,
|
||||
"beta": 0,
|
||||
"creation": "2013-05-24 13:41:00",
|
||||
"custom": 0,
|
||||
"description": "Note is a free page where users can share documents / notes",
|
||||
|
|
@ -17,6 +18,7 @@
|
|||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Title",
|
||||
|
|
@ -24,6 +26,7 @@
|
|||
"no_copy": 1,
|
||||
"permlevel": 0,
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
|
|
@ -33,13 +36,14 @@
|
|||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"bold": 1,
|
||||
"collapsible": 0,
|
||||
"description": "Everyone can read",
|
||||
"fieldname": "public",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Public",
|
||||
|
|
@ -47,6 +51,7 @@
|
|||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
|
|
@ -56,13 +61,14 @@
|
|||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"bold": 1,
|
||||
"collapsible": 0,
|
||||
"description": "Help: To link to another record in the system, use \"#Form/Note/[Note Name]\" as the Link URL. (don't use \"http://\")",
|
||||
"fieldname": "content",
|
||||
"fieldtype": "Text Editor",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Content",
|
||||
|
|
@ -70,6 +76,7 @@
|
|||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
|
|
@ -82,13 +89,14 @@
|
|||
"hide_toolbar": 0,
|
||||
"icon": "icon-file-text",
|
||||
"idx": 1,
|
||||
"image_view": 0,
|
||||
"in_create": 0,
|
||||
"in_dialog": 0,
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2015-11-16 06:29:50.709322",
|
||||
"modified": "2016-06-13 16:55:17.639957",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Desk",
|
||||
"name": "Note",
|
||||
|
|
@ -115,6 +123,9 @@
|
|||
"write": 1
|
||||
}
|
||||
],
|
||||
"quick_entry": 0,
|
||||
"read_only": 0,
|
||||
"read_only_onload": 1
|
||||
"read_only_onload": 1,
|
||||
"sort_order": "ASC",
|
||||
"track_seen": 0
|
||||
}
|
||||
|
|
@ -157,12 +157,15 @@ frappe.activity.Feed = Class.extend({
|
|||
|
||||
frappe.activity.render_heatmap = function(page) {
|
||||
var me = this;
|
||||
$('<div class="heatmap"></div><hr>').prependTo(page.main);
|
||||
|
||||
$('<div class="heatmap"></div><hr style="margin-bottom: 0px;">').prependTo(page.main);
|
||||
|
||||
frappe.call({
|
||||
method: "frappe.desk.page.activity.activity.get_heatmap_data",
|
||||
callback: function(r) {
|
||||
if(r.message) {
|
||||
var legend = [];
|
||||
var max = Math.max.apply(this, $.map(r.message, function(v) { return v }));
|
||||
var legend = [cint(max/5), cint(max*2/5), cint(max*3/5), cint(max*4/5)];
|
||||
heatmap = new CalHeatMap();
|
||||
heatmap.init({
|
||||
itemSelector: ".heatmap",
|
||||
|
|
@ -177,17 +180,17 @@ frappe.activity.render_heatmap = function(page) {
|
|||
return moment(date).format("MMM").toUpperCase();
|
||||
},
|
||||
displayLegend: false,
|
||||
legend: [5, 10, 15, 20],
|
||||
legend: legend,
|
||||
tooltip: true,
|
||||
subDomainTitleFormat: {
|
||||
empty: "{date}",
|
||||
filled: "{count} Communications on {date}"
|
||||
filled: "{count} actions on {date}"
|
||||
},
|
||||
subDomainDateFormat: "%d-%b"
|
||||
});
|
||||
|
||||
|
||||
heatmap.update(r.message);
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
|
@ -202,7 +202,7 @@ frappe.views.ListView = Class.extend({
|
|||
this.id_list.push(data.name);
|
||||
}
|
||||
|
||||
if(this.meta.image_view == 0){
|
||||
if(this.meta && this.meta.image_view == 0){
|
||||
this.render_list_row(row, data);
|
||||
}
|
||||
else{
|
||||
|
|
|
|||
|
|
@ -57,7 +57,8 @@ $.extend(frappe.meta, {
|
|||
},
|
||||
|
||||
get_docfield: function(doctype, fieldname, name) {
|
||||
return frappe.meta.get_docfield_copy(doctype, name)[fieldname];
|
||||
var fields_dict = frappe.meta.get_docfield_copy(doctype, name);
|
||||
return fields_dict ? fields_dict[fieldname] : null;
|
||||
},
|
||||
|
||||
set_formatter: function(doctype, fieldname, name, formatter) {
|
||||
|
|
|
|||
|
|
@ -315,13 +315,7 @@ frappe.ui.Listing = Class.extend({
|
|||
},
|
||||
render_rows: function(values) {
|
||||
// render the rows
|
||||
if(this.meta.image_view == 0){
|
||||
var m = Math.min(values.length, this.page_length);
|
||||
for(var i=0; i < m; i++) {
|
||||
this.render_row(this.add_row(values[i]), values[i], this, i);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(this.meta && this.meta.image_view){
|
||||
var cols = values.slice();
|
||||
while (cols.length) {
|
||||
row = this.add_row(cols[0]);
|
||||
|
|
@ -330,6 +324,11 @@ frappe.ui.Listing = Class.extend({
|
|||
}
|
||||
|
||||
this.render_image_gallery();
|
||||
} else {
|
||||
var m = Math.min(values.length, this.page_length);
|
||||
for(var i=0; i < m; i++) {
|
||||
this.render_row(this.add_row(values[i]), values[i], this, i);
|
||||
}
|
||||
}
|
||||
},
|
||||
render_image_gallery: function(){
|
||||
|
|
@ -367,7 +366,7 @@ frappe.ui.Listing = Class.extend({
|
|||
},
|
||||
add_row: function(row) {
|
||||
return $('<div class="list-row">')
|
||||
.data("data", this.meta.image_view == 0?row:null)
|
||||
.data("data", (this.meta && this.meta.image_view) == 0 ? row : null)
|
||||
.appendTo(this.$w.find('.result-list'))
|
||||
.get(0);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ frappe.ui.SortSelector = Class.extend({
|
|||
// doctype: (optional)
|
||||
init: function(opts) {
|
||||
$.extend(this, opts);
|
||||
this.labels = {};
|
||||
this.make();
|
||||
},
|
||||
make: function() {
|
||||
|
|
@ -45,6 +46,11 @@ frappe.ui.SortSelector = Class.extend({
|
|||
if(!this.args) {
|
||||
this.args = {};
|
||||
}
|
||||
if(this.args.options) {
|
||||
this.args.options.forEach(function(o) {
|
||||
me.labels[o.fieldname] = o.label;
|
||||
});
|
||||
}
|
||||
|
||||
this.setup_from_doctype();
|
||||
|
||||
|
|
@ -53,9 +59,12 @@ frappe.ui.SortSelector = Class.extend({
|
|||
this.args.options.every(function(o) {
|
||||
if(o.fieldname===me.args.sort_by) {
|
||||
me.args.sort_by_label = o.label;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
setup_from_doctype: function() {
|
||||
var me = this;
|
||||
|
|
@ -130,7 +139,8 @@ frappe.ui.SortSelector = Class.extend({
|
|||
if(fieldname==='idx') {
|
||||
return __("Most Used");
|
||||
} else {
|
||||
return frappe.meta.get_label(this.doctype, fieldname);
|
||||
return this.labels[fieldname]
|
||||
|| frappe.meta.get_label(this.doctype, fieldname);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
@ -12,7 +12,7 @@ frappe.views.CommunicationComposer = Class.extend({
|
|||
make: function() {
|
||||
var me = this;
|
||||
this.dialog = new frappe.ui.Dialog({
|
||||
title: __("Add Reply") + ": " + (this.subject || ""),
|
||||
title: (this.subject || ""),
|
||||
no_submit_on_enter: true,
|
||||
fields: this.get_fields(),
|
||||
primary_action_label: "Send",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue