Beispiel #1
0
 def _page_menu_entries_details(self) -> Iterator[PageMenuEntry]:
     yield PageMenuEntry(
         title=_("Show only modified settings"),
         icon_name="trans",
         item=PageMenuCheckbox(
             is_checked=self._show_only_modified,
             check_url=html.makeuri([("_show_only_modified", "1")]),
             uncheck_url=html.makeuri([("_show_only_modified", "0")]),
         ),
     )
Beispiel #2
0
 def _page_menu_entries_details(self) -> Iterator[PageMenuEntry]:
     for toggle_id, title, setting in [
         ("_show_host_tags", _("Show host tags"), config.user.wato_folders_show_tags),
         ("_show_explicit_labels", _("Show explicit host labels"),
          config.user.wato_folders_show_labels),
     ]:
         yield PageMenuEntry(
             title=title,
             icon_name="trans",
             item=PageMenuCheckbox(
                 is_checked=setting,
                 check_url=makeuri(global_request, [(toggle_id, "1")]),
                 uncheck_url=makeuri(global_request, [(toggle_id, "")]),
             ),
         )
Beispiel #3
0
def _extend_display_dropdown(menu: PageMenu) -> None:
    display_dropdown = menu.get_dropdown_by_name("display", make_display_options_dropdown())
    display_dropdown.topics.insert(
        0,
        PageMenuTopic(
            title=_("Context"),
            entries=[
                PageMenuEntry(
                    title=_("Hide context"),
                    icon_name="trans",
                    item=PageMenuCheckbox(
                        is_checked=html.request.var('_hidecontext', 'no') == 'yes',
                        check_url=makeuri(request, [("_hidecontext", "yes")]),
                        uncheck_url=makeuri(request, [("_show_backlog", "no")]),
                    ),
                ),
            ],
        ))
Beispiel #4
0
    def _extend_display_dropdown(self, menu: PageMenu) -> None:
        display_dropdown = menu.get_dropdown_by_name(
            "display", make_display_options_dropdown())

        display_dropdown.topics.insert(
            0,
            PageMenuTopic(
                title=_("Filter"),
                entries=[
                    PageMenuEntry(
                        title=_("Filter view"),
                        icon_name="filters_set"
                        if html.form_submitted("options") else "filters",
                        item=PageMenuSidePopup(self._render_filter_form()),
                        name="filters",
                        is_shortcut=True,
                    ),
                ],
            ))

        display_dropdown.topics.insert(
            0,
            PageMenuTopic(
                title=_("Details"),
                entries=[
                    PageMenuEntry(
                        title=_("Show details"),
                        icon_name="trans",
                        item=PageMenuCheckbox(
                            is_checked=self._show_details,
                            check_url=makeuri(request,
                                              [("show_details", "1")]),
                            uncheck_url=makeuri(request,
                                                [("show_details", "0")]),
                        ),
                        name="show_details",
                        css_classes=["toggle"],
                    )
                ],
            ))