comparison src/server/blog.py @ 743:916075bd0356

server_side: display tags in static blogs
author souliane <souliane@mailoo.org>
date Sat, 21 Nov 2015 17:03:46 +0100
parents 9d35d75566fb
children 25984ca4aef2
comparison
equal deleted inserted replaced
742:d123e27fc386 743:916075bd0356
33 from sys import path 33 from sys import path
34 import uuid 34 import uuid
35 import re 35 import re
36 import os 36 import os
37 37
38 from sat_frontends.quick_frontend import quick_blog
38 from libervia.server.html_tools import sanitizeHtml, convertNewLinesToXHTML 39 from libervia.server.html_tools import sanitizeHtml, convertNewLinesToXHTML
39 from libervia.server.constants import Const as C 40 from libervia.server.constants import Const as C
40 41
41 42
42 NS_MICROBLOG = 'urn:xmpp:microblog:0' 43 NS_MICROBLOG = 'urn:xmpp:microblog:0'
466 self.author = (_("from %s") % entry['author']) 467 self.author = (_("from %s") % entry['author'])
467 else: 468 else:
468 self.author = '&nbsp;' 469 self.author = '&nbsp;'
469 self.url = (u"%s/%s" % (base_url, entry['id'])) 470 self.url = (u"%s/%s" % (base_url, entry['id']))
470 self.title = self.getText(entry, 'title') 471 self.title = self.getText(entry, 'title')
472 self.tags = quick_blog.mbdata2tags(entry)
471 473
472 count_text = lambda count: D_('comments') if count > 1 else D_('comment') 474 count_text = lambda count: D_('comments') if count > 1 else D_('comment')
473 475
474 self.comments_text = "%s %s" % (comments_count, count_text(comments_count)) 476 self.comments_text = "%s %s" % (comments_count, count_text(comments_count))
475 477