# HG changeset patch # User sylvain.thenault@logilab.fr # Date 1235576528 -3600 # Wed Feb 25 16:42:08 2009 +0100 # Node ID 507d56857f85fe28266dbbc5ce1e5be1266c7048 # Parent 7ef8a8fe7e22395031f062d10a7fb9040634efdb cleanup, avoid duplicated id causing xhtml error diff --git a/views.py b/views.py --- a/views.py +++ b/views.py @@ -51,6 +51,7 @@ def cell_call(self, row, col): self.wview(self.item_vid, self.rset, row=row, col=col) + class SIOCBlogItemView(EntityView): id = 'sioc_item' accepts = ('Blog',) @@ -67,6 +68,7 @@ self.w(u'<dcterms:title>%s</dcterms:title>'% html_escape(unicode(entity.title))) self.w(u'<dcterms:created>%s</dcterms:created>'% entity.creation_date) self.w(u'<dcterms:modified>%s</dcterms:modified>' % entity.modification_date) + class SIOCItemView(SIOCBlogItemView): accepts = ('BlogEntry',) @@ -89,6 +91,7 @@ self.w(u'</sioc:User>\n') self.w(u'</sioc:has_creator>\n') self.w(u' </sioc:Post>\n') + class BlogPrimaryView(baseviews.PrimaryView): accepts = ('Blog',) @@ -109,6 +112,7 @@ html_escape(entity.rss_feed_url()), self.req._(u'subscribe'), self.req.external_resource('RSS_LOGO_16'), self.req._('rss icon'))) + class BlogEntryPrimaryView(baseviews.PrimaryView): accepts = ('BlogEntry',) skip_attrs = baseviews.PrimaryView.skip_attrs + ('title',) @@ -127,6 +131,7 @@ self.w(_('blogged in ')) self.wview('secondary', rset, 'null') + class BlogEntryArchiveView(StartupView): """control the view of a blog archive""" id = 'blog_archive' @@ -168,11 +173,7 @@ url = html_escape(u"/?vid=blog_archive") link = u'<a href="%s" title="">[see more archives]</a>' % url items.append( u'<li class="">%s</li>\n' % link ) - if self.id: - self.w(u'<div class="boxFrame" id="%s">' % self.id) - else: - self.w(u'<div class="boxFrame">') - + self.w(u'<div class="boxFrame">') if items: self.w(u'<div class="boxContent">\n') self.w(u'<ul class="boxListing">') @@ -188,13 +189,13 @@ order = 35 def call(self, **kwargs): - """display blog archive - """ + """display blogs archive""" _ = self.req._ box = BoxWidget(_(self.title), id=self.id, islist=False) box.append(BoxHtml(self.view('blog_archive', None, maxentries=12))) box.render(self.w) + class BlogEntryListBox(BoxTemplate): """display a box with latest blogs and rss""" id = 'blog_latest_box' @@ -229,18 +230,6 @@ box.render(self.w) -# class OneLineView(EntityView): -# accepts = ('BlogEntry',) -# id = 'sideboxview' - -# def cell_call(self, row, col): -# """the view to be used in a side box -# """ -# entity = self.entity(row, col) -# self.w(u'<li class="Box"><a href="%s">' % html_escape(entity.absolute_url())) -# self.w(html_escape(self.view('text', self.rset, row=row, col=col))) -# self.w(u'</a></li>') - ## list views ################################################################# class BlogEntryListView(baseviews.ListView): @@ -320,6 +309,7 @@ self.view('secondary', rset, 'null'))) self.w(u' | '.join(reldata)) + class BlogNavigation(PageNavigation): accepts = ('BlogEntry', ) __selectors__ = (paginated_rset, sorted_rset, accept)