|
@@ -184,47 +184,6 @@ class ContentApi(object):
|
184
|
184
|
content_list.sort(key=cmp_to_key(compare_content_for_sorting_by_type_and_name))
|
185
|
185
|
return content_list
|
186
|
186
|
|
187
|
|
- # TODO - G.M - 28-03-2018 - [cleanup] This look deprecated.
|
188
|
|
- # def build_breadcrumb(self, workspace, item_id=None, skip_root=False) -> [BreadcrumbItem]:
|
189
|
|
- # """
|
190
|
|
- # TODO - Remove this and factorize it with other get_breadcrumb_xxx methods
|
191
|
|
- # :param item_id: an item id (item may be normal content or folder
|
192
|
|
- # :return:
|
193
|
|
- # """
|
194
|
|
- # workspace_id = workspace.workspace_id
|
195
|
|
- # breadcrumb = []
|
196
|
|
- #
|
197
|
|
- # if not skip_root:
|
198
|
|
- # breadcrumb.append(BreadcrumbItem(ContentType.get_icon(ContentType.FAKE_Dashboard), _('Workspaces'), tg.url('/workspaces')))
|
199
|
|
- # breadcrumb.append(BreadcrumbItem(ContentType.get_icon(ContentType.FAKE_Workspace), workspace.label, tg.url('/workspaces/{}'.format(workspace.workspace_id))))
|
200
|
|
- #
|
201
|
|
- # if item_id:
|
202
|
|
- # breadcrumb_folder_items = []
|
203
|
|
- # current_item = self.get_one(item_id, ContentType.Any, workspace)
|
204
|
|
- # is_active = True
|
205
|
|
- # if current_item.type==ContentType.Folder:
|
206
|
|
- # next_url = tg.url('/workspaces/{}/folders/{}'.format(workspace_id, current_item.content_id))
|
207
|
|
- # else:
|
208
|
|
- # next_url = tg.url('/workspaces/{}/folders/{}/{}s/{}'.format(workspace_id, current_item.parent_id, current_item.type, current_item.content_id))
|
209
|
|
- #
|
210
|
|
- # while current_item:
|
211
|
|
- # breadcrumb_item = BreadcrumbItem(ContentType.get_icon(current_item.type),
|
212
|
|
- # current_item.label,
|
213
|
|
- # next_url,
|
214
|
|
- # is_active)
|
215
|
|
- # is_active = False # the first item is True, then all other are False => in the breadcrumb, only the last item is "active"
|
216
|
|
- # breadcrumb_folder_items.append(breadcrumb_item)
|
217
|
|
- # current_item = current_item.parent
|
218
|
|
- # if current_item:
|
219
|
|
- # # In last iteration, the parent is None, and there is no more breadcrumb item to build
|
220
|
|
- # next_url = tg.url('/workspaces/{}/folders/{}'.format(workspace_id, current_item.content_id))
|
221
|
|
- #
|
222
|
|
- # for item in reversed(breadcrumb_folder_items):
|
223
|
|
- # breadcrumb.append(item)
|
224
|
|
- #
|
225
|
|
- #
|
226
|
|
- # return breadcrumb
|
227
|
|
-
|
228
|
187
|
def __real_base_query(self, workspace: Workspace=None):
|
229
|
188
|
result = self.get_canonical_query()
|
230
|
189
|
|