def page_notify(): if not user.may("general.notify"): raise MKAuthException(_("You are not allowed to use the notification module.")) title = _("Notify users") breadcrumb = make_simple_page_breadcrumb(mega_menu_registry.menu_setup(), title) menu = _page_menu(breadcrumb) html.header(title, breadcrumb, menu) vs_notify = _vs_notify() if transactions.check_transaction(): try: msg = vs_notify.from_html_vars("_notify") vs_notify.validate_value(msg, "_notify") _process_notify_message(msg) except MKUserError as e: html.user_error(e) html.begin_form("notify", method="POST") vs_notify.render_input_as_form("_notify", {}) html.hidden_fields() html.end_form() html.footer()
def page_notify(): if not config.user.may("general.notify"): raise MKAuthException( _("You are not allowed to use the notification module.")) title = _('Notify users') breadcrumb = make_simple_page_breadcrumb(mega_menu_registry.menu_setup(), title) html.header(title, breadcrumb) html.begin_context_buttons() html.context_button(_("Users"), "wato.py?mode=users", "back") html.end_context_buttons() vs_notify = _vs_notify() if html.check_transaction(): try: msg = vs_notify.from_html_vars("_notify") vs_notify.validate_value(msg, "_notify") _process_notify_message(msg) except MKUserError as e: html.user_error(e) html.begin_form("notify", method="POST") vs_notify.render_input_as_form("_notify", {}) html.button("save", _("Send notification")) html.hidden_fields() html.end_form() html.footer()
def _release_notes_breadcrumb() -> Breadcrumb: breadcrumb = make_main_menu_breadcrumb(mega_menu_registry.menu_setup()) breadcrumb.append(BreadcrumbItem( title=_("Maintenance"), url=None, )) breadcrumb.append( BreadcrumbItem( title=_("Release notes"), url="version.py", )) return breadcrumb
def main_menu(self) -> MegaMenu: """Specify the top-level breadcrumb item of this mode""" return mega_menu_registry.menu_setup()