diff --git a/i18n/en.po b/i18n/en.po
index 9a62e4077c9cddee5a120685767df3d2546ffc26_aTE4bi9lbi5wbw==..6be9ba4a4f14fe28ce68b2c2787712e428b40e84_aTE4bi9lbi5wbw== 100644
--- a/i18n/en.po
+++ b/i18n/en.po
@@ -52,9 +52,6 @@
 msgid "blog's rss url (useful for when using external site such as feedburner)"
 msgstr ""
 
-msgid "blog_latest_box"
-msgstr "latest blogs"
-
 msgid "blogged in "
 msgstr ""
 
@@ -67,7 +64,13 @@
 msgid "boxes_blog_archives_box_description"
 msgstr "box displaying latest blog entries posted"
 
-msgid "boxes_blog_latest_box"
-msgstr "box displaying latest blog entries posted"
+msgid "boxes_blog_summary_box"
+msgstr "posts by author"
+
+msgid "boxes_blog_summary_box_description"
+msgstr "this box contains a list of authors with the number of blog entries they posted"
+
+msgid "boxes_latest_blogs_box"
+msgstr "latest blogs"
 
 # add related box generated message
@@ -72,13 +75,7 @@
 
 # add related box generated message
-msgid "boxes_blog_latest_box_description"
-msgstr "this box contains the latest posts"
-
-msgid "boxes_blog_summary_box"
-msgstr "Posts by author"
-
-msgid "boxes_blog_summary_box_description"
-msgstr "this box contains a list of authors with the number of posts"
+msgid "boxes_latest_blogs_box_description"
+msgstr "this box contains the latest blog entries posted"
 
 msgid "by"
 msgstr "by"
@@ -97,6 +94,12 @@
 
 msgctxt "BlogEntry"
 msgid "content_format"
+msgstr "format"
+
+msgid "contentnavigation_blogsubscribe"
+msgstr "blog subscribtion icon"
+
+msgid "contentnavigation_blogsubscribe_description"
 msgstr ""
 
 msgid "creating BlogEntry (BlogEntry entry_of Blog %(linkto)s)"
@@ -111,7 +114,7 @@
 
 msgctxt "Blog"
 msgid "description_format"
-msgstr ""
+msgstr "format"
 
 msgid "draft"
 msgstr ""
@@ -123,7 +126,7 @@
 
 msgctxt "BlogEntry"
 msgid "entry_of"
-msgstr ""
+msgstr "blog entry of"
 
 msgctxt "Blog"
 msgid "entry_of_object"
@@ -127,6 +130,6 @@
 
 msgctxt "Blog"
 msgid "entry_of_object"
-msgstr ""
+msgstr "posts"
 
 msgid "entry_of_object"
@@ -131,6 +134,12 @@
 
 msgid "entry_of_object"
-msgstr "contains"
+msgstr "posts"
+
+msgid "latest_blogs_blog_box"
+msgstr "latest blogs"
+
+msgid "latest_blogs_box"
+msgstr "latest blogs"
 
 msgid "next month"
 msgstr ""
@@ -155,8 +164,8 @@
 
 msgctxt "Blog"
 msgid "rss_url"
-msgstr ""
+msgstr "rss feed url"
 
 msgid "see more"
 msgstr "see more"
 
@@ -159,7 +168,10 @@
 
 msgid "see more"
 msgstr "see more"
 
+msgid "see more archives"
+msgstr ""
+
 msgid "subscribe"
 msgstr "subscribe"
 
@@ -163,6 +175,9 @@
 msgid "subscribe"
 msgstr "subscribe"
 
+msgid "subscribe to this blog"
+msgstr ""
+
 msgid "tags"
 msgstr "tags"
 
@@ -173,18 +188,3 @@
 msgctxt "BlogEntry"
 msgid "title"
 msgstr ""
-
-#~ msgid "add a Blog"
-#~ msgstr "add a blog"
-
-#~ msgid "add a BlogEntry"
-#~ msgstr "add a blog entry"
-
-#~ msgid "more"
-#~ msgstr "more"
-
-#~ msgid "remove this Blog"
-#~ msgstr "remove this blog"
-
-#~ msgid "remove this BlogEntry"
-#~ msgstr "remove this blog entry"
diff --git a/i18n/es.po b/i18n/es.po
index 9a62e4077c9cddee5a120685767df3d2546ffc26_aTE4bi9lcy5wbw==..6be9ba4a4f14fe28ce68b2c2787712e428b40e84_aTE4bi9lcy5wbw== 100644
--- a/i18n/es.po
+++ b/i18n/es.po
@@ -51,9 +51,6 @@
 msgid "blog's rss url (useful for when using external site such as feedburner)"
 msgstr ""
 
