|
@@ -388,12 +388,14 @@ def serialize_node_for_page(content: Content, context: Context):
|
388
|
388
|
is_new=content.has_new_information_for(context.get_user()),
|
389
|
389
|
content=data_container.description,
|
390
|
390
|
created=data_container.created,
|
|
391
|
+ updated=content.last_revision.updated,
|
391
|
392
|
label=data_container.label,
|
392
|
393
|
icon=ContentType.get_icon(content.type),
|
393
|
|
- owner=context.toDict(data_container.owner),
|
|
394
|
+ owner=context.toDict(content.first_revision.owner),
|
|
395
|
+ last_modification_author=context.toDict(content.last_revision.owner),
|
394
|
396
|
status=context.toDict(data_container.get_status()),
|
395
|
397
|
links=[],
|
396
|
|
- revisions=context.toDict(sorted(content.revisions, key=lambda v: v.created, reverse=True)),
|
|
398
|
+ revision_nb = len(content.revisions),
|
397
|
399
|
selected_revision='latest' if content.revision_to_serialize<=0 else content.revision_to_serialize,
|
398
|
400
|
history=Context(CTX.CONTENT_HISTORY).toDict(content.get_history()),
|
399
|
401
|
is_editable=content.is_editable,
|
|
@@ -450,16 +452,19 @@ def serialize_content_for_history(event: VirtualEvent, context: Context):
|
450
|
452
|
)
|
451
|
453
|
|
452
|
454
|
@pod_serializer(Content, CTX.THREAD)
|
453
|
|
-def serialize_node_for_page(item: Content, context: Context):
|
|
455
|
+def serialize_node_for_thread(item: Content, context: Context):
|
454
|
456
|
if item.type==ContentType.Thread:
|
455
|
457
|
return DictLikeClass(
|
456
|
458
|
content = item.description,
|
457
|
459
|
created = item.created,
|
|
460
|
+ updated = item.last_revision.updated,
|
|
461
|
+ revision_nb = len(item.revisions),
|
458
|
462
|
icon = ContentType.get_icon(item.type),
|
459
|
463
|
id = item.content_id,
|
460
|
464
|
label = item.label,
|
461
|
465
|
links=[],
|
462
|
466
|
owner = context.toDict(item.owner),
|
|
467
|
+ last_modification_author=context.toDict(item.last_revision.owner),
|
463
|
468
|
parent = context.toDict(item.parent),
|
464
|
469
|
selected_revision = 'latest',
|
465
|
470
|
status = context.toDict(item.get_status()),
|
|
@@ -595,6 +600,9 @@ def serialize_content_for_workspace_and_folder(content: Content, context: Contex
|
595
|
600
|
id=content.content_id,
|
596
|
601
|
label=content.label,
|
597
|
602
|
created=content.created,
|
|
603
|
+ updated=content.last_revision.updated,
|
|
604
|
+ last_modification_author=context.toDict(content.last_revision.owner),
|
|
605
|
+ revision_nb=len(content.revisions),
|
598
|
606
|
workspace=context.toDict(content.workspace),
|
599
|
607
|
allowed_content=DictLikeClass(content.properties['allowed_content']),
|
600
|
608
|
allowed_content_types=context.toDict(content.get_allowed_content_types()),
|