Esempio n. 1
0
    def _show_failed_notifications(self):
        if not self.parameters()["show_failed_notifications"]:
            return

        failed_notifications = notifications.number_of_failed_notifications(
            after=notifications.acknowledged_time()
        )
        if not failed_notifications:
            return

        html.open_div(class_="spacertop")
        html.open_div(class_="tacticalalert")

        confirm_url = makeuri_contextless(request, [], filename="clear_failed_notifications.py")
        html.icon_button(confirm_url, _("Confirm failed notifications"), "delete", target="main")

        view_url = makeuri_contextless(
            request,
            [("view_name", "failed_notifications")],
            filename="view.py",
        )

        html.a(_("%d failed notifications") % failed_notifications, target="main", href=view_url)
        html.close_div()
        html.close_div()
Esempio n. 2
0
    def show(self):
        failed_notifications = notifications.number_of_failed_notifications(
            after=notifications.acknowledged_time())
        if not failed_notifications:
            return

        html.open_div(class_="has_failed_notifications")
        html.open_div(class_="failed_notifications_inner")

        confirm_url = makeuri_contextless(
            request, [], filename="clear_failed_notifications.py")
        html.icon_button(confirm_url,
                         _("Clear failed notifications"),
                         "closetimewarp",
                         target="main")

        view_url = makeuri_contextless(
            request,
            [("view_name", "failed_notifications")],
            filename="view.py",
        )
        html.a(_("%d failed notifications") % failed_notifications,
               href=view_url)

        html.close_div()
        html.close_div()