-msgid "blog_latest_box"
-msgstr "últimos blogs"
-
 msgid "blogged in "
 msgstr ""
 
@@ -63,15 +60,9 @@
 msgid "boxes_blog_archives_box_description"
 msgstr "espacio hacia los archivos del blog en meses anteriores"
 
-msgid "boxes_blog_latest_box"
-msgstr "último"
-
-msgid "boxes_blog_latest_box_description"
-msgstr "espacio que contiene la lista de los últimos blogs"
-
 msgid "boxes_blog_summary_box"
 msgstr ""
 
 msgid "boxes_blog_summary_box_description"
 msgstr ""
 
@@ -72,9 +63,15 @@
 msgid "boxes_blog_summary_box"
 msgstr ""
 
 msgid "boxes_blog_summary_box_description"
 msgstr ""
 
+msgid "boxes_latest_blogs_box"
+msgstr "último"
+
+msgid "boxes_latest_blogs_box_description"
+msgstr "espacio que contiene la lista de los últimos blogs"
+
 msgid "by"
 msgstr "por"
 
@@ -94,6 +91,12 @@
 msgid "content_format"
 msgstr ""
 
+msgid "contentnavigation_blogsubscribe"
+msgstr ""
+
+msgid "contentnavigation_blogsubscribe_description"
+msgstr ""
+
 msgid "creating BlogEntry (BlogEntry entry_of Blog %(linkto)s)"
 msgstr "creación de una entrada de blog %(linkto)s"
 
@@ -127,6 +130,12 @@
 msgid "entry_of_object"
 msgstr "contiene las entradas"
 
+msgid "latest_blogs_blog_box"
+msgstr ""
+
+msgid "latest_blogs_box"
+msgstr "últimos blogs"
+
 msgid "next month"
 msgstr ""
 
@@ -155,6 +164,9 @@
 msgid "see more"
 msgstr "ver más"
 
+msgid "see more archives"
+msgstr ""
+
 msgid "subscribe"
 msgstr "suscribirse"
 
@@ -158,6 +170,9 @@
 msgid "subscribe"
 msgstr "suscribirse"
 
+msgid "subscribe to this blog"
+msgstr ""
+
 msgid "tags"
 msgstr "palabras clave"
 
diff --git a/i18n/fr.po b/i18n/fr.po
index 9a62e4077c9cddee5a120685767df3d2546ffc26_aTE4bi9mci5wbw==..6be9ba4a4f14fe28ce68b2c2787712e428b40e84_aTE4bi9mci5wbw== 100644
--- a/i18n/fr.po
+++ b/i18n/fr.po
@@ -33,7 +33,7 @@
 msgstr "Nouveau blog"
 
 msgid "New BlogEntry"
-msgstr "Nouveau  billet"
+msgstr "Nouveau billet"
 
 msgid "This Blog"
 msgstr "Ce blog"
@@ -47,10 +47,10 @@
 
 #, python-format
 msgid "blog entries created by %s"
-msgstr ""
+msgstr "billets créés par %s"
 
 msgid "blog's rss url (useful for when using external site such as feedburner)"
 msgstr ""
 "url du flux rss du blog (peut être utile lorsque l'on utilise un service tel "
 "que feedburner)"
 
@@ -51,13 +51,10 @@
 
 msgid "blog's rss url (useful for when using external site such as feedburner)"
 msgstr ""
 "url du flux rss du blog (peut être utile lorsque l'on utilise un service tel "
 "que feedburner)"
 
-msgid "blog_latest_box"
-msgstr "derniers blogs"
-
 msgid "blogged in "
 msgstr "bloggué dans "
 
 msgid "boxes_blog_archives_box"
@@ -60,8 +57,8 @@
 msgid "blogged in "
 msgstr "bloggué dans "
 
 msgid "boxes_blog_archives_box"
-msgstr "boîte d'archive des blogs"
+msgstr "archive des blogs"
 
 # subject and object forms for each relation type
 # (no object form for final relation types)
@@ -69,7 +66,13 @@
 msgid "boxes_blog_archives_box_description"
 msgstr "boîte permettant d'accéder aux archives des blogs pour les mois passés"
 
-msgid "boxes_blog_latest_box"
-msgstr "dernier"
+msgid "boxes_blog_summary_box"
+msgstr "billets par auteur"
+
+msgid "boxes_blog_summary_box_description"
+msgstr "boîte contenant la liste des auteurs et le nombre de billets"
+
+msgid "boxes_latest_blogs_box"
+msgstr "derniers billets"
 
 # add related box generated message
@@ -74,13 +77,7 @@
 
 # add related box generated message
-msgid "boxes_blog_latest_box_description"
-msgstr "boîte contentant la liste des derniers blogs"
-
-msgid "boxes_blog_summary_box"
-msgstr "blogs par auteur"
-
-msgid "boxes_blog_summary_box_description"
-msgstr "boîte contenant la liste des auteurs et le nombre de blogs"
+msgid "boxes_latest_blogs_box_description"
+msgstr "boîte contentant la liste des derniers billets postés"
 
 msgid "by"
 msgstr "par"
@@ -88,7 +85,7 @@
 # subject and object forms for each relation type
 # (no object form for final relation types)
 msgid "content"
-msgstr ""
+msgstr "contenu"
 
 msgctxt "BlogEntry"
 msgid "content"
@@ -92,6 +89,6 @@
 
 msgctxt "BlogEntry"
 msgid "content"
-msgstr ""
+msgstr "contenu"
 
 msgid "content_format"
@@ -96,6 +93,6 @@
 
 msgid "content_format"
-msgstr ""
+msgstr "format"
 
 msgctxt "BlogEntry"
 msgid "content_format"
@@ -99,9 +96,15 @@
 
 msgctxt "BlogEntry"
 msgid "content_format"
-msgstr ""
+msgstr "format"
+
+msgid "contentnavigation_blogsubscribe"
+msgstr "souscrire au blog"
+
+msgid "contentnavigation_blogsubscribe_description"
+msgstr "icône permettant de souscrire à un blog"
 
 msgid "creating BlogEntry (BlogEntry entry_of Blog %(linkto)s)"
 msgstr "création d'un billet dans le blog %(linkto)s"
 
 msgid "default BlogEntry workflow"
@@ -103,9 +106,9 @@
 
 msgid "creating BlogEntry (BlogEntry entry_of Blog %(linkto)s)"
 msgstr "création d'un billet dans le blog %(linkto)s"
 
 msgid "default BlogEntry workflow"
-msgstr ""
+msgstr "workflow des billets par défaut"
 
 msgctxt "Blog"
 msgid "description"
@@ -109,7 +112,7 @@
 
 msgctxt "Blog"
 msgid "description"
-msgstr ""
+msgstr "description"
 
 msgctxt "Blog"
 msgid "description_format"
@@ -113,7 +116,7 @@
 
 msgctxt "Blog"
 msgid "description_format"
-msgstr ""
+msgstr "format"
 
 msgid "draft"
 msgstr "brouillon"
@@ -125,7 +128,7 @@
 
 msgctxt "BlogEntry"
 msgid "entry_of"
-msgstr ""
+msgstr "dans le blog"
 
 msgctxt "Blog"
 msgid "entry_of_object"
@@ -129,6 +132,6 @@
 
 msgctxt "Blog"
 msgid "entry_of_object"
-msgstr ""
+msgstr "billets"
 
 msgid "entry_of_object"
@@ -133,6 +136,12 @@
 
 msgid "entry_of_object"
-msgstr "contient les entrées"
+msgstr "billets"
+
+msgid "latest_blogs_blog_box"
+msgstr "derniers billets dans ce blog"
+
+msgid "latest_blogs_box"
+msgstr "derniers billets"
 
 msgid "next month"
 msgstr "mois suivant"
@@ -157,8 +166,8 @@
 
 msgctxt "Blog"
 msgid "rss_url"
-msgstr ""
+msgstr "url du flux RSS"
 
 msgid "see more"
 msgstr "voir plus"
 
@@ -161,7 +170,10 @@
 
 msgid "see more"
 msgstr "voir plus"
 
+msgid "see more archives"
+msgstr "voir plus d'archives"
+
 msgid "subscribe"
 msgstr "souscrire"
 
@@ -165,8 +177,11 @@
 msgid "subscribe"
 msgstr "souscrire"
 
+msgid "subscribe to this blog"
+msgstr "souscrire à ce blog"
+
 msgid "tags"
 msgstr "étiquettes"
 
 msgctxt "Blog"
 msgid "title"
@@ -168,9 +183,9 @@
 msgid "tags"
 msgstr "étiquettes"
 
 msgctxt "Blog"
 msgid "title"
-msgstr ""
+msgstr "titre"
 
 msgctxt "BlogEntry"
 msgid "title"
@@ -174,19 +189,4 @@
 
 msgctxt "BlogEntry"
 msgid "title"
-msgstr ""
-
-#~ msgid "add a Blog"
-#~ msgstr "ajouter un blog"
-
-#~ msgid "add a BlogEntry"
-#~ msgstr "ajouter un billet"
-
-#~ msgid "blog entries created by %s %s"
-#~ msgstr "billets créés par %s %s"
-
-#~ msgid "remove this Blog"
-#~ msgstr "supprimer ce blog"
-
-#~ msgid "remove this BlogEntry"
-#~ msgstr "supprimer cette entrée de blog"
+msgstr "titre"
diff --git a/views/boxes.py b/views/boxes.py
new file mode 100644
index 0000000000000000000000000000000000000000..6be9ba4a4f14fe28ce68b2c2787712e428b40e84_dmlld3MvYm94ZXMucHk=
--- /dev/null
+++ b/views/boxes.py
@@ -0,0 +1,101 @@
+"""Various blog boxes: archive, per author, etc...
+
+:organization: Logilab
+:copyright: 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
+"""
+__docformat__ = "restructuredtext en"
+_ = unicode
+
+from logilab.mtconverter import xml_escape
+
+from cubicweb.selectors import one_line_rset, implements
+from cubicweb.web.htmlwidgets import BoxLink, BoxWidget
+from cubicweb.web.views import boxes
+
+class BlogArchivesBox(boxes.BoxTemplate):
+    """blog side box displaying a Blog Archive"""
+    __regid__ = 'blog_archives_box'
+    title = _('boxes_blog_archives_box')
+    order = 35
+
+    def call(self, **kwargs):
+        """display blogs archive"""
+        # XXX turn into a selector
+        count_blogentry = self._cw.execute('Any COUNT(B) WHERE B is BlogEntry')
+        if count_blogentry[0][0] > 0:
+            box = BoxWidget(self._cw._(self.title), id=self.__regid__, islist=False)
+            box.append(boxes.BoxHtml(self._cw.view('blog_archive', None, maxentries=12)))
+            box.render(self.w)
+
+
+class BlogsByAuthorBox(boxes.BoxTemplate):
+    __regid__ = 'blog_summary_box'
+    title = _('boxes_blog_summary_box')
+    order = 36
+
+    def call(self, view=None, **kwargs):
+        box = BoxWidget(self._cw._(self.title), self.__regid__, islist=True)
+        rql = 'Any U, COUNT(B) GROUPBY U WHERE U is CWUser, ' \
+              'B is BlogEntry, B created_by U'
+        rset = self._cw.execute(rql)
+        for user in rset:
+            euser = self._cw.entity_from_eid(user[0])
+            box.append(BoxLink(self._cw.build_url('blogentry/%s' % euser.login),
+                                              u'%s [%s]' % (euser.name(),
+                                                            user[1])))
+        box.render(self.w)
+
+
+class LatestBlogsBox(boxes.BoxTemplate):
+    """display a box with latest blogs and rss"""
+    __regid__ = 'latest_blogs_box'
+    title = _('latest_blogs_box')
+    visible = True # enabled by default
+    order = 34
+    display_see_more_link = True
+
+    def latest_blogs_rset(self):
+        return self._cw.execute(
+            'Any X,T,CD ORDERBY CD DESC LIMIT 5 WHERE X is BlogEntry, '
+            'X title T, X creation_date CD')
+
+    def call(self, **kwargs):
+        # XXX turn into a selector
+        rset = self.latest_blogs_rset()
+        if not rset:
+            return
+        box = BoxWidget(self._cw._(self.title), self.__regid__, islist=True)
+        # TODO - get the date between brakets after link
+        # empty string for title argument to deactivate auto-title
+        for i in xrange(rset.rowcount):
+            entity = rset.get_entity(i, 0)
+            box.append(BoxLink(entity.absolute_url(), xml_escape(entity.dc_title())))
+        rqlst = rset.syntax_tree()
+        rqlst.set_limit(None)
+        rql = rqlst.as_string(kwargs=rset.args)
+        if self.display_see_more_link:
+            url = self._cw.build_url('view', rql=rql, page_size=10)
+            box.append(BoxLink(url,  u'[%s]' % self._cw._(u'see more')))
+        rss_icon = self._cw.external_resource('RSS_LOGO_16')
+        # FIXME - could use rss_url defined as a property if available
+        rss_label = u'%s <img src="%s" alt="%s"/>' % (
+            self._cw._(u'subscribe'), rss_icon, self._cw._('rss icon'))
+        rss_url = self._cw.build_url('view', vid='rss', rql=rql)
+        box.append(BoxLink(rss_url, rss_label))
+        box.render(self.w)
+
+
+class LatestBlogsBlogBox(LatestBlogsBox):
+    """display a box with latest blogs and rss, filtered for a particular blog
+    """
+    __select__ = LatestBlogsBox.__select__ & one_line_rset() & implements('Blog')
+    title = _('latest_blogs_blog_box')
+    display_see_more_link = False
+
+    def latest_blogs_rset(self):
+        blog = self.cw_rset.get_entity(self.cw_row or 0, self.cw_col or 0)
+        return self._cw.execute(
+            'Any X,T,CD ORDERBY CD DESC LIMIT 5 WHERE X is BlogEntry, '
+            'X title T, X creation_date CD, X entry_of B, B eid %(b)s',
+            {'b': blog.eid})
diff --git a/views/primary.py b/views/primary.py
index 9a62e4077c9cddee5a120685767df3d2546ffc26_dmlld3MvcHJpbWFyeS5weQ==..6be9ba4a4f14fe28ce68b2c2787712e428b40e84_dmlld3MvcHJpbWFyeS5weQ== 100644
--- a/views/primary.py
+++ b/views/primary.py
@@ -6,8 +6,7 @@
 """
 __docformat__ = "restructuredtext en"
 
-
 from logilab.mtconverter import xml_escape
 
 from cubicweb.utils import UStringIO
 from cubicweb.selectors import implements
@@ -10,7 +9,7 @@
 from logilab.mtconverter import xml_escape
 
 from cubicweb.utils import UStringIO
 from cubicweb.selectors import implements
-from cubicweb.web import uicfg
-from cubicweb.web.views import primary
+from cubicweb.web import uicfg, component
+from cubicweb.web.views import primary, workflow
 
@@ -16,8 +15,8 @@
 
-uicfg.primaryview_section.tag_attribute(('Blog', 'title'), 'hidden')
-uicfg.primaryview_section.tag_attribute(('Blog', 'rss_url'), 'hidden')
-uicfg.primaryview_section.tag_attribute(('BlogEntry', 'title'), 'hidden')
-uicfg.primaryview_section.tag_object_of(('*', 'entry_of', 'Blog'), 'hidden')
-uicfg.primaryview_section.tag_subject_of(('BlogEntry', 'entry_of', '*'),
-                                         'relations')
+_pvs = uicfg.primaryview_section
+_pvs.tag_attribute(('Blog', 'title'), 'hidden')
+_pvs.tag_attribute(('Blog', 'rss_url'), 'hidden')
+_pvs.tag_attribute(('BlogEntry', 'title'), 'hidden')
+_pvs.tag_object_of(('*', 'entry_of', 'Blog'), 'hidden')
+_pvs.tag_subject_of(('BlogEntry', 'entry_of', '*'), 'relations')
 
@@ -23,7 +22,14 @@
 
-uicfg.actionbox_appearsin_addmenu.tag_object_of(('*', 'entry_of', 'Blog'), True)
+_pvdc = uicfg.primaryview_display_ctrl
+_pvdc.tag_attribute(('Blog', 'description'), {'showlabel': False})
+
+_abaa = uicfg.actionbox_appearsin_addmenu
+_abaa.tag_object_of(('*', 'entry_of', 'Blog'), True)
+
+_afs = uicfg.autoform_section
+_afs.tag_subject_of(('BlogEntry', 'entry_of', 'Blog'), 'main', 'attributes')
 
 
 class BlogPrimaryView(primary.PrimaryView):
     __select__ = implements('Blog')
 
@@ -25,17 +31,11 @@
 
 
 class BlogPrimaryView(primary.PrimaryView):
     __select__ = implements('Blog')
 
-    def render_entity_attributes(self, entity):
-        super(BlogPrimaryView, self).render_entity_attributes(entity)
-        self.w('<a class="right" href="%s">%s <img src="%s" alt="%s"/></a>' % (
-            xml_escape(entity.rss_feed_url()), self._cw._(u'subscribe'),
-            self._cw.external_resource('RSS_LOGO_16'), self._cw._('rss icon')))
-
     def render_entity_relations(self, entity):
         super(BlogPrimaryView, self).render_entity_relations(entity)
         rset = entity.related('entry_of', 'object')
         if rset:
             strio = UStringIO()
             self.paginate(self._cw, w=strio.write, page_size=10, rset=rset)
@@ -36,9 +36,10 @@
     def render_entity_relations(self, entity):
         super(BlogPrimaryView, self).render_entity_relations(entity)
         rset = entity.related('entry_of', 'object')
         if rset:
             strio = UStringIO()
             self.paginate(self._cw, w=strio.write, page_size=10, rset=rset)
-            self.wview('sameetypelist', rset)
+            self.w(strio.getvalue())
+            self.wview('sameetypelist', rset, showtitle=False)
             self.w(strio.getvalue())
 
@@ -43,10 +44,20 @@
             self.w(strio.getvalue())
 
-    def render_entity_title(self, entity):
-        self.w(u'<h1>%s</h1>' % xml_escape(entity.dc_title()))
+
+class SubscribeToBlogComponent(component.EntityVComponent):
+    __regid__ = 'blogsubscribe'
+    __select__ = component.EntityVComponent.__select__ & implements('Blog')
+    context = 'ctxtoolbar'
+
+    def cell_call(self, row, col, view):
+        entity = self.cw_rset.get_entity(row, col)
+        self.w('<a href="%s"><img src="%s" alt="%s"/></a>' % (
+            xml_escape(entity.rss_feed_url()),
+            self._cw.external_resource('RSS_LOGO_16'),
+            self._cw._(u'subscribe to this blog')))
 
 
 class BlogEntryPrimaryView(primary.PrimaryView):
     __select__ = implements('BlogEntry')
     show_attr_label = False
 
@@ -47,14 +58,11 @@
 
 
 class BlogEntryPrimaryView(primary.PrimaryView):
     __select__ = implements('BlogEntry')
     show_attr_label = False
 
-    def render_entity_title(self, entity):
-        self.w(u'<h1>%s</h1>' % xml_escape(entity.dc_title()))
-
     def render_entity_relations(self, entity):
         rset = entity.related('entry_of', 'subject')
         if rset:
             self.w(self._cw._('blogged in '))
             self.wview('csv', rset, 'null')
@@ -56,5 +64,13 @@
     def render_entity_relations(self, entity):
         rset = entity.related('entry_of', 'subject')
         if rset:
             self.w(self._cw._('blogged in '))
             self.wview('csv', rset, 'null')
+
+
+# don't show workflow history for blog entry
+class BlogEntryWFHistoryVComponent(workflow.WFHistoryVComponent):
+    __select__ = workflow.WFHistoryVComponent.__select__ & implements('BlogEntry')
+
+    def cell_call(self, row, col, view=None):
+        pass
diff --git a/views/secondary.py b/views/secondary.py
index 9a62e4077c9cddee5a120685767df3d2546ffc26_dmlld3Mvc2Vjb25kYXJ5LnB5..6be9ba4a4f14fe28ce68b2c2787712e428b40e84_dmlld3Mvc2Vjb25kYXJ5LnB5 100644
--- a/views/secondary.py
+++ b/views/secondary.py
@@ -13,10 +13,8 @@
 
 from cubicweb.schema import display_name
 from cubicweb.view import EntityView, StartupView
-from cubicweb.selectors import paginated_rset, sorted_rset, implements, \
-                               authenticated_user
-from cubicweb.web.htmlwidgets import BoxLink, BoxWidget
-from cubicweb.web.views import baseviews, boxes, calendar, navigation, workflow
+from cubicweb.selectors import paginated_rset, sorted_rset, implements
+from cubicweb.web.views import baseviews, calendar, navigation
 
 class BlogEntryArchiveView(StartupView):
     """control the view of a blog archive"""
@@ -36,10 +34,11 @@
         label = u'%s %s [%s]' % (self._cw._(calendar.MONTHNAMES[month-1]), year,
                                  nmb_entries)
         vtitle = '%s %s' % (display_name(self._cw, 'BlogEntry', 'plural'), label)
-        url = xml_escape(self._cw.build_url('view', rql=rql, month=month, year=year, vtitle=vtitle))
+        url = xml_escape(self._cw.build_url('view', rql=rql, month=month,
+                                            year=year, vtitle=vtitle))
         link = u'<a href="%s" title="">%s</a>' % (url, label)
         items.append( u'<li class="">%s</li>\n' % link )
 
     def call(self, maxentries=None, **kwargs):
         """display a list of entities by calling their <item_vid> view
         """
@@ -40,11 +39,11 @@
         link = u'<a href="%s" title="">%s</a>' % (url, label)
         items.append( u'<li class="">%s</li>\n' % link )
 
     def call(self, maxentries=None, **kwargs):
         """display a list of entities by calling their <item_vid> view
         """
-        rset = self._cw.execute('Any CD ORDERBY CD DESC WHERE B is BlogEntry, B creation_date CD')
-
+        rset = self._cw.execute('Any CD ORDERBY CD DESC WHERE B is BlogEntry, '
+                                'B creation_date CD')
         blogmonths = []
         items = []
         for (blogdate,) in rset:
@@ -61,7 +60,8 @@
             self.represent(items, year, month)
         if needmore:
             url = self._cw.build_url('view', vid='blog_archive')
-            link = u'<a href="%s" title="">[%s]</a>' % (url, self._cw._('see more archives'))
+            link = u'<a href="%s" title="">[%s]</a>' % (
+                url, self._cw._('see more archives'))
             items.append( u'<li class="">%s</li>\n' % link )
         self.w(u'<div class="boxFrame">')
         if items:
@@ -72,75 +72,5 @@
         self.w(u'</div>')
 
 
-class BlogEntryArchiveBox(boxes.BoxTemplate):
-    """blog side box displaying a Blog Archive"""
-    __regid__ = 'blog_archives_box'
-    title = _('boxes_blog_archives_box')
-    order = 35
-
-    def call(self, **kwargs):
-        """display blogs archive"""
-        # XXX turn into a selector
-        count_blogentry = self._cw.execute('Any COUNT(B) WHERE B is BlogEntry')
-        if count_blogentry[0][0] > 0:
-            box = BoxWidget(self._cw._(self.title), id=self.__regid__, islist=False)
-            box.append(boxes.BoxHtml(self._cw.view('blog_archive', None, maxentries=12)))
-            box.render(self.w)
-
-
-class BlogEntryListBox(boxes.BoxTemplate):
-    """display a box with latest blogs and rss"""
-    __regid__ = 'blog_latest_box'
-    title = _('blog_latest_box')
-    visible = True # enabled by default
-    order = 34
-
-    def call(self, view=None, **kwargs):
-        # XXX turn into a selector
-        rset = self._cw.execute('Any X,T,CD ORDERBY CD DESC LIMIT 5 '
-                                'WHERE X is BlogEntry, X title T, '
-                                'X creation_date CD')
-        if not rset:
-            return
-        box = BoxWidget(self._cw._(self.title), self.__regid__, islist=True)
-        # TODO - get the date between brakets after link
-        # empty string for title argument to deactivate auto-title
-        for i in xrange(rset.rowcount):
-            entity = rset.get_entity(i, 0)
-            box.append(BoxLink(entity.absolute_url(), xml_escape(entity.dc_title())))
-        rqlst = rset.syntax_tree()
-        rqlst.set_limit(None)
-        rql = rqlst.as_string(kwargs=rset.args)
-        url = self._cw.build_url('view', rql=rql, page_size=10)
-        box.append(BoxLink(url,  u'[%s]' % self._cw._(u'see more')))
-        rss_icon = self._cw.external_resource('RSS_LOGO_16')
-        # FIXME - could use rss_url defined as a property if available
-        rss_label = u'%s <img src="%s" alt="%s"/>' % (
-            self._cw._(u'subscribe'), rss_icon, self._cw._('rss icon'))
-        rss_url = self._cw.build_url('view', vid='rss', rql=rql)
-        box.append(BoxLink(rss_url, rss_label))
-        box.render(self.w)
-
-
-class BlogEntrySummary(boxes.BoxTemplate):
-    __regid__ = 'blog_summary_box'
-    title = _('boxes_blog_summary_box')
-    order = 36
-    __select__ = boxes.BoxTemplate.__select__
-
-    def call(self, view=None, **kwargs):
-        box = BoxWidget(self._cw._(self.title), self.__regid__, islist=True)
-        rql = 'Any U, COUNT(B) GROUPBY U WHERE U is CWUser, ' \
-              'B is BlogEntry, B created_by U'
-        rset = self._cw.execute(rql)
-        for user in rset:
-            euser = self._cw.entity_from_eid(user[0])
-            box.append(BoxLink(self._cw.build_url('blogentry/%s' % euser.login),
-                                              u'%s [%s]' % (euser.name(),
-                                                            user[1])))
-        box.render(self.w)
-
-## list views ##################################################################
-
 class BlogEntrySameETypeListView(baseviews.SameETypeListView):
     __select__ = baseviews.SameETypeListView.__select__ & implements('BlogEntry')
@@ -145,6 +75,7 @@
 class BlogEntrySameETypeListView(baseviews.SameETypeListView):
     __select__ = baseviews.SameETypeListView.__select__ & implements('BlogEntry')
-    countrql = 'Any COUNT(B) WHERE B is BlogEntry, B creation_date >=  %(firstday)s, B creation_date <= %(lastday)s'
+    countrql = ('Any COUNT(B) WHERE B is BlogEntry, '
+                'B creation_date >= %(firstday)s, B creation_date <= %(lastday)s')
     item_vid = 'blog'
 
     def call(self, **kwargs):
@@ -164,7 +95,6 @@
             year = year - 1
         else:
             previousmonth = month -1
-
         self.w(u'<div class="prevnext">')
         self.w(u'<span class="previousmonth">%s</span>' \
                % self.render_link(year, previousmonth,
@@ -177,5 +107,9 @@
     def render_link(self, year, month, atitle):
         firstday = datetime(year, month, 1)
         lastday = datetime(year, month, monthrange(year, month)[1])
+        args = {'firstday': firstday, 'lastday': lastday}
+        nmb_entries = self._cw.execute(self.countrql, args)[0][0]
+        if not nmb_entries:
+            return
         rql = ('Any B, BD ORDERBY BD DESC '
                'WHERE B is BlogEntry, B creation_date BD, '
@@ -180,4 +114,4 @@
         rql = ('Any B, BD ORDERBY BD DESC '
                'WHERE B is BlogEntry, B creation_date BD, '
-               'B creation_date >=  "%s", B creation_date <= "%s"' %
+               'B creation_date >= "%s", B creation_date <= "%s"' %
                 (firstday.strftime('%Y-%m-%d'), lastday.strftime('%Y-%m-%d')))
@@ -183,6 +117,4 @@
                 (firstday.strftime('%Y-%m-%d'), lastday.strftime('%Y-%m-%d')))
-        args = {'firstday':firstday, 'lastday':lastday}
-        nmb_entries = self._cw.execute(self.countrql, args)[0][0]
         label = u'%s %s [%s]' % (self._cw._(calendar.MONTHNAMES[month-1]), year,
                                  nmb_entries)
         vtitle = '%s %s' % (display_name(self._cw, 'BlogEntry', 'plural'), label)
@@ -186,14 +118,12 @@
         label = u'%s %s [%s]' % (self._cw._(calendar.MONTHNAMES[month-1]), year,
                                  nmb_entries)
         vtitle = '%s %s' % (display_name(self._cw, 'BlogEntry', 'plural'), label)
-        url = xml_escape(self._cw.build_url('view', rql=rql, vtitle=vtitle,
-                                        month=month, year=year))
-        if self._cw.execute(rql):
-            return u'<a href="%s" title="">%s</a>' % (url, atitle)
-        return u''
+        url = self._cw.build_url('view', rql=rql, vtitle=vtitle,
+                                 month=month, year=year)
+        return u'<a href="%s">%s</a>' % (xml_escape(url), atitle)
 
 
 class BlogEntryBlogView(EntityView):
     __regid__ = 'blog'
     __select__ = implements('BlogEntry')
 
@@ -194,10 +124,10 @@
 
 
 class BlogEntryBlogView(EntityView):
     __regid__ = 'blog'
     __select__ = implements('BlogEntry')
 
-    def cell_call(self, row, col):
+    def cell_call(self, row, col, **kwargs):
         entity = self.cw_rset.get_entity(row, col)
         w = self.w
         _ = self._cw._
@@ -257,12 +187,3 @@
 
     def index_display(self, start, stop):
         return u'%s' % (int(start / self.page_size)+1)
-
-
-# WFHistoryView ###############################################################
-
-class BlogEntryWFHistoryVComponent(workflow.WFHistoryVComponent):
-    __select__ = workflow.WFHistoryVComponent.__select__ & implements('BlogEntry')
-
-    def cell_call(self, row, col, view=None):
-        pass