From dd136858f1ea40ad3c94191d647487fa4f31926c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 18 Oct 2024 20:33:49 +0200 Subject: Adding upstream version 9.0.0. Signed-off-by: Daniel Baumann --- templates/base/modal_actions_confirm.tmpl | 35 +++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 templates/base/modal_actions_confirm.tmpl (limited to 'templates/base/modal_actions_confirm.tmpl') diff --git a/templates/base/modal_actions_confirm.tmpl b/templates/base/modal_actions_confirm.tmpl new file mode 100644 index 0000000..c44320d --- /dev/null +++ b/templates/base/modal_actions_confirm.tmpl @@ -0,0 +1,35 @@ +{{/* +Two buttons (negative, positive): +* ModalButtonTypes: "yes" (default) or "confirm" +* ModalButtonColors: "primary" (default) / "blue" / "yellow" +* ModalButtonCancelText +* ModalButtonOkText + +Single danger button (GitHub-like): +* ModalButtonDangerText "This action will destroy your data" + +The ".ok.button" and ".cancel.button" selectors are also used by Fomantic Modal internally +*/}} +
+ {{if .ModalButtonDangerText}} + + {{else}} + {{$textNegitive := ctx.Locale.Tr "modal.no"}} + {{$textPositive := ctx.Locale.Tr "modal.yes"}} + {{if eq .ModalButtonTypes "confirm"}} + {{$textNegitive = ctx.Locale.Tr "modal.cancel"}} + {{$textPositive = ctx.Locale.Tr "modal.confirm"}} + {{end}} + {{if .ModalButtonCancelText}}{{$textNegitive = .ModalButtonCancelText}}{{end}} + {{if .ModalButtonOkText}}{{$textPositive = .ModalButtonOkText}}{{end}} + + {{$stylePositive := "primary"}} + {{if eq .ModalButtonColors "blue"}} + {{$stylePositive = "blue"}} + {{else if eq .ModalButtonColors "yellow"}} + {{$stylePositive = "yellow"}} + {{end}} + + + {{end}} +
-- cgit v1.2.3