gitea源码

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