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. # TODO - G.M - 21-05-2018 Do not rely on hardcoded app list
  25. # default apps
  26. calendar = Application(
  27. label='Calendar',
  28. slug='calendar',
  29. icon='calendar-alt',
  30. hexcolor='#757575',
  31. is_active=True,
  32. config={},
  33. main_route='/#/workspaces/{workspace_id}/calendar',
  34. )
  35. thread = Application(
  36. label='Threads',
  37. slug='contents/threads',
  38. icon='comments-o',
  39. hexcolor='#ad4cf9',
  40. is_active=True,
  41. config={},
  42. main_route='/#/workspaces/{workspace_id}/contents?type=thread',
  43. )
  44. file = Application(
  45. label='Files',
  46. slug='contents/files',
  47. icon='paperclip',
  48. hexcolor='#FF9900',
  49. is_active=True,
  50. config={},
  51. main_route='/#/workspaces/{workspace_id}/contents?type=file',
  52. )
  53. pagemarkdownplus = Application(
  54. label='Rich Markdown Files', # TODO - G.M - 24-05-2018 - Check label
  55. slug='contents/pagemarkdownplus',
  56. icon='file-code',
  57. hexcolor='#f12d2d',
  58. is_active=True,
  59. config={},
  60. main_route='/#/workspaces/{workspace_id}/contents?type=pagemarkdownplus',
  61. )
  62. pagehtml = Application(
  63. label='Text Documents', # TODO - G.M - 24-05-2018 - Check label
  64. slug='contents/pagehtml',
  65. icon='file-text-o',
  66. hexcolor='#3f52e3',
  67. is_active=True,
  68. config={},
  69. main_route='/#/workspaces/{workspace_id}/contents?type=pagehtml',
  70. )
  71. # List of applications
  72. applications = [
  73. pagehtml,
  74. pagemarkdownplus,
  75. file,
  76. thread,
  77. calendar,
  78. ]