def _show_view_as_dashlet(self, view_spec: ViewSpec): html.add_body_css_class("view") html.open_div(id_="dashlet_content_wrapper") is_reload = html.request.has_var("_reload") view_display_options = "SIXLW" if not is_reload: view_display_options += "HR" html.request.set_var('display_options', view_display_options) html.request.set_var('_display_options', view_display_options) html.add_body_css_class('dashlet') # Need to be loaded before processing the painter_options below. # TODO: Make this dependency explicit display_options.load_from_html(html) painter_options = PainterOptions.get_instance() painter_options.load(self._dashlet_spec["name"]) view = views.View(self._dashlet_spec["name"], view_spec, self.context) view.row_limit = views.get_limit() view.only_sites = visuals.get_only_sites_from_context(self.context) view.user_sorters = views.get_user_sorters() views.process_view(views.GUIViewRenderer(view, show_buttons=False)) html.close_div()
def _show_view_as_dashlet(self, view_spec: ViewSpec): html.add_body_css_class("view") html.open_div(id_="dashlet_content_wrapper") is_reload = request.has_var("_reload") view_display_options = "SIXLW" if not is_reload: view_display_options += "HR" request.set_var("display_options", view_display_options) request.set_var("_display_options", view_display_options) html.add_body_css_class("dashlet") # Need to be loaded before processing the painter_options below. # TODO: Make this dependency explicit display_options.load_from_html(request, html) painter_options = PainterOptions.get_instance() painter_options.load(self._dashlet_spec["name"]) # Here the linked view default context has the highest priority # linkedview default>dashlet>url active filter, dashboard context = visuals.get_merged_context(self.context, view_spec["context"]) view = views.View(self._dashlet_spec["name"], view_spec, context) view.row_limit = views.get_limit() view.only_sites = visuals.get_only_sites_from_context(context) view.user_sorters = views.get_user_sorters() views.process_view(views.GUIViewRenderer(view, show_buttons=False)) html.close_div()
def _show_view_as_dashlet(self, view_spec): html.add_body_css_class("view") html.open_div(id_="dashlet_content_wrapper") is_reload = html.request.has_var("_reload") display_options = "SIXLW" if not is_reload: display_options += "HR" html.request.set_var('display_options', display_options) html.request.set_var('_display_options', display_options) html.add_body_css_class('dashlet') painter_options = PainterOptions.get_instance() painter_options.load(self._dashlet_spec["name"]) view = views.View(self._dashlet_spec["name"], view_spec, self.context) view.row_limit = views.get_limit() view.only_sites = visuals.get_only_sites_from_context(self.context) view.user_sorters = views.get_user_sorters() view_renderer = views.GUIViewRenderer(view, show_buttons=False) views.process_view(view, view_renderer) html.close_div()
def _show_view_as_dashlet(self, view_spec: ViewSpec): html.add_body_css_class("view") html.open_div(id_="dashlet_content_wrapper") is_reload = request.has_var("_reload") view_display_options = "SIXLW" if not is_reload: view_display_options += "HR" request.set_var("display_options", view_display_options) request.set_var("_display_options", view_display_options) html.add_body_css_class("dashlet") # Need to be loaded before processing the painter_options below. # TODO: Make this dependency explicit display_options.load_from_html(request, html) painter_options = PainterOptions.get_instance() painter_options.load(self._dashlet_spec["name"]) # Here the linked view default context has the highest priority # linkedview default>dashlet>url active filter> dashboard. However views # have the "show_filters" default to prefill the filtermenu with empty # valued filters(UX). Those need to be cleared out. Otherwise those # empty filters are the highest priority filters and the user can never # filter the view. view_context = { filtername: filtervalues for filtername, filtervalues in view_spec["context"].items() if { var: value for var, value in filtervalues.items() # These are the filters request variables. Keep set values # For the TriStateFilters unset == ignore == "-1" # all other cases unset is an empty string if (var.startswith("is_") and value != "-1" ) # TriState filters except ignore or (not var.startswith("is_") and value ) # Rest of filters with some value } } context = visuals.get_merged_context(self.context, view_context) view = views.View(self._dashlet_spec["name"], view_spec, context) view.row_limit = views.get_limit() view.only_sites = visuals.get_only_sites_from_context(context) view.user_sorters = views.get_user_sorters() views.process_view(views.GUIViewRenderer(view, show_buttons=False)) html.close_div()
def update(self): is_reload = html.request.has_var("_reload") display_options = "SIXLW" if not is_reload: display_options += "HR" html.request.set_var('display_options', display_options) html.request.set_var('_display_options', display_options) html.add_body_css_class('dashlet') painter_options = PainterOptions.get_instance() painter_options.load(self._dashlet_spec["name"]) view = views.View(self._dashlet_spec["name"], self._dashlet_spec) view.row_limit = views.get_limit() view.only_sites = views.get_only_sites() view.user_sorters = views.get_user_sorters() view_renderer = views.GUIViewRenderer(view, show_buttons=False) views.show_view(view, view_renderer)