diff src/browser/sat_browser/richtext.py @ 740:b6510fd9ae15

browser_side: implements tags UI
author souliane <souliane@mailoo.org>
date Thu, 19 Nov 2015 16:43:18 +0100
parents caad07bdb659
children c3cb68227cca
line wrap: on
line diff
--- a/src/browser/sat_browser/richtext.py	Thu Nov 19 16:42:39 2015 +0100
+++ b/src/browser/sat_browser/richtext.py	Thu Nov 19 16:43:18 2015 +0100
@@ -37,6 +37,9 @@
 import base_panel
 import editor_widget
 import html_tools
+import list_manager
+
+from sat_frontends.quick_frontend import quick_list_manager
 
 
 class RichTextEditor(editor_widget.BaseTextEditor, FlexTable):
@@ -63,8 +66,8 @@
         self.read_only = 'read_only' in options
         self.update_msg = 'update_msg' in options
 
-        indices = (-1, -1, 0, -1) if self.read_only else (0, 1, 2, 3)
-        self.title_offset, self.toolbar_offset, self.content_offset, self.command_offset = indices
+        indices = (-1, -1, 0, -1, -1) if self.read_only else (0, 1, 2, 3, 4)
+        self.title_offset, self.toolbar_offset, self.content_offset, self.tags_offset, self.command_offset = indices
         self.addStyleName(self.STYLE['main'])
 
         editor_widget.BaseTextEditor.__init__(self, content, None, modifiedCb, afterEditCb)
@@ -117,6 +120,13 @@
             self.getFlexCellFormatter().setColSpan(self.title_offset, 0, 2)
             self.setWidget(self.title_offset, 0, self.title_panel)
 
+        if not self.read_only and not hasattr(self, 'tags'):
+            suggested_tags = []  # TODO: feed this list with tags suggestion
+            tags = []  # TODO: feed this list with tags already assigned to this message
+            self.tags = list_manager.TagsPanel(suggested_tags, tags)
+            self.getFlexCellFormatter().setColSpan(self.tags_offset, 0, 2)
+            self.setWidget(self.tags_offset, 0, self.tags)
+
         if not self.read_only and not hasattr(self, 'command'):
             self.command = HorizontalPanel()
             self.command.addStyleName("marginAuto")