--- a/web/views/boxes.py Thu Feb 19 20:19:05 2009 +0100
+++ b/web/views/boxes.py Thu Feb 19 20:21:10 2009 +0100
@@ -10,14 +10,14 @@
* startup views box
:organization: Logilab
-:copyright: 2001-2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
"""
__docformat__ = "restructuredtext en"
from logilab.mtconverter import html_escape
-from cubicweb.common.selectors import (any_rset, appobject_selectable)
+from cubicweb.common.selectors import any_rset, appobject_selectable
from cubicweb.web.htmlwidgets import BoxWidget, BoxMenu, BoxHtml, RawBoxItem
from cubicweb.web.box import BoxTemplate, ExtResourcesBoxTemplate
@@ -175,17 +175,16 @@
def call(self, **kwargs):
box = BoxWidget(self.req._(self.title), self.id)
- actions = [v for v in self.vreg.possible_views(self.req, self.rset)
- if v.category != 'startupview']
- for category, actions in self.sort_actions(actions):
+ views = [v for v in self.vreg.possible_views(self.req, self.rset)
+ if v.category != 'startupview']
+ for category, views in self.sort_actions(views):
menu = BoxMenu(category)
- for action in actions:
- menu.append(self.box_action(action))
+ for view in views:
+ menu.append(self.box_action(view))
box.append(menu)
if not box.is_empty():
box.render(self.w)
-
class RSSIconBox(ExtResourcesBoxTemplate):
"""just display the RSS icon on uniform result set"""
@@ -203,23 +202,6 @@
self.w(u'<a href="%s"><img src="%s" alt="rss"/></a>\n' % (html_escape(url), rss))
-## warning("schemabox ne marche plus pour le moment")
-## class SchemaBox(BoxTemplate):
-## """display a box containing link to list of entities by type"""
-## id = 'schema_box'
-## visible = False # disabled by default
-## title = _('entity list')
-## order = 60
-
-## def call(self, **kwargs):
-## box = BoxWidget(self.req._(title), self.id)
-## for etype in self.config.etypes(self.req.user, 'read'):
-## view = self.vreg.select_view('list', self.req, self.etype_rset(etype))
-## box.append(self.mk_action(display_name(self.req, etype, 'plural'),
-## view.url(), etype=etype))
-## if not box.is_empty():
-## box.render(self.w)
-
class StartupViewsBox(BoxTemplate):
"""display a box containing links to all startup views"""
id = 'startup_views_box'