瀏覽代碼

fix: Redirect to comment in the doc comment section (#17538)

version-14
Shariq Ansari 2 年之前
committed by GitHub
父節點
當前提交
04f4fd8cfc
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: 4AEE18F83AFDEB23
共有 1 個檔案被更改,包括 8 行新增3 行删除
  1. +8
    -3
      frappe/templates/includes/comments/comments.py

+ 8
- 3
frappe/templates/includes/comments/comments.py 查看文件

@@ -3,7 +3,7 @@
import re

import frappe
from frappe import _
from frappe import _, scrub
from frappe.rate_limiter import rate_limit
from frappe.utils.html_utils import clean_html
from frappe.website.doctype.blog_settings.blog_settings import get_comment_limit
@@ -41,8 +41,13 @@ def add_comment(comment, comment_email, comment_by, reference_doctype, reference
if route:
clear_cache(route)

content = comment.content + "<p><a href='{}/{}#{}' style='font-size: 80%'>{}</a></p>".format(
frappe.utils.get_request_site_address(), doc.route, comment.name, _("View Comment")
if doc.get("route"):
url = f"{frappe.utils.get_request_site_address()}/{doc.route}#{comment.name}"
else:
url = f"{frappe.utils.get_request_site_address()}/app/{scrub(doc.doctype)}/{doc.name}#comment-{comment.name}"

content = comment.content + "<p><a href='{}' style='font-size: 80%'>{}</a></p>".format(
url, _("View Comment")
)

if doc.doctype == "Blog Post" and not doc.enable_email_notification:


Loading…
取消
儲存