From: Aditi Mittal Date: Sat, 21 Sep 2013 04:46:13 +0000 (+0530) Subject: some fixes X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=8189f6c7667c728cd8e6b83a5e30958328543b4f;p=mediagoblin.git some fixes --- diff --git a/mediagoblin/media_types/blog/__init__.py b/mediagoblin/media_types/blog/__init__.py index 0f87591b..8a61c6e0 100644 --- a/mediagoblin/media_types/blog/__init__.py +++ b/mediagoblin/media_types/blog/__init__.py @@ -81,10 +81,7 @@ def setup_plugin(): ('mediagoblin.media_types.blog.blog_about', '/u//b//about/', 'mediagoblin.media_types.blog.views:blog_about_view' - ) - - - ] + )] pluginapi.register_routes(routes) diff --git a/mediagoblin/media_types/blog/config_spec.ini b/mediagoblin/media_types/blog/config_spec.ini index e0a6844e..77038f47 100644 --- a/mediagoblin/media_types/blog/config_spec.ini +++ b/mediagoblin/media_types/blog/config_spec.ini @@ -1,2 +1,2 @@ [plugin_spec] -max_blog_count = integer(default=1) +max_blog_count = integer(default=4) diff --git a/mediagoblin/media_types/blog/templates/mediagoblin/blog/blog_admin_dashboard.html b/mediagoblin/media_types/blog/templates/mediagoblin/blog/blog_admin_dashboard.html index c364d8ad..1316083b 100644 --- a/mediagoblin/media_types/blog/templates/mediagoblin/blog/blog_admin_dashboard.html +++ b/mediagoblin/media_types/blog/templates/mediagoblin/blog/blog_admin_dashboard.html @@ -99,7 +99,7 @@ blog_slug=blog_slug, user=user.username) %}

- {% trans %} Go to blog post list view {% endtrans %} + {% trans %} Go to list view {% endtrans %} {% else %} {% trans %} No blog post yet. {% endtrans %} {% endif %} diff --git a/mediagoblin/media_types/blog/templates/mediagoblin/blog/blog_post_listing.html b/mediagoblin/media_types/blog/templates/mediagoblin/blog/blog_post_listing.html index a7283985..3ec84006 100644 --- a/mediagoblin/media_types/blog/templates/mediagoblin/blog/blog_post_listing.html +++ b/mediagoblin/media_types/blog/templates/mediagoblin/blog/blog_post_listing.html @@ -36,7 +36,7 @@ {%- endblock %} {% block mediagoblin_content %} -

{{ blog_owner }} 's Blog

+

{{ blog.title }} by {{ blog_owner }}

{% for post in blog_posts %} +
+
+ {% set blog_about_url = request.urlgen('mediagoblin.media_types.blog.blog_about', + blog_slug=blog.slug, user=blog_owner) %} +
About Blog +
{{ render_pagination(request, pagination) }} {% endblock %} 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 3785e1c3..f19a9225 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 @@ -27,20 +27,19 @@ {% endblock %} {% block mediagoblin_content %} -{% set blog_create_url = request.urlgen('mediagoblin.media_types.blog.create', - user=request.user.username) %} {% if blogs %}

My Blogs

{% for blog in blogs %} {% set others_blog_url = request.urlgen('mediagoblin.media_types.blog.blog_post_listing', blog_slug=blog.slug, user=user.username) %} - {% set my_blog_url = request.urlgen('mediagoblin.media_types.blog.blog-dashboard', - blog_slug=blog.slug, user=request.user.username) %} + {% if not request.user or request.user.username != user.username%} {% else %} + {% set my_blog_url = request.urlgen('mediagoblin.media_types.blog.blog-dashboard', + blog_slug=blog.slug, user=request.user.username) %} {% endif %} @@ -60,6 +59,9 @@

{% if blogs.__len__() {% trans %}Create a Blog{% endtrans %} {% endif %} diff --git a/mediagoblin/media_types/blog/views.py b/mediagoblin/media_types/blog/views.py index 85e4416c..aefbe52a 100644 --- a/mediagoblin/media_types/blog/views.py +++ b/mediagoblin/media_types/blog/views.py @@ -270,7 +270,8 @@ def blog_post_listing(request, page): 'mediagoblin/blog/blog_post_listing.html', {'blog_posts': blog_posts_on_a_page, 'pagination': pagination, - 'blog_owner': blog_owner + 'blog_owner': blog_owner, + 'blog':blog }) @require_active_login @@ -346,7 +347,6 @@ def blog_about_view(request): if not user or not blog: return render_404(request) - else: blog_posts_processed = blog.get_all_blog_posts(u'processed').count() return render_to_response(
{{ blog.title }}{{ blog.title }}