From: Aditi Mittal Date: Sat, 7 Sep 2013 06:36:35 +0000 (+0530) Subject: Write on the template when there is no blog for the user. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=1ff86c03a6c7d15e9679fdd0f1e2bc8c9066f56b;p=mediagoblin.git Write on the template when there is no blog for the user. --- 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 %}