wijjit.tags.dialogs.ConfirmDialogExtension
- class wijjit.tags.dialogs.ConfirmDialogExtension(environment)[source]
Jinja2 extension for {% confirmdialog %} tag.
Creates a confirmation dialog with confirm/cancel buttons.
Syntax:
{% confirmdialog visible="show_confirm" title="Confirm Delete" message="Are you sure you want to delete this file?" confirm_action="handle_confirm" cancel_action="handle_cancel" confirm_label="Delete" cancel_label="Cancel" %} {% endconfirmdialog %} Or with body content as message: {% confirmdialog visible="show_confirm" title="Confirm Action" confirm_action="confirm" cancel_action="cancel" %} Are you sure you want to proceed with this action? {% endconfirmdialog %}- Parameters:
environment (Environment)
- __init__(environment)
- Parameters:
environment (Environment)
- Return type:
None
Methods
__init__(environment)attr(name[, lineno])Return an attribute node for the current extension.
bind(environment)Create a copy of this extension bound to another environment.
call_method(name[, args, kwargs, dyn_args, ...])Call a method of the extension.
filter_stream(stream)It's passed a
TokenStreamthat can be used to filter tokens returned.parse(parser)Parse the confirmdialog tag.
preprocess(source, name[, filename])This method is called before the actual lexing and can be used to preprocess the source.
Attributes
prioritythe priority of that extension.
if this extension parses this is the list of tags it's listening to.
- tags: t.Set[str] = {'confirmdialog'}
if this extension parses this is the list of tags it’s listening to.
- parse(parser)[source]
Parse the confirmdialog tag.
- Parameters:
parser (
jinja2.parser.Parser) – Jinja2 parser- Returns:
Parsed node tree
- Return type: