security.tmpl 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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}@try.gogs.io/user/repo.git" | Safe}}</p>
  27. {{end}}
  28. </div>
  29. </div>
  30. </div>
  31. </div>
  32. <div class="ui small basic delete modal">
  33. <div class="ui icon header">
  34. <i class="trash icon"></i>
  35. {{.i18n.Tr "settings.two_factor_disable_title"}}
  36. </div>
  37. <div class="content">
  38. <p>{{.i18n.Tr "settings.two_factor_disable_desc"}}</p>
  39. </div>
  40. <div class="actions">
  41. <div class="ui red basic inverted cancel button">
  42. <i class="remove icon"></i>
  43. {{.i18n.Tr "modal.no"}}
  44. </div>
  45. <div class="ui green basic inverted ok button">
  46. <i class="checkmark icon"></i>
  47. {{.i18n.Tr "modal.yes"}}
  48. </div>
  49. </div>
  50. </div>
  51. {{template "base/footer" .}}