浏览代码

[fix] comment paging and count (#4459)

version-14
Rushabh Mehta 7 年前
committed by GitHub
父节点
当前提交
92c62a1c31
找不到此签名对应的密钥 GPG 密钥 ID: 4AEE18F83AFDEB23
共有 3 个文件被更改,包括 7 次插入2 次删除
  1. +1
    -0
      frappe/desk/form/load.py
  2. +4
    -0
      frappe/public/js/frappe/form/footer/timeline.js
  3. +2
    -2
      frappe/public/js/frappe/form/form_sidebar.js

+ 1
- 0
frappe/desk/form/load.py 查看文件

@@ -94,6 +94,7 @@ def get_docinfo(doc=None, doctype=None, name=None):
frappe.response["docinfo"] = {
"attachments": get_attachments(doc.doctype, doc.name),
"communications": _get_communications(doc.doctype, doc.name),
'total_comments': len(json.loads(doc.get('_comments') or '[]')),
'versions': get_versions(doc),
"assignments": get_assignments(doc.doctype, doc.name),
"permissions": get_doc_permissions(doc),


+ 4
- 0
frappe/public/js/frappe/form/footer/timeline.js 查看文件

@@ -51,6 +51,10 @@ frappe.ui.form.Timeline = Class.extend({
var communications = me.get_communications().concat(new_communications);
frappe.model.set_docinfo(me.frm.doc.doctype, me.frm.doc.name, "communications", communications);

if (new_communications.length < 20) {
me.more = false;
}

} else {
me.more = false;
}


+ 2
- 2
frappe/public/js/frappe/form/form_sidebar.js 查看文件

@@ -70,10 +70,10 @@ frappe.ui.form.Sidebar = Class.extend({
},

refresh_comments: function() {
var comments = $.map(this.frm.timeline.get_communications(), function(c) {
$.map(this.frm.timeline.get_communications(), function(c) {
return (c.communication_type==="Communication" || (c.communication_type=="Comment" && c.comment_type==="Comment")) ? c : null;
});
this.comments.find(".n-comments").html(comments.length);
this.comments.find(".n-comments").html(this.frm.get_docinfo().total_comments);
},

make_tags: function() {


正在加载...
取消
保存