Browse Source

#202 modification displayed on folders

Alexis CLEMENT 8 years ago
parent
commit
3c3dd22c0f
2 changed files with 10 additions and 1 deletions
  1. 3 0
      tracim/tracim/model/serializers.py
  2. 7 1
      tracim/tracim/templates/folder/getone.mak

+ 3 - 0
tracim/tracim/model/serializers.py View File

@@ -600,6 +600,9 @@ def serialize_content_for_workspace_and_folder(content: Content, context: Contex
600 600
             id=content.content_id,
601 601
             label=content.label,
602 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),
603 606
             workspace=context.toDict(content.workspace),
604 607
             allowed_content=DictLikeClass(content.properties['allowed_content']),
605 608
             allowed_content_types=context.toDict(content.get_allowed_content_types()),

+ 7 - 1
tracim/tracim/templates/folder/getone.mak View File

@@ -50,7 +50,13 @@
50 50
 
51 51
             <div style="margin: -1.5em auto -1.5em auto;" class="tracim-less-visible">
52 52
                 <% created_localized = h.get_with_timezone(result.folder.created) %>
53
-              <p>${_('folder created on {date} at {time} by <b>{author}</b>').format(date=h.date(created_localized), time=h.time(created_localized), author=result.folder.owner.name)|n}</p>
53
+                <% updated_localized = h.get_with_timezone(result.folder.updated) %>
54
+                <% last_modification_author = result.folder.last_modification_author.name %>
55
+                <p>${_('folder created on {date} at {time} by <b>{author}</b>').format(date=h.date(created_localized), time=h.time(created_localized), author=result.folder.owner.name)|n}
56
+                    % if result.folder.revision_nb > 1:
57
+                      ${_(' (last modification on {update_date} at {update_time} by {last_modification_author})').format(update_date=h.update_date(updated_localized), update_time=h.update_time(updated_localized), last_modification_author = last_modification_author)|n}
58
+                    % endif
59
+                </p>
54 60
             </div>
55 61
         </div>
56 62
     </div>