applications.py 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. routes: typing.List[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.routes = routes
  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. routes=[
  34. '/#/workspaces/{workspace_id}/calendar',
  35. ],
  36. )
  37. thread = Application(
  38. label='Threads',
  39. slug='contents/threads',
  40. icon='comments-o',
  41. hexcolor='#ad4cf9',
  42. is_active=True,
  43. config={},
  44. routes=[
  45. '/#/workspaces/{workspace_id}/contents?type=thread',
  46. ],
  47. )
  48. file = Application(
  49. label='Files',
  50. slug='contents/files',
  51. icon='paperclip',
  52. hexcolor='#FF9900',
  53. is_active=True,
  54. config={},
  55. routes=[
  56. '/#/workspaces/{workspace_id}/contents?type=file',
  57. ],
  58. )
  59. pagemarkdownplus = Application(
  60. label='Rich Markdown Files', # TODO : Better label
  61. slug='contents/pagemarkdownplus',
  62. icon='file-code',
  63. hexcolor='#f12d2d',
  64. is_active=True,
  65. config={},
  66. routes=[
  67. '/#/workspaces/{workspace_id}/contents?type=file',
  68. ],
  69. )
  70. pagehtml = Application(
  71. label='Text Documents', # TODO : Better label
  72. slug='contents/pagehtml',
  73. icon='file-text-o',
  74. hexcolor='#3f52e3',
  75. is_active=True,
  76. config={},
  77. routes=[
  78. '/#/workspaces/{workspace_id}/contents?type=file',
  79. ],
  80. )
  81. # List of applications
  82. applications = [
  83. pagehtml,
  84. pagemarkdownplus,
  85. file,
  86. thread,
  87. calendar,
  88. ]