|
@@ -199,6 +199,7 @@ class Workspace(DAVCollection):
|
199
|
199
|
return self.workspace.label
|
200
|
200
|
|
201
|
201
|
def getLastModified(self) -> float:
|
|
202
|
+ print("hm....", self.path)
|
202
|
203
|
return mktime(self.workspace.updated.timetuple())
|
203
|
204
|
|
204
|
205
|
def getMemberNames(self) -> [str]:
|
|
@@ -579,10 +580,11 @@ class HistoryFolder(Folder):
|
579
|
580
|
children = self.content_api.get_all(None, ContentType.Any, self.workspace)
|
580
|
581
|
|
581
|
582
|
for content in children:
|
582
|
|
- members.append(HistoryFileFolder(
|
583
|
|
- path='%s/%s' % (self.path, content.get_label()),
|
584
|
|
- environ=self.environ,
|
585
|
|
- content=content))
|
|
583
|
+ if content.is_archived == self._is_archived and content.is_deleted == self._is_deleted:
|
|
584
|
+ members.append(HistoryFileFolder(
|
|
585
|
+ path='%s/%s' % (self.path, content.get_label()),
|
|
586
|
+ environ=self.environ,
|
|
587
|
+ content=content))
|
586
|
588
|
|
587
|
589
|
return members
|
588
|
590
|
|
|
@@ -647,16 +649,17 @@ class DeletedFolder(HistoryFolder):
|
647
|
649
|
children = self.content_api.get_all(None, ContentType.Any, self.workspace)
|
648
|
650
|
|
649
|
651
|
for content in children:
|
650
|
|
- content_path = '%s/%s' % (self.path, self.provider.transform_to_display(content.get_label()))
|
|
652
|
+ if content.is_deleted:
|
|
653
|
+ content_path = '%s/%s' % (self.path, self.provider.transform_to_display(content.get_label()))
|
651
|
654
|
|
652
|
|
- if content.type == ContentType.Folder:
|
653
|
|
- members.append(Folder(content_path, self.environ, self.workspace, content))
|
654
|
|
- elif content.type == ContentType.File:
|
655
|
|
- self._file_count += 1
|
656
|
|
- members.append(File(content_path, self.environ, content))
|
657
|
|
- else:
|
658
|
|
- self._file_count += 1
|
659
|
|
- members.append(OtherFile(content_path, self.environ, content))
|
|
655
|
+ if content.type == ContentType.Folder:
|
|
656
|
+ members.append(Folder(content_path, self.environ, self.workspace, content))
|
|
657
|
+ elif content.type == ContentType.File:
|
|
658
|
+ self._file_count += 1
|
|
659
|
+ members.append(File(content_path, self.environ, content))
|
|
660
|
+ else:
|
|
661
|
+ self._file_count += 1
|
|
662
|
+ members.append(OtherFile(content_path, self.environ, content))
|
660
|
663
|
|
661
|
664
|
if self._file_count > 0 and self.provider.show_history():
|
662
|
665
|
members.append(
|
|
@@ -726,16 +729,17 @@ class ArchivedFolder(HistoryFolder):
|
726
|
729
|
children = self.content_api.get_all(None, ContentType.Any, self.workspace)
|
727
|
730
|
|
728
|
731
|
for content in children:
|
729
|
|
- content_path = '%s/%s' % (self.path, self.provider.transform_to_display(content.get_label()))
|
|
732
|
+ if content.is_archived:
|
|
733
|
+ content_path = '%s/%s' % (self.path, self.provider.transform_to_display(content.get_label()))
|
730
|
734
|
|
731
|
|
- if content.type == ContentType.Folder:
|
732
|
|
- members.append(Folder(content_path, self.environ, self.workspace, content))
|
733
|
|
- elif content.type == ContentType.File:
|
734
|
|
- self._file_count += 1
|
735
|
|
- members.append(File(content_path, self.environ, content))
|
736
|
|
- else:
|
737
|
|
- self._file_count += 1
|
738
|
|
- members.append(OtherFile(content_path, self.environ, content))
|
|
735
|
+ if content.type == ContentType.Folder:
|
|
736
|
+ members.append(Folder(content_path, self.environ, self.workspace, content))
|
|
737
|
+ elif content.type == ContentType.File:
|
|
738
|
+ self._file_count += 1
|
|
739
|
+ members.append(File(content_path, self.environ, content))
|
|
740
|
+ else:
|
|
741
|
+ self._file_count += 1
|
|
742
|
+ members.append(OtherFile(content_path, self.environ, content))
|
739
|
743
|
|
740
|
744
|
if self._file_count > 0 and self.provider.show_history():
|
741
|
745
|
members.append(
|
|
@@ -932,17 +936,19 @@ class File(DAVNonCollection):
|
932
|
936
|
raise DAVError(HTTP_FORBIDDEN)
|
933
|
937
|
|
934
|
938
|
def move_file(self, destpath):
|
935
|
|
- parent = self.provider.get_parent_from_path(
|
|
939
|
+
|
|
940
|
+ workspace = self.provider.get_workspace_from_path(
|
936
|
941
|
normpath(destpath),
|
937
|
|
- self.content_api,
|
938
|
942
|
WorkspaceApi(self.user)
|
939
|
943
|
)
|
940
|
944
|
|
941
|
|
- workspace = self.provider.get_workspace_from_path(
|
|
945
|
+ parent = self.provider.get_parent_from_path(
|
942
|
946
|
normpath(destpath),
|
943
|
|
- WorkspaceApi(self.user)
|
|
947
|
+ self.content_api,
|
|
948
|
+ workspace
|
944
|
949
|
)
|
945
|
950
|
|
|
951
|
+
|
946
|
952
|
with new_revision(self.content):
|
947
|
953
|
if basename(destpath) != self.getDisplayName():
|
948
|
954
|
self.content_api.update_content(self.content, re.sub('\.[^\.]+$', '', self.provider.transform_to_bdd(basename(destpath))))
|