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.

44 lines
1.6 KiB

  1. {{template "base/head" .}}
  2. <div class="user settings delete">
  3. {{template "user/settings/navbar" .}}
  4. <div class="ui container">
  5. {{template "base/alert" .}}
  6. <h4 class="ui top attached header">
  7. {{.i18n.Tr "settings.twofa"}}
  8. </h4>
  9. <div class="ui attached segment">
  10. <p>{{.i18n.Tr "settings.twofa_desc"}}</p>
  11. {{if .TwofaEnrolled}}
  12. <p>{{$.i18n.Tr "settings.twofa_is_enrolled" | Str2html }}</p>
  13. <form class="ui form" action="{{.Link}}/regenerate_scratch" method="post" enctype="multipart/form-data">
  14. {{.CsrfTokenHtml}}
  15. <p>{{.i18n.Tr "settings.regenerate_scratch_token_desc"}}</p>
  16. <button class="ui blue button">{{$.i18n.Tr "settings.twofa_scratch_token_regenerate"}}</button>
  17. </form>
  18. <form class="ui form" action="{{.Link}}/disable" method="post" enctype="multipart/form-data" id="disable-form">
  19. {{.CsrfTokenHtml}}
  20. <p>{{.i18n.Tr "settings.twofa_disable_note"}}</p>
  21. <div class="ui red button delete-button" data-type="form" data-form="#disable-form">{{$.i18n.Tr "settings.twofa_disable"}}</div>
  22. </form>
  23. {{else}}
  24. <p>{{.i18n.Tr "settings.twofa_not_enrolled"}}</p>
  25. <div class="inline field">
  26. <a class="ui green button" href="{{.Link}}/enroll">{{$.i18n.Tr "settings.twofa_enroll"}}</a>
  27. </div>
  28. {{end}}
  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.twofa_disable"}}
  36. </div>
  37. <div class="content">
  38. <p>{{.i18n.Tr "settings.twofa_disable_desc"}}</p>
  39. </div>
  40. {{template "base/delete_modal_actions" .}}
  41. </div>
  42. {{template "base/footer" .}}