diff --git a/scribeengine/controllers/post.py b/scribeengine/controllers/post.py index 447fa94..0fce1ae 100644 --- a/scribeengine/controllers/post.py +++ b/scribeengine/controllers/post.py @@ -50,6 +50,10 @@ class PostController(BaseController): if id is None: h.redirect_to('/post/new') c.post = Session.query(Post).get(id) + if len(c.post.tags): + c.post.tags_list = u', '.join([tag.name for tag in c.post.tags]) + else: + c.post.tags_list = u'' c.page_title = 'Edit Post: %s' % c.post.title return render(u'/post/edit.mako') diff --git a/scribeengine/templates/blog/index.mako b/scribeengine/templates/blog/index.mako index 27c0921..ebbb6a4 100644 --- a/scribeengine/templates/blog/index.mako +++ b/scribeengine/templates/blog/index.mako @@ -8,14 +8,19 @@ ${h.literal(h.teaser(post.body))}

- Posted by ${post.user.nick} on ${post.created.strftime('%B %d, %Y')} - Read more + + Posted by ${post.user.nick} on ${post.created.strftime('%B %d, %Y')} +% if c.current_user and c.current_user.id == post.user.id and c.current_user.has_permission(u'Edit My Posts'): + [Edit] +% endif + + Read more % if len(post.comments) == 0: - No comments + No comments % elif len(post.comments) == 1: - 1 comment + 1 comment % else: - ${len(post.comments)} comments + ${len(post.comments)} comments % endif

diff --git a/scribeengine/templates/blog/view.mako b/scribeengine/templates/blog/view.mako index ae83e33..2c8dfaf 100644 --- a/scribeengine/templates/blog/view.mako +++ b/scribeengine/templates/blog/view.mako @@ -2,7 +2,12 @@ <%include file="/flash.mako"/>

${c.post.title}

-
Posted by ${c.post.user.nick} on ${c.post.created.strftime('%B %d, %Y')}
+
+ Posted by ${c.post.user.nick} on ${c.post.created.strftime('%B %d, %Y')} +% if c.current_user and c.current_user.id == c.post.user.id and c.current_user.has_permission(u'Edit My Posts'): + [Edit] +% endif +
${h.literal(c.post.body)}