merge
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Mon, 06 Apr 2009 14:52:34 +0200
changeset 1255 9d25fd39f9b5
parent 1254 585f3c476a18 (current diff)
parent 1248 4a8c5f8ddff5 (diff)
child 1256 f7b875c62039
merge
--- a/web/views/actions.py	Mon Apr 06 14:27:52 2009 +0200
+++ b/web/views/actions.py	Mon Apr 06 14:52:34 2009 +0200
@@ -314,12 +314,17 @@
         return self.build_url('euser/%s'%login, vid='epropertiesform')
 
 # schema view action
+def schema_view(cls, req, rset, row=None, col=None, view=None,
+                **kwargs):
+    if view is None or not view.id == 'schema':
+        return 0
+    return 1
 
 class DownloadOWLSchemaAction(Action):
     category = 'mainactions'
     id = 'download_as_owl'
     title = _('download schema as owl')
-    __selectors__ = none_rset,
+    __selectors__ = none_rset, schema_view
    
     def url(self):
         return self.build_url('view', vid='owl')
--- a/web/views/boxes.py	Mon Apr 06 14:27:52 2009 +0200
+++ b/web/views/boxes.py	Mon Apr 06 14:52:34 2009 +0200
@@ -31,7 +31,7 @@
     title = _('actions')
     order = 2
 
-    def call(self, **kwargs):
+    def call(self, view=None, **kwargs):
         _ = self.req._
         title = _(self.title)
         if self.rset:
@@ -42,7 +42,7 @@
                 title = u'%s - %s' % (title, etypelabel.lower())
         box = BoxWidget(title, self.id, _class="greyBoxFrame")
         # build list of actions
-        actions = self.vreg.possible_actions(self.req, self.rset)
+        actions = self.vreg.possible_actions(self.req, self.rset, view=view)
         add_menu = BoxMenu(_('add')) # 'addrelated' category
         other_menu = BoxMenu(_('more actions')) # 'moreactions' category
         searchstate = self.req.search_state[0]