comparison src/server/blog.py @ 831:25931797db20

server (blog/themes): sanitize tags + display tags URLs
author souliane <souliane@mailoo.org>
date Sat, 09 Jan 2016 13:00:31 +0100
parents a825700c01e4
children 330db23d4a44
comparison
equal deleted inserted replaced
830:a825700c01e4 831:25931797db20
589 self.url = "{}/{}".format(base_url, _quote(entry['id'])) 589 self.url = "{}/{}".format(base_url, _quote(entry['id']))
590 query_data = getDefaultQueryData(request) 590 query_data = getDefaultQueryData(request)
591 if query_data: 591 if query_data:
592 self.url += '?{}'.format(urllib.urlencode(query_data)) 592 self.url += '?{}'.format(urllib.urlencode(query_data))
593 self.title = self.getText(entry, 'title') 593 self.title = self.getText(entry, 'title')
594 self.tags = list(common.dict2iter('tag', entry)) 594 self.tags = [sanitizeHtml(tag) for tag in common.dict2iter('tag', entry)]
595 595
596 count_text = lambda count: D_('comments') if count > 1 else D_('comment') 596 count_text = lambda count: D_('comments') if count > 1 else D_('comment')
597 597
598 self.comments_text = u"{} {}".format(comments_count, count_text(comments_count)) 598 self.comments_text = u"{} {}".format(comments_count, count_text(comments_count))
599 599