Commits

Anonymous committed b4fb217

Fixed #139, config for reddit

  • Participants
  • Parent commits 15575ca

Comments (0)

Files changed (4)

File zine/config.py

     'plugins':                  CommaSeparated(TextField(), default=list),
 
     # importer settings
-    'blogger_auth_token':       TextField(default=u'')
+    'blogger_auth_token':       TextField(default=u''),
+
+    #admin settings
+    'dashboard_reddit':         BooleanField(default=True)
 }
 
 HIDDEN_KEYS = set(('iid', 'secret_key', 'blogger_auth_token',

File zine/shared/admin/style.css

     clear: both;
 }
 
+div.dashboard div.clear {
+    clear: both;
+}
+
 div.dashboard div.reddit div.table {
     width: 100%;
     margin: 5px 0 0 0;

File zine/templates/admin/index.html

       </ul>
       {% endif %}
     </div>
+    {% if show_reddit %}
     <div class="reddit">
       <h2>{{ _('Zine at Reddit') }}</h2>
       <p>{% trans reddit='<a href="http://www.reddit.com/r/zine/">reddit</a>' %}
 	$('<div>').load('?load=reddit').appendTo('div.reddit');
       </script>
     </div>
+    {% endif %}
+    <div class="clear"></div>
   </div>
 {% endblock %}

File zine/views/admin.py

             Post.author_id == request.user.id
         ).count(),
         last_posts=Post.query.published(ignore_privileges=True)
-            .order_by(Post.pub_date.desc()).limit(5).all()
+            .order_by(Post.pub_date.desc()).limit(5).all(),
+        show_reddit = request.app.cfg['dashboard_reddit']
     )