security.tmpl 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. {{template "base/head" .}}
  2. <div class="user settings security">
  3. <div class="ui container">
  4. <div class="ui grid">
  5. {{template "user/settings/navbar" .}}
  6. <div class="twelve wide column content">
  7. {{template "base/alert" .}}
  8. <h4 class="ui top attached header">
  9. {{.i18n.Tr "settings.two_factor"}}
  10. </h4>
  11. <div class="ui attached segment two-factor">
  12. <p class="text bold">
  13. {{.i18n.Tr "settings.two_factor_status"}}
  14. {{if .TwoFactor}}
  15. <span class="text green">{{.i18n.Tr "settings.two_factor_on"}} <i class="octicon octicon-check"></i></span>
  16. <button class="ui right mini red toggle button delete-button" data-url="{{$.Link}}/two_factor_disable">{{.i18n.Tr "settings.two_factor_disable"}}</button>
  17. {{else}}
  18. <span class="text red">{{.i18n.Tr "settings.two_factor_off"}} <i class="octicon octicon-x"></i></span>
  19. <a class="ui right mini green toggle button" href="{{AppSubURL}}/user/settings/security/two_factor_enable">{{.i18n.Tr "settings.two_factor_enable"}}</a>
  20. {{end}}
  21. </p>
  22. </div>
  23. {{if .TwoFactor}}
  24. <br>
  25. <p>{{.i18n.Tr "settings.two_factor_view_recovery_codes" AppSubURL "/user/settings/security/two_factor_recovery_codes" | Safe}}</p>
  26. <p>{{.i18n.Tr "settings.two_factor_http" AppSubURL "/user/settings/applications" "https://{token}:x-access-token@try.gogs.io/user/repo.git" | Safe}}</p>
  27. <p>{{.i18n.Tr "settings.access_token_tips"}}</p>
  28. {{end}}
  29. </div>
  30. </div>
  31. </div>
  32. </div>
  33. <div class="ui small basic delete modal">
  34. <div class="ui icon header">
  35. <i class="trash icon"></i>
  36. {{.i18n.Tr "settings.two_factor_disable_title"}}
  37. </div>
  38. <div class="content">
  39. <p>{{.i18n.Tr "settings.two_factor_disable_desc"}}</p>
  40. </div>
  41. <div class="actions">
  42. <div class="ui red basic inverted cancel button">
  43. <i class="remove icon"></i>
  44. {{.i18n.Tr "modal.no"}}
  45. </div>
  46. <div class="ui green basic inverted ok button">
  47. <i class="checkmark icon"></i>
  48. {{.i18n.Tr "modal.yes"}}
  49. </div>
  50. </div>
  51. </div>
  52. {{template "base/footer" .}}