diff --git a/.hgtags b/.hgtags index fdcedc52ee00af9a72448bfa2629a814fafdf0aa_LmhndGFncw==..ad2805a7fba9cf11f1e353b01ac21a0c92cfcc97_LmhndGFncw== 100644 --- a/.hgtags +++ b/.hgtags @@ -4,3 +4,5 @@ de2fb8748325126a71d2e5fb7281d7d369671523 cubicweb-blog-version-1_5_1 8ff850ca6c92e9080cf07d851a208d1ccf8bf6df cubicweb-blog-version-1_6_0 ffcbea1d83c5fe59d2f2d5ed38afa0405e293bb2 cubicweb-blog-debian-version-1_6_0-1 +9986e23c77281095393351f2f41bbd4cb8226e2f cubicweb-blog-version-1_6_1 +a340f645ae0ff25bf1a9049b27630ba8f8da0d4c cubicweb-blog-debian-version-1_6_1-1 diff --git a/__pkginfo__.py b/__pkginfo__.py index fdcedc52ee00af9a72448bfa2629a814fafdf0aa_X19wa2dpbmZvX18ucHk=..ad2805a7fba9cf11f1e353b01ac21a0c92cfcc97_X19wa2dpbmZvX18ucHk= 100644 --- a/__pkginfo__.py +++ b/__pkginfo__.py @@ -4,7 +4,7 @@ distname = "cubicweb-blog" modname = distname.split('-', 1)[1] -numversion = (1, 6, 0) +numversion = (1, 6, 1) version = '.'.join(str(num) for num in numversion) license = 'LGPL' diff --git a/debian/changelog b/debian/changelog index fdcedc52ee00af9a72448bfa2629a814fafdf0aa_ZGViaWFuL2NoYW5nZWxvZw==..ad2805a7fba9cf11f1e353b01ac21a0c92cfcc97_ZGViaWFuL2NoYW5nZWxvZw== 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +cubicweb-blog (1.6.1-1) unstable; urgency=low + + * new upstream release + + -- Sylvain Thénault <sylvain.thenault@logilab.fr> Tue, 23 Jun 2009 17:40:17 +0200 + cubicweb-blog (1.6.0-1) unstable; urgency=low * new upstream release depending on cubicweb 3.2 diff --git a/views.py b/views.py index fdcedc52ee00af9a72448bfa2629a814fafdf0aa_dmlld3MucHk=..ad2805a7fba9cf11f1e353b01ac21a0c92cfcc97_dmlld3MucHk= 100644 --- a/views.py +++ b/views.py @@ -72,9 +72,11 @@ (firstday.strftime('%Y-%m-%d'), lastday.strftime('%Y-%m-%d'))) args = {'firstday':firstday, 'lastday':lastday} nmb_entries = self.req.execute(self.countrql, args)[0][0] - label = u'%s %s [%s]' % (_(calendar.MONTHNAMES[month-1]), year, nmb_entries) - vtitle = '%s %s' % (_('BlogEntry_plural'), label) - url = html_escape(self.build_url('view', rql=rql, vtitle=vtitle, vid='full_list')) + label = u'%s %s [%s]' % (self.req._(calendar.MONTHNAMES[month-1]), year, + nmb_entries) + vtitle = '%s %s' % (self.req._('BlogEntry_plural'), label) + url = html_escape(self.build_url('view', rql=rql, vtitle=vtitle, + vid='full_list')) link = u'<a href="%s" title="">%s</a>' % (url, label) items.append( u'<li class="">%s</li>\n' % link ) @@ -118,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') @@ -121,4 +124,2 @@ count_blogentry = self.req.execute('Any COUNT(B) WHERE B is BlogEntry') - _ = self.req._ - if count_blogentry[0][0] > 0: @@ -124,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) @@ -135,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 @@ -139,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): @@ -148,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... - url = self.build_url('view', vid='boxListing', rql=rql, page_size=10) + 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"/>' % ( @@ -153,8 +155,8 @@ 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) @@ -162,5 +164,6 @@ ## list views ################################################################# -class BlogEntryListView(baseviews.ListView): +class BlogEntryListItemView(baseviews.ListItemView): + id = 'full_list' __select__ = implements('BlogEntry') @@ -166,2 +169,3 @@ __select__ = implements('BlogEntry') + redirect_vid = 'blog' @@ -167,6 +171,6 @@ - def call(self, klass='invisible', title=None, **kwargs): + def call(self, **kwargs): """display a list of entities by calling their <item_vid> view """ entity = self.entity(0,0) self.req.add_css('cubes.blog.css') @@ -169,8 +173,6 @@ """display a list of entities by calling their <item_vid> view """ entity = self.entity(0,0) self.req.add_css('cubes.blog.css') - # XXX: no title if subvid specified to try to avoid cases where we want - # the original list view... - if title is None and not ('vtitle' in self.req.form or 'subvid' in kwargs): + if not 'vtitle' in self.req.form: self.w(u'<h1>%s</h1>' % display_name(self.req, 'BlogEntry', form='plural')) @@ -176,11 +178,5 @@ self.w(u'<h1>%s</h1>' % display_name(self.req, 'BlogEntry', form='plural')) - super(BlogEntryListView, self).call(klass=klass, **kwargs) - - -class BlogEntryListItemView(baseviews.ListItemView): - id = 'full_list' - __select__ = implements('BlogEntry') - redirect_vid = 'blog' + super(BlogEntryListItemView, self).call(**kwargs) class BlogEntryBlogView(baseviews.ListItemView):