Commits

Alessandro Molina  committed 6d3b809

Add pagination to articles management

  • Participants
  • Parent commits f716668

Comments (0)

Files changed (2)

File smallpress/controllers/root.py

 """Main Controller"""
 from tg import TGController
 from tg import expose, flash, require, url, lurl, request, redirect, validate, tmpl_context, config
-from tg.decorators import before_render, cached_property
+from tg.decorators import before_render, cached_property, paginate
 from tg.i18n import ugettext as _, lazy_ugettext as l_
 
 try:
 
     @require(predicates.in_group('smallpress'))
     @expose('genshi:smallpress.templates.manage')
+    @paginate('articles')
     def manage(self, blog='', *args, **kw):
         articles = Article.get_all(blog)
         return dict(table=articles_table, articles=articles,

File smallpress/templates/manage.html

         <h1>Articles</h1>
     </div>
     ${table.display(articles)}
+    <div>
+        ${tmpl_context.paginators.articles.pager()}
+    </div>
 </div>
 </body>
 </html>