|
|
@@ -103,20 +103,17 @@ class ObjectChangeTable(BaseTable):
|
|
|
fields = ('time', 'user_name', 'action', 'changed_object_type', 'object_repr', 'request_id')
|
|
|
|
|
|
|
|
|
-class JournalEntryTable(BaseTable):
|
|
|
- pk = ToggleColumn()
|
|
|
+class ObjectJournalTable(BaseTable):
|
|
|
+ """
|
|
|
+ Used for displaying a set of JournalEntries within the context of a single object.
|
|
|
+ """
|
|
|
created = tables.DateTimeColumn(
|
|
|
format=settings.SHORT_DATETIME_FORMAT
|
|
|
)
|
|
|
- assigned_object_type = ContentTypeColumn(
|
|
|
- verbose_name='Object type'
|
|
|
- )
|
|
|
- assigned_object = tables.Column(
|
|
|
- linkify=True,
|
|
|
- orderable=False,
|
|
|
- verbose_name='Object'
|
|
|
- )
|
|
|
kind = ChoiceFieldColumn()
|
|
|
+ comments = tables.TemplateColumn(
|
|
|
+ template_code='{% load helpers %}{{ value|render_markdown }}'
|
|
|
+ )
|
|
|
actions = ButtonsColumn(
|
|
|
model=JournalEntry,
|
|
|
buttons=('edit', 'delete')
|
|
|
@@ -124,24 +121,22 @@ class JournalEntryTable(BaseTable):
|
|
|
|
|
|
class Meta(BaseTable.Meta):
|
|
|
model = JournalEntry
|
|
|
- fields = (
|
|
|
- 'pk', 'created', 'created_by', 'assigned_object_type', 'assigned_object', 'kind', 'comments', 'actions'
|
|
|
- )
|
|
|
+ fields = ('created', 'created_by', 'kind', 'comments', 'actions')
|
|
|
|
|
|
|
|
|
-class ObjectJournalTable(BaseTable):
|
|
|
- """
|
|
|
- Used for displaying a set of JournalEntries within the context of a single object.
|
|
|
- """
|
|
|
- created = tables.DateTimeColumn(
|
|
|
- format=settings.SHORT_DATETIME_FORMAT
|
|
|
+class JournalEntryTable(ObjectJournalTable):
|
|
|
+ pk = ToggleColumn()
|
|
|
+ assigned_object_type = ContentTypeColumn(
|
|
|
+ verbose_name='Object type'
|
|
|
)
|
|
|
- kind = ChoiceFieldColumn()
|
|
|
- actions = ButtonsColumn(
|
|
|
- model=JournalEntry,
|
|
|
- buttons=('edit', 'delete')
|
|
|
+ assigned_object = tables.Column(
|
|
|
+ linkify=True,
|
|
|
+ orderable=False,
|
|
|
+ verbose_name='Object'
|
|
|
)
|
|
|
|
|
|
class Meta(BaseTable.Meta):
|
|
|
model = JournalEntry
|
|
|
- fields = ('created', 'created_by', 'kind', 'comments', 'actions')
|
|
|
+ fields = (
|
|
|
+ 'pk', 'created', 'created_by', 'assigned_object_type', 'assigned_object', 'kind', 'comments', 'actions'
|
|
|
+ )
|