Add view button and create blog button on blogs dashboard.
authorAditi Mittal <aditi.iitr@gmail.com>
Wed, 18 Sep 2013 15:34:16 +0000 (21:04 +0530)
committerAditi Mittal <aditi.iitr@gmail.com>
Wed, 18 Sep 2013 15:34:16 +0000 (21:04 +0530)
mediagoblin/media_types/blog/templates/mediagoblin/blog/list_of_blogs.html

index f3c4efa50d1b396699d37571e457f080c64c93f9..3785e1c36aff99625f4f0228b0fc570574a39374 100644 (file)
 
 {% block mediagoblin_head%}
 <style type = "text/css">
-    tr > a { text-decoration:none; font-weight: bold; }
+    table a { text-decoration:none; font-weight: bold; text-transform:capitalize; }
+    #blogs_list {border-collapse:separate; border-spacing: 40px 0px ;}
 </style>
 {% endblock %}
 
 {% block mediagoblin_content %}
-
+{% set blog_create_url = request.urlgen('mediagoblin.media_types.blog.create',
+              user=request.user.username) %}
     {% if blogs %}
-        <table>
-        {% for blog in blogs %}
-            {% set others_blog_url = request.urlgen('mediagoblin.media_types.blog.blog_post_listing',
-                                              blog_slug=blog.slug, user=user.username) %}
-             {% if not request.user or request.user.username != user.username%}
-                    <tr><a href="{{ others_blog_url }}">{{ blog.title }}</a></tr>
-             {% else %}
-                    {% set my_blog_url = request.urlgen('mediagoblin.media_types.blog.blog-dashboard',
-                   blog_slug=blog.slug, user=request.user.username) %}
-                <tr><a href="{{ my_blog_url }}">{{ blog.title }}</a></tr>
-             {% endif %}
-             <br>
+        <h2>My Blogs</h2>
+        <table id="blogs_list">
+            {% 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) %}
+                <tr>
+                     {% if not request.user or request.user.username != user.username%}
+                            <td><a href="{{ others_blog_url }}">{{ blog.title }}</a></td>
+                     {% else %}
+                            <td><a href="{{ my_blog_url }}">{{ blog.title }}</a></td>
+                     {% endif %}
+                     <td>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</td>
+                     <td><a class="button_action" href="{{ others_blog_url }}">{% trans %}View{% endtrans %}</a></td>
+                 </tr>
+             {% endfor %}
          </table>
-        {% endfor %}
     {% else %}
 
         {% if request.user and request.user.username==user.username %}
             <p>You have not created any blog yet.</p>
-            {% set blog_create_url = request.urlgen('mediagoblin.media_types.blog.create',
-              user=request.user.username) %}
-          <a class="button_action" href="{{ blog_create_url }}">{% trans %}Create a Blog{% endtrans %}</a>
-          {% else %}
+        {% else %}
             <p>No blog has been created by <strong>{{ user.username }}</strong>yet.</p>
         {% endif %}
     {% endif %}
+    <br/>
+    <br/>
+    <br/>
+    {% if blogs.__len__() <max_blog_count and request.user and request.user.username==user.username %}
+        <a class="button_action" href="{{ blog_create_url }}">{% trans %}Create a Blog{% endtrans %}</a>
+    {% endif %}
 
 {% endblock mediagoblin_content %}