Coverage for /home/runner/work/viur-core/viur-core/viur/src/viur/core/modules/page.py: 0%

15 statements  

« prev     ^ index     » next       coverage.py v7.6.3, created at 2024-10-16 22:16 +0000

1from viur.core.prototypes.tree import Tree, TreeSkel 

2from viur.core.bones import * 

3 

4 

5class PageSkel(TreeSkel): 

6 kindName = "page" 

7 searchindex = "page" 

8 

9 name = StringBone( 

10 descr="Name", 

11 searchable=True, 

12 required=True 

13 ) 

14 

15 descr = TextBone( 

16 descr="Content", 

17 required=True, 

18 searchable=True 

19 ) 

20 

21 

22class Page(Tree): 

23 adminInfo = { 

24 "name": "Pages", 

25 "handler": "tree.nodeonly.page", 

26 "icon": "cloud-fill", 

27 "columns": ["name", "language", "isactive"], 

28 "preview": { 

29 "Web": "/{{module}}/view/{{key}}" 

30 } 

31 } 

32 

33 viewTemplate = "page_view" 

34 

35 def getAvailableRootNodes(self, *args, **kwargs): 

36 repo = self.ensureOwnModuleRootNode() 

37 return [{ 

38 "name": "pages", 

39 "key": repo.key 

40 }] 

41 

42 

43Page.html = True 

44Page.json = True