Add library push to website from the content editor
This commit is contained in:
1 parent
ec57bd73b3
commit
0f90babb7a
13 files changed
+281
-20
No files matched your search
@@ -86,15 +86,17 @@ class FormDialog(ModalScreen[dict | None]):
|
||||
class ConfirmDialog(ModalScreen[bool]):
|
||||
BINDINGS = [("y", "confirm", "Yes"), ("n", "cancel", "No"), ("escape", "cancel", "No")]
|
||||
|
||||
def __init__(self, message: str):
|
||||
def __init__(self, message: str, confirm_label: str = "Delete", confirm_variant: str = "error"):
|
||||
super().__init__()
|
||||
self.message = message
|
||||
self.confirm_label = confirm_label
|
||||
self.confirm_variant = confirm_variant
|
||||
|
||||
def compose(self) -> ComposeResult:
|
||||
with Vertical(classes="dialog"):
|
||||
yield Label(self.message, classes="dialog-title")
|
||||
with Horizontal(classes="dialog-buttons"):
|
||||
yield Button("Delete", variant="error", id="confirm")
|
||||
yield Button(self.confirm_label, variant=self.confirm_variant, id="confirm")
|
||||
yield Button("Cancel", id="cancel")
|
||||
|
||||
@on(Button.Pressed, "#confirm")
|
||||
|
||||
Reference in new issue
Block a user