feat: add grouping function
This commit is contained in:
parent
de12cb845a
commit
b8df8a43de
1 changed files with 11 additions and 7 deletions
|
|
@ -49,18 +49,22 @@ class DeskPage(Document):
|
|||
"label": "Link",
|
||||
"type": "Card Break",
|
||||
"icon": None,
|
||||
"hidden": False
|
||||
"hidden": False,
|
||||
}
|
||||
|
||||
links = []
|
||||
for link in self.links:
|
||||
link = link.as_dict()
|
||||
|
||||
if link.type == "Card Break":
|
||||
if current_card.links:
|
||||
if current_card.get(links):
|
||||
cards.append(current_card)
|
||||
current_card = link
|
||||
current_card['links'] = links
|
||||
|
||||
current_card = link
|
||||
links = []
|
||||
|
||||
else:
|
||||
if not current_card.links:
|
||||
current_card.links = []
|
||||
current_card.card.links.append(link)
|
||||
links.append(link)
|
||||
|
||||
cards.append(current_card)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue