Beispiel #1
0
    def configure_forms(self):
        """Configure subsystems for rendering Deform forms.

        * Deform templates

        * Deform JS and CSS

        * CSRf view mapper
        """

        from websauna.system.form.resources import DefaultFormResources
        from websauna.system.form.interfaces import IFormResources
        from websauna.system.form.deform import configure_zpt_renderer

        # Make Deform widgets aware of our widget template paths
        configure_zpt_renderer(["websauna.system.form:templates/deform"])

        # Include Deform JS and CSS to static serving
        self.static_asset_policy.add_static_view('deform-static',
                                                 'deform:static')

        # Overrides for Deform 2 stock JS and CSS
        default_form_resources = DefaultFormResources()
        self.config.registry.registerUtility(default_form_resources,
                                             IFormResources)
Beispiel #2
0
    def configure_forms(self):
        super().configure_forms()

        # from websauna.system.form.resources import DefaultFormResources
        from websauna.system.form.interfaces import IFormResources
        from websauna.system.form.deform import configure_zpt_renderer

        # Make Deform widgets aware of our widget template paths
        configure_zpt_renderer(["enkiblog.core.deform.widgets:templates"])
        form_resources = self.config.registry.getUtility(IFormResources).get_default_resources()
        form_resources['ckeditor'] = {None: {
            'js': 'enkiblog.core.deform.widgets:static/ckeditor/ckeditor.js',
            'css': 'enkiblog.core.deform.widgets:static/ckeditor/contents.css',
        }}
Beispiel #3
0
    def configure_forms(self):
        """Configure subsystems for rendering Deform forms.

        * Deform templates

        * Deform JS and CSS

        * CSRf view mapper
        """

        from websauna.system.form.resources import DefaultFormResources
        from websauna.system.form.interfaces import IFormResources
        from websauna.system.form.deform import configure_zpt_renderer

        # Make Deform widgets aware of our widget template paths
        configure_zpt_renderer(["websauna.system:form/templates/deform"])

        # Include Deform JS and CSS to static serving
        self.static_asset_policy.add_static_view('deform-static', 'deform:static')

        # Overrides for Deform 2 stock JS and CSS
        default_form_resources = DefaultFormResources()
        self.config.registry.registerUtility(default_form_resources, IFormResources)