From 1ff86c03a6c7d15e9679fdd0f1e2bc8c9066f56b Mon Sep 17 00:00:00 2001 From: Aditi Mittal Date: Sat, 7 Sep 2013 12:06:35 +0530 Subject: [PATCH] Write on the template when there is no blog for the user. --- .../mediagoblin/blog/list_of_blogs.html | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/mediagoblin/media_types/blog/templates/mediagoblin/blog/list_of_blogs.html b/mediagoblin/media_types/blog/templates/mediagoblin/blog/list_of_blogs.html index a362c7ac..c1eed9e4 100644 --- a/mediagoblin/media_types/blog/templates/mediagoblin/blog/list_of_blogs.html +++ b/mediagoblin/media_types/blog/templates/mediagoblin/blog/list_of_blogs.html @@ -21,24 +21,28 @@ {% block mediagoblin_head%} {% endblock %} {% block mediagoblin_content %} + {% if blogs%} {% for blog in blogs %} - {% set my_blog_url = request.urlgen('mediagoblin.media_types.blog.blog-dashboard', - blog_slug=blog.slug, user=request.user.username) %} {% set others_blog_url = request.urlgen('mediagoblin.media_types.blog.blog_post_listing', - blog_slug=blog.slug, user=url_user) %} - {% if request.user.username == url_user%} + blog_slug=blog.slug, user=user.username) %} + {% if not request.user or request.user.username != user%} + {{ blog.title }} + {% else %} + {% set my_blog_url = request.urlgen('mediagoblin.media_types.blog.blog-dashboard', + blog_slug=blog.slug, user=request.user.username) %} {{ blog.title }} - {% else %} - {{ blog.title }} {% endif %}
{% endfor %} + {% else %} +

No blog has been created yet.

+ {% endif %}
{% endblock mediagoblin_content %} -- 2.25.1