sonata-project/SonataAdminBundle — pull request #789 by thanosp (2012-05-30 10:46:18+00:00)
Title: Persist preview mode for the 2.0 branch

I've applied the same changes I did in the master PR for the 2.0 branch.

In an Admin Entity you can switch the $supportsPreviewMode variable to true and that will enable the preview mode which will use SonataAdminBundle:CRUD:preview.html.twig by default.
That can be overridden globally through the configuration or per entity by overriding the getTemplate method in your admin model.

Enabling preview will add a new button in the edit/create forms which will basically submit the form but not persist the entity and render it in the preview template instead which will in turn hide the form apart from the actions approve/decline.

The fields shown in the default preview are the same ones configured for the Show action.

The whole intention of previewing is to use your own application's templates. The show-like view used is only a default/example.