diff --git a/views.py b/views.py index 9986e23c77281095393351f2f41bbd4cb8226e2f_dmlld3MucHk=..8e533ff838babb57f379e88490685db30e8780ed_dmlld3MucHk= 100644 --- a/views.py +++ b/views.py @@ -120,4 +120,5 @@ def call(self, **kwargs): """display blogs archive""" + # XXX turn into a selector count_blogentry = self.req.execute('Any COUNT(B) WHERE B is BlogEntry') @@ -123,4 +124,2 @@ count_blogentry = self.req.execute('Any COUNT(B) WHERE B is BlogEntry') - _ = self.req._ - if count_blogentry[0][0] > 0: @@ -126,5 +125,5 @@ if count_blogentry[0][0] > 0: - box = BoxWidget(_(self.title), id=self.id, islist=False) + box = BoxWidget(self.req._(self.title), id=self.id, islist=False) box.append(boxes.BoxHtml(self.view('blog_archive', None, maxentries=12))) box.render(self.w) @@ -137,9 +136,9 @@ order = 34 def call(self, view=None, **kwargs): - box = BoxWidget(self.req._(self.title), self.id, islist=True) + # XXX turn into a selector rset = self.req.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 @@ -141,8 +140,9 @@ rset = self.req.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.req._(self.title), self.id, 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): @@ -150,9 +150,9 @@ box.append(BoxLink(entity.absolute_url(), html_escape(entity.dc_title()))) rqlst = rset.syntax_tree() rqlst.set_limit(None) - rql = rqlst.as_string(kwargs=rset.args) # en gros... + rql = rqlst.as_string(kwargs=rset.args) url = self.build_url('view', vid='full_list', rql=rql, page_size=10) box.append(BoxLink(url, u'[%s]' % self.req._(u'see more'))) rss_icon = self.req.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"/>' % ( @@ -154,9 +154,9 @@ url = self.build_url('view', vid='full_list', rql=rql, page_size=10) box.append(BoxLink(url, u'[%s]' % self.req._(u'see more'))) rss_icon = self.req.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.req._(u'subscribe'), rss_icon, self.req._('rss icon')) + self.req._(u'subscribe'), rss_icon, self.req._('rss icon')) rss_url = self.build_url('view', vid='rss', rql=rql) box.append(BoxLink(rss_url, rss_label)) box.render(self.w)