Пример #1
0
    def render_widget(self, name, context, options):
        """Count ocurrences of values assigned to given ticket field.
        """
        dbsys = DashboardSystem(self.env)
        params = ('layout', 'schema', 'show_captions', 'title')
        layout, schema, show_captions, title = \
                self.bind_params(name, options, *params)
        lp = dbsys.resolve_layout(layout)
        dbmod = DashboardModule(self.env)
        layout_data = lp.expand_layout(layout, context,
                { 'schema' : schema, 'embed' : True })
        widgets = dbmod.expand_widget_data(context, schema)

        return layout_data['template'], \
                {
                    'title' : title,
                    'data' : dict(
                            context=context,
                            layout=schema,
                            widgets=widgets,
                            title='',
                            default={
                                    'height' : dbmod.default_widget_height or None
                                }
                        ),
                }, \
                context
Пример #2
0
    def render_widget(self, name, context, options):
        """Count ocurrences of values assigned to given ticket field.
        """
        dbsys = DashboardSystem(self.env)
        params = ('layout', 'schema', 'show_captions', 'title')
        layout, schema, show_captions, title = \
                self.bind_params(name, options, *params)
        lp = dbsys.resolve_layout(layout)
        dbmod = DashboardModule(self.env)
        layout_data = lp.expand_layout(layout, context, {
            'schema': schema,
            'embed': True
        })
        widgets = dbmod.expand_widget_data(context, schema)

        return layout_data['template'], \
                {
                    'title' : title,
                    'data' : dict(
                            context=context,
                            layout=schema,
                            widgets=widgets,
                            title='',
                            default={
                                    'height' : dbmod.default_widget_height or None
                                }
                        ),
                }, \
                context