コード例 #1
0
ファイル: uimodules.py プロジェクト: ling0322/blogmajo
 def render(self, blog):
     blog['base64-category'] = self.base64_encode(blog['category'])
     author = meidodb.get_siteinfo('username')
     comments_count = len(meidodb.get_comment_by_entry(blog['id']))
     return self.render_string(
         "blogentry.html",
         comments_count = comments_count, 
         blog = blog, 
         author = author,
         date = time.strftime('%d', blog['create_time']),
         month = time.strftime('%b', blog['create_time']))
コード例 #2
0
ファイル: uimodules.py プロジェクト: ling0322/blogmajo
 def render(self, blog):
     blog['base64-category'] = self.base64_encode(blog['category'])
     author = meidodb.get_siteinfo('username')
     comments_count = len(meidodb.get_comment_by_entry(blog['id']))
     return self.render_string("blogentry.html",
                               comments_count=comments_count,
                               blog=blog,
                               author=author,
                               date=time.strftime('%d',
                                                  blog['create_time']),
                               month=time.strftime('%b',
                                                   blog['create_time']))
コード例 #3
0
ファイル: uimodules.py プロジェクト: ling0322/blogmajo
 def render(self, entry_id):
     comments = meidodb.get_comment_by_entry(entry_id)
     if 0 == len(comments):
         return '<p class="nocomments">No Comments.</p>'
     else:
         count = 1
         render_str_list = []
         for comment in comments:
             render_str_list.append(self.render_string(
                 'comment.html',
                 comment = comment,
                 time = time.strftime('%B %d, %Y at %I:%M %p', comment['comment_time']),
                 floor = count))
             count = count + 1
         entry = meidodb.get_entry(entry_id)
         h3_str = '<h3 id="comments-wrap">{0} Comments to "{1}"</h3>'.format(len(render_str_list), entry['title'])
         return h3_str + '<ol class="commentlist">' + ''.join(render_str_list) + '</ol>'
コード例 #4
0
ファイル: uimodules.py プロジェクト: ling0322/blogmajo
 def render(self, entry_id):
     comments = meidodb.get_comment_by_entry(entry_id)
     if 0 == len(comments):
         return '<p class="nocomments">No Comments.</p>'
     else:
         count = 1
         render_str_list = []
         for comment in comments:
             render_str_list.append(
                 self.render_string('comment.html',
                                    comment=comment,
                                    time=time.strftime(
                                        '%B %d, %Y at %I:%M %p',
                                        comment['comment_time']),
                                    floor=count))
             count = count + 1
         entry = meidodb.get_entry(entry_id)
         h3_str = '<h3 id="comments-wrap">{0} Comments to "{1}"</h3>'.format(
             len(render_str_list), entry['title'])
         return h3_str + '<ol class="commentlist">' + ''.join(
             render_str_list) + '</ol>'