Skip to content
Snippets Groups Projects
Commit 18c69e7629d4 authored by Sandrine Ribeau's avatar Sandrine Ribeau
Browse files

cw 3.6 api update

parent aced35dab06d
No related branches found
No related tags found
No related merge requests found
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
rql = ('Any E ORDERBY D DESC ' rql = ('Any E ORDERBY D DESC '
'WHERE E is BlogEntry, E entry_of X, X eid %s, E creation_date D' 'WHERE E is BlogEntry, E entry_of X, X eid %s, E creation_date D'
) )
return self.build_url(rql=rql % self.eid, vid='rss', return self._cw.build_url(rql=rql % self.eid, vid='rss',
vtitle=self.dc_title()) vtitle=self.dc_title())
# isioc interface ########################################################## # isioc interface ##########################################################
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
super(BlogPrimaryView, self).render_entity_relations(entity) super(BlogPrimaryView, self).render_entity_relations(entity)
rset = entity.related('entry_of', 'object') rset = entity.related('entry_of', 'object')
strio = UStringIO() strio = UStringIO()
self.pagination(self._cw, rset, strio.write, page_size=10) self.paginate(self._cw, w=strio.write, page_size=10, rset=rset)
self.wview('adaptedlist', rset, 'null') self.wview('adaptedlist', rset, 'null')
self.w(strio.getvalue()) self.w(strio.getvalue())
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
label = u'%s %s [%s]' % (self._cw._(calendar.MONTHNAMES[month-1]), year, label = u'%s %s [%s]' % (self._cw._(calendar.MONTHNAMES[month-1]), year,
nmb_entries) nmb_entries)
vtitle = '%s %s' % (display_name(self._cw, 'BlogEntry', 'plural'), label) vtitle = '%s %s' % (display_name(self._cw, 'BlogEntry', 'plural'), label)
url = xml_escape(self.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) link = u'<a href="%s" title="">%s</a>' % (url, label)
items.append( u'<li class="">%s</li>\n' % link ) items.append( u'<li class="">%s</li>\n' % link )
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
for year, month in displayed_months: for year, month in displayed_months:
self.represent(items, year, month) self.represent(items, year, month)
if needmore: if needmore:
url = self.build_url('view', vid='blog_archive') url = self._cw.build_url('view', vid='blog_archive')
link = u'<a href="%s" title="">[see more archives]</a>' % url link = u'<a href="%s" title="">[see more archives]</a>' % url
items.append( u'<li class="">%s</li>\n' % link ) items.append( u'<li class="">%s</li>\n' % link )
self.w(u'<div class="boxFrame">') self.w(u'<div class="boxFrame">')
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
count_blogentry = self._cw.execute('Any COUNT(B) WHERE B is BlogEntry') count_blogentry = self._cw.execute('Any COUNT(B) WHERE B is BlogEntry')
if count_blogentry[0][0] > 0: if count_blogentry[0][0] > 0:
box = BoxWidget(self._cw._(self.title), id=self.__regid__, islist=False) box = BoxWidget(self._cw._(self.title), id=self.__regid__, islist=False)
box.append(boxes.BoxHtml(self.view('blog_archive', None, maxentries=12))) box.append(boxes.BoxHtml(self._cw.view('blog_archive', None, maxentries=12)))
box.render(self.w) box.render(self.w)
...@@ -111,9 +111,9 @@ ...@@ -111,9 +111,9 @@
rqlst = rset.syntax_tree() rqlst = rset.syntax_tree()
rqlst.set_limit(None) rqlst.set_limit(None)
rql = rqlst.as_string(kwargs=rset.args) rql = rqlst.as_string(kwargs=rset.args)
url = self.build_url('view', rql=rql, page_size=10) url = self._cw.build_url('view', rql=rql, page_size=10)
box.append(BoxLink(url, u'[%s]' % self._cw._(u'see more'))) box.append(BoxLink(url, u'[%s]' % self._cw._(u'see more')))
rss_icon = self._cw.external_resource('RSS_LOGO_16') rss_icon = self._cw.external_resource('RSS_LOGO_16')
# FIXME - could use rss_url defined as a property if available # FIXME - could use rss_url defined as a property if available
rss_label = u'%s <img src="%s" alt="%s"/>' % ( rss_label = u'%s <img src="%s" alt="%s"/>' % (
self._cw._(u'subscribe'), rss_icon, self._cw._('rss icon')) self._cw._(u'subscribe'), rss_icon, self._cw._('rss icon'))
...@@ -115,9 +115,9 @@ ...@@ -115,9 +115,9 @@
box.append(BoxLink(url, u'[%s]' % self._cw._(u'see more'))) box.append(BoxLink(url, u'[%s]' % self._cw._(u'see more')))
rss_icon = self._cw.external_resource('RSS_LOGO_16') rss_icon = self._cw.external_resource('RSS_LOGO_16')
# FIXME - could use rss_url defined as a property if available # FIXME - could use rss_url defined as a property if available
rss_label = u'%s <img src="%s" alt="%s"/>' % ( rss_label = u'%s <img src="%s" alt="%s"/>' % (
self._cw._(u'subscribe'), rss_icon, self._cw._('rss icon')) self._cw._(u'subscribe'), rss_icon, self._cw._('rss icon'))
rss_url = self.build_url('view', vid='rss', rql=rql) rss_url = self._cw.build_url('view', vid='rss', rql=rql)
box.append(BoxLink(rss_url, rss_label)) box.append(BoxLink(rss_url, rss_label))
box.render(self.w) box.render(self.w)
...@@ -135,7 +135,7 @@ ...@@ -135,7 +135,7 @@
rset = self._cw.execute(rql) rset = self._cw.execute(rql)
for user in rset: for user in rset:
euser = self._cw.entity_from_eid(user[0]) euser = self._cw.entity_from_eid(user[0])
box.append(BoxLink(self.build_url('blogentry/%s' % euser.login), box.append(BoxLink(self._cw.build_url('blogentry/%s' % euser.login),
u'%s [%s]' % (euser.name(), u'%s [%s]' % (euser.name(),
user[1]))) user[1])))
box.render(self.w) box.render(self.w)
...@@ -185,7 +185,7 @@ ...@@ -185,7 +185,7 @@
label = u'%s %s [%s]' % (self._cw._(calendar.MONTHNAMES[month-1]), year, label = u'%s %s [%s]' % (self._cw._(calendar.MONTHNAMES[month-1]), year,
nmb_entries) nmb_entries)
vtitle = '%s %s' % (display_name('BlogEntry', 'plural'), label) vtitle = '%s %s' % (display_name('BlogEntry', 'plural'), label)
url = xml_escape(self.build_url('view', rql=rql, vtitle=vtitle, url = xml_escape(self._cw.build_url('view', rql=rql, vtitle=vtitle,
month=month, year=year)) month=month, year=year))
if self._cw.execute(rql): if self._cw.execute(rql):
return u'<a href="%s" title="">%s</a>' % (url, atitle) return u'<a href="%s" title="">%s</a>' % (url, atitle)
...@@ -212,7 +212,7 @@ ...@@ -212,7 +212,7 @@
vtitle = _('blog entries created by %s') % creator.name() vtitle = _('blog entries created by %s') % creator.name()
rql = 'Any X ORDERBY D DESC WHERE X is BlogEntry, X created_by Y, '\ rql = 'Any X ORDERBY D DESC WHERE X is BlogEntry, X created_by Y, '\
'Y eid %s, X creation_date D' % creator.eid 'Y eid %s, X creation_date D' % creator.eid
url = self.build_url('view', rql=rql, vtitle=vtitle, page_size=10) url = self._cw.build_url('view', rql=rql, vtitle=vtitle, page_size=10)
w(u'%s <a title="%s" href="%s">%s</a>' % ( w(u'%s <a title="%s" href="%s">%s</a>' % (
_('by'), xml_escape(vtitle), xml_escape(url), creator.name())) _('by'), xml_escape(vtitle), xml_escape(url), creator.name()))
w(u'<div class="entry">') w(u'<div class="entry">')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment