comparison src/browser/sat_browser/blog.py @ 762:8eeb98659de2

browser_side (blog): tags were not read when receiving a message
author souliane <souliane@mailoo.org>
date Tue, 24 Nov 2015 23:28:55 +0100
parents e69f411c16a5
children 063385cbbfc2
comparison
equal deleted inserted replaced
761:e69f411c16a5 762:8eeb98659de2
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. 18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 19
20 import pyjd # this is dummy in pyjs 20 import pyjd # this is dummy in pyjs
21 from sat.core.log import getLogger 21 from sat.core.log import getLogger
22 log = getLogger(__name__) 22 log = getLogger(__name__)
23 23 from sat.tools import common
24 from sat.core.i18n import _ #, D_ 24 from sat.core.i18n import _ #, D_
25 25
26 from pyjamas.ui.SimplePanel import SimplePanel 26 from pyjamas.ui.SimplePanel import SimplePanel
27 from pyjamas.ui.VerticalPanel import VerticalPanel 27 from pyjamas.ui.VerticalPanel import VerticalPanel
28 from pyjamas.ui.ScrollPanel import ScrollPanel 28 from pyjamas.ui.ScrollPanel import ScrollPanel
120 120
121 def _setBubble(self): 121 def _setBubble(self):
122 """Set the bubble displaying the initial content.""" 122 """Set the bubble displaying the initial content."""
123 content = {'text': self.item.content_xhtml if self.item.content_xhtml else self.item.content or '', 123 content = {'text': self.item.content_xhtml if self.item.content_xhtml else self.item.content or '',
124 'title': self.item.title_xhtml if self.item.title_xhtml else self.item.title or ''} 124 'title': self.item.title_xhtml if self.item.title_xhtml else self.item.title or ''}
125 common.iter2dict('tag', self.item.tags, content)
125 126
126 if self.mode == C.ENTRY_MODE_TEXT: 127 if self.mode == C.ENTRY_MODE_TEXT:
127 # assume raw text message have no title 128 # assume raw text message have no title
128 self.bubble = editor_widget.LightTextEditor(content, modifiedCb=self._modifiedCb, afterEditCb=self._afterEditCb, options={'no_xhtml': True}) 129 self.bubble = editor_widget.LightTextEditor(content, modifiedCb=self._modifiedCb, afterEditCb=self._afterEditCb, options={'no_xhtml': True})
129 elif self.mode in ENTRY_RICH: 130 elif self.mode in ENTRY_RICH:
255 # TODO: if the user change his parameters after the message edition started, 256 # TODO: if the user change his parameters after the message edition started,
256 # the message syntax could be different then the current syntax: pass the 257 # the message syntax could be different then the current syntax: pass the
257 # message syntax in mb_data for the frontend to use it instead of current syntax. 258 # message syntax in mb_data for the frontend to use it instead of current syntax.
258 self.item.content_rich = content['text'] 259 self.item.content_rich = content['text']
259 self.item.title = content['title'] 260 self.item.title = content['title']
260 self.item.tags = quick_blog.mbdata2tags(content) 261 self.item.tags = list(common.dict2iter('tag', content))
261 else: 262 else:
262 self.item.content = content['text'] 263 self.item.content = content['text']
263 264
264 self.send() 265 self.send()
265 266