瀏覽代碼

Truncate comments in JournalEntryTable

Jeremy Stretch 5 年之前
父節點
當前提交
fe4bf62793
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      netbox/extras/tables.py

+ 3 - 0
netbox/extras/tables.py

@@ -134,6 +134,9 @@ class JournalEntryTable(ObjectJournalTable):
         orderable=False,
         verbose_name='Object'
     )
+    comments = tables.TemplateColumn(
+        template_code='{% load helpers %}{{ value|render_markdown|truncatewords_html:50 }}'
+    )
 
     class Meta(BaseTable.Meta):
         model = JournalEntry