[PATCH saem_ref] [views] Hide some undesired actions

Sylvain Thenault sylvain.thenault at logilab.fr
Tue Apr 11 15:14:32 CEST 2017


# HG changeset patch
# User Sylvain Thénault <sylvain.thenault at logilab.fr>
# Date 1491842047 -7200
#      Mon Apr 10 18:34:07 2017 +0200
# Node ID d44cb0543ec659c1fa436c18bb3154419e1444b1
# Parent  5bacf7866df53c1d210152fd62d835ddbbdf1899
[views] Hide some undesired actions

we don't want to display those generic actions.

diff --git a/cubicweb_saem_ref/views/__init__.py b/cubicweb_saem_ref/views/__init__.py
--- a/cubicweb_saem_ref/views/__init__.py
+++ b/cubicweb_saem_ref/views/__init__.py
@@ -437,19 +437,31 @@ class URLAttributeView(primary.URLAttrib
         if url:
             self.w(u'<a href="%s">%s</a>' % (url, url))
 
 
 def registration_callback(vreg):
-    from cubicweb.web.views import tableview, undohistory, actions
+    from cubicweb.web.views import actions, cwuser, debug, tableview, undohistory
     vreg.register_all(globals().values(), __name__, (URLAttributeView, SAEMHTMLPageFooter,))
     vreg.register_and_replace(URLAttributeView, primary.URLAttributeView)
     vreg.register_and_replace(SAEMHTMLPageFooter, basetemplates.HTMLPageFooter)
     vreg.unregister(tableview.TableView)
     vreg.unregister(undohistory.UndoHistoryView)
     vreg.unregister(basecomponents.ApplicationName)
-    # disable 'add a etype' action replaced by appropriate ctx components for
-    # scheme and agent, and providing poor user experience anyway (hidden
-    # in the actions box)
+    # unregister some undesired actions
+    vreg.unregister(actions.SelectAction)
+    vreg.unregister(actions.CancelSelectAction)
+    vreg.unregister(actions.ViewAction)
+    vreg.unregister(actions.MultipleEditAction)
+    vreg.unregister(actions.CopyAction)
     vreg.unregister(actions.AddNewAction)
+    vreg.unregister(actions.AddRelatedActions)
+    vreg.unregister(actions.ViewSameCWEType)
+    vreg.unregister(actions.UserPreferencesAction)
+    vreg.unregister(actions.ManageAction)
+    vreg.unregister(actions.PoweredByAction)
+    vreg.unregister(cwuser.UserPreferencesEntityAction)
+    # global actions
+    vreg.unregister(actions.SiteConfigurationAction)
+    vreg.unregister(debug.SiteInfoAction)
 
     for menu_entry in main_navigation_menu():
         vreg.register(menu_entry)


More information about the saem-devel mailing list