Files

27 lines
1.0 KiB
Handlebars
Raw Permalink Normal View History

2024-12-25 00:51:13 +08:00
{{/* Two buttons (negative, positive):
2023-04-24 19:08:59 +08:00
* ModalButtonTypes: "yes" (default) or "confirm"
* ModalButtonCancelText
* ModalButtonOkText
2023-04-24 19:08:59 +08:00
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
*/}}
<div class="actions">
2023-04-24 19:08:59 +08:00
{{if .ModalButtonDangerText}}
<button class="ui danger red ok button">{{.ModalButtonDangerText}}</button>
{{else}}
2026-02-28 20:23:20 +01:00
{{$textNegative := ctx.Locale.Tr "modal.no"}}
2023-09-24 22:31:58 +02:00
{{$textPositive := ctx.Locale.Tr "modal.yes"}}
2023-04-24 19:08:59 +08:00
{{if eq .ModalButtonTypes "confirm"}}
2026-02-28 20:23:20 +01:00
{{$textNegative = ctx.Locale.Tr "modal.cancel"}}
2023-09-24 22:31:58 +02:00
{{$textPositive = ctx.Locale.Tr "modal.confirm"}}
2023-04-24 19:08:59 +08:00
{{end}}
2026-02-28 20:23:20 +01:00
{{if .ModalButtonCancelText}}{{$textNegative = .ModalButtonCancelText}}{{end}}
2023-04-24 19:08:59 +08:00
{{if .ModalButtonOkText}}{{$textPositive = .ModalButtonOkText}}{{end}}
2026-02-28 20:23:20 +01:00
<button class="ui cancel button">{{svg "octicon-x"}} {{$textNegative}}</button>
2024-04-14 19:53:52 +02:00
<button class="ui primary ok button">{{svg "octicon-check"}} {{$textPositive}}</button>
{{end}}
</div>