You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

modal_actions_confirm.tmpl 1.3KB

1234567891011121314151617181920212223242526272829303132333435
  1. {{/*
  2. Two buttons (negative, positive):
  3. * ModalButtonTypes: "yes" (default) or "confirm"
  4. * ModalButtonColors: "primary" (default) / "blue" / "yellow"
  5. * ModalButtonCancelText
  6. * ModalButtonOkText
  7. Single danger button (GitHub-like):
  8. * ModalButtonDangerText "This action will destroy your data"
  9. The ".ok.button" and ".cancel.button" selectors are also used by Fomantic Modal internally
  10. */}}
  11. <div class="actions">
  12. {{if .ModalButtonDangerText}}
  13. <button class="ui danger red ok button">{{.ModalButtonDangerText}}</button>
  14. {{else}}
  15. {{$textNegitive := ctx.Locale.Tr "modal.no"}}
  16. {{$textPositive := ctx.Locale.Tr "modal.yes"}}
  17. {{if eq .ModalButtonTypes "confirm"}}
  18. {{$textNegitive = ctx.Locale.Tr "modal.cancel"}}
  19. {{$textPositive = ctx.Locale.Tr "modal.confirm"}}
  20. {{end}}
  21. {{if .ModalButtonCancelText}}{{$textNegitive = .ModalButtonCancelText}}{{end}}
  22. {{if .ModalButtonOkText}}{{$textPositive = .ModalButtonOkText}}{{end}}
  23. {{$stylePositive := "primary"}}
  24. {{if eq .ModalButtonColors "blue"}}
  25. {{$stylePositive = "blue"}}
  26. {{else if eq .ModalButtonColors "yellow"}}
  27. {{$stylePositive = "yellow"}}
  28. {{end}}
  29. <button class="ui cancel button">{{svg "octicon-x"}} {{$textNegitive}}</button>
  30. <button class="ui {{$stylePositive}} ok button">{{svg "octicon-check"}} {{$textPositive}}</button>
  31. {{end}}
  32. </div>