diff --git a/__pkginfo__.py b/__pkginfo__.py index ac0a159073f1cf7bad217874af7962d5a38407be_X19wa2dpbmZvX18ucHk=..4bfde1326bcd1e9c3a58f09c48a9b57d3e4324c0_X19wa2dpbmZvX18ucHk= 100644 --- a/__pkginfo__.py +++ b/__pkginfo__.py @@ -4,7 +4,7 @@ modname = 'card' distname = 'cubicweb-card' -numversion = (0, 2, 0) +numversion = (0, 3, 0) version = '.'.join(str(num) for num in numversion) license = 'LGPL' @@ -19,7 +19,8 @@ 'Programming Language :: JavaScript', ] -__depends__ = {'cubicweb': '>= 3.9.0'} +__depends__ = {'cubicweb': '>= 3.9.0', + 'cubicweb-preview': None} # packaging ### diff --git a/views.py b/views.py index ac0a159073f1cf7bad217874af7962d5a38407be_dmlld3MucHk=..4bfde1326bcd1e9c3a58f09c48a9b57d3e4324c0_dmlld3MucHk= 100644 --- a/views.py +++ b/views.py @@ -12,6 +12,9 @@ from cubicweb.selectors import is_instance from cubicweb.web import uicfg from cubicweb.web.views import primary +from cubicweb.web.views.autoform import AutomaticEntityForm + +from cubes.preview.views.forms import PreviewFormMixin uicfg.primaryview_section.tag_attribute(('Card', 'title'), 'hidden') uicfg.primaryview_section.tag_attribute(('Card', 'synopsis'), 'hidden') @@ -39,3 +42,7 @@ def content_navigation_components(self, context): pass + +class PreviewAutomaticEntityForm(PreviewFormMixin, AutomaticEntityForm): + preview_mode = 'inline' + __select__ = AutomaticEntityForm.__select__ & is_instance('Card')