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.

48 lines
1.9 KiB

  1. {{template "base/head" .}}
  2. <div class="user settings delete">
  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.twofa"}}
  10. </h4>
  11. <div class="ui attached segment">
  12. <p>{{.i18n.Tr "settings.twofa_desc"}}</p>
  13. {{if .TwofaEnrolled}}
  14. <p>{{$.i18n.Tr "settings.twofa_is_enrolled" | Str2html }}</p>
  15. <form class="ui form" action="{{.Link}}/regenerate_scratch" method="post" enctype="multipart/form-data">
  16. {{.CsrfTokenHtml}}
  17. <p>{{.i18n.Tr "settings.regenerate_scratch_token_desc"}}</p>
  18. <button class="ui blue button">{{$.i18n.Tr "settings.twofa_scratch_token_regenerate"}}</button>
  19. </form>
  20. <form class="ui form" action="{{.Link}}/disable" method="post" enctype="multipart/form-data" id="disable-form">
  21. {{.CsrfTokenHtml}}
  22. <p>{{.i18n.Tr "settings.twofa_disable_note"}}</p>
  23. <div class="ui red button delete-button" data-type="form" data-form="#disable-form">{{$.i18n.Tr "settings.twofa_disable"}}</div>
  24. </form>
  25. {{else}}
  26. <p>{{.i18n.Tr "settings.twofa_not_enrolled"}}</p>
  27. <div class="inline field">
  28. <a class="ui green button" href="{{.Link}}/enroll">{{$.i18n.Tr "settings.twofa_enroll"}}</a>
  29. </div>
  30. {{end}}
  31. </div>
  32. </div>
  33. </div>
  34. </div>
  35. </div>
  36. <div class="ui small basic delete modal">
  37. <div class="ui icon header">
  38. <i class="trash icon"></i>
  39. {{.i18n.Tr "settings.twofa_disable"}}
  40. </div>
  41. <div class="content">
  42. <p>{{.i18n.Tr "settings.twofa_disable_desc"}}</p>
  43. </div>
  44. {{template "base/delete_modal_actions" .}}
  45. </div>
  46. {{template "base/footer" .}}