applications.py 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. # coding=utf-8
  2. import typing
  3. class Application(object):
  4. """
  5. Application class with data needed for frontend
  6. """
  7. def __init__(
  8. self,
  9. label: str,
  10. slug: str,
  11. icon: str,
  12. hexcolor: str,
  13. is_active: bool,
  14. config: typing.Dict[str, str],
  15. main_route: str,
  16. ) -> None:
  17. self.label = label
  18. self.slug = slug
  19. self.icon = icon
  20. self.hexcolor = hexcolor
  21. self.is_active = is_active
  22. self.config = config
  23. self.main_route = main_route
  24. # default apps
  25. calendar = Application(
  26. label='Calendar',
  27. slug='calendar',
  28. icon='calendar-alt',
  29. hexcolor='#757575',
  30. is_active=True,
  31. config={},
  32. main_route='/#/workspaces/{workspace_id}/calendar',
  33. )
  34. thread = Application(
  35. label='Threads',
  36. slug='contents/threads',
  37. icon='comments-o',
  38. hexcolor='#ad4cf9',
  39. is_active=True,
  40. config={},
  41. main_route='/#/workspaces/{workspace_id}/contents?type=thread',
  42. )
  43. _file = Application(
  44. label='Files',
  45. slug='contents/files',
  46. icon='paperclip',
  47. hexcolor='#FF9900',
  48. is_active=True,
  49. config={},
  50. main_route='/#/workspaces/{workspace_id}/contents?type=file',
  51. )
  52. markdownpluspage = Application(
  53. label='Markdown Plus Documents', # TODO - G.M - 24-05-2018 - Check label
  54. slug='contents/markdownpluspage',
  55. icon='file-code',
  56. hexcolor='#f12d2d',
  57. is_active=True,
  58. config={},
  59. main_route='/#/workspaces/{workspace_id}/contents?type=markdownpluspage',
  60. )
  61. htmlpage = Application(
  62. label='Text Documents', # TODO - G.M - 24-05-2018 - Check label
  63. slug='contents/htmlpage',
  64. icon='file-text-o',
  65. hexcolor='#3f52e3',
  66. is_active=True,
  67. config={},
  68. main_route='/#/workspaces/{workspace_id}/contents?type=htmlpage',
  69. )
  70. # TODO - G.M - 08-06-2018 - This is hardcoded lists of app, make this dynamic.
  71. # List of applications
  72. applications = [
  73. htmlpage,
  74. markdownpluspage,
  75. _file,
  76. thread,
  77. calendar,
  78. ]