# HG changeset patch # User Goffi # Date 1598302395 -7200 # Node ID 8729d2708f6541780fc4fddf11f02cbceeb2715b # Parent 1df0d1b28b8379136ac770ac11d33df4fda244e1 browser (dialog): color of `OK` button can be specified: `ok_color` argument can be for the moment either `confirm` or `danger` diff -r 1df0d1b28b83 -r 8729d2708f65 libervia/pages/_browser/dialog.py --- a/libervia/pages/_browser/dialog.py Mon Aug 24 22:52:04 2020 +0200 +++ b/libervia/pages/_browser/dialog.py Mon Aug 24 22:53:15 2020 +0200 @@ -6,10 +6,12 @@ class Confirm: - def __init__(self, message, ok_label="", cancel_label=""): + def __init__(self, message, ok_label="", cancel_label="", ok_color="success"): self._tpl = Template("dialogs/confirm.html") self.message = message self.ok_label = ok_label + assert ok_color in ("success", "danger") + self.ok_color = ok_color self.cancel_label = cancel_label def cancel_cb(self, evt, notif_elt): @@ -21,6 +23,7 @@ notif_elt = self._tpl.get_elt({ "message": self.message, "ok_label": self.ok_label, + "ok_color": self.ok_color, "cancel_label": self.cancel_label, })