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.0KB

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