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.

69 lines
2.7 KiB

  1. {{template "base/head" .}}
  2. <div class="user settings applications">
  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.edit_oauth2_application"}}
  8. </h4>
  9. <div class="ui attached segment">
  10. {{template "base/alert" .}}
  11. <p>{{.i18n.Tr "settings.oauth2_application_create_description"}}</p>
  12. </div>
  13. <div class="ui attached segment form ignore-dirty">
  14. {{.CsrfTokenHtml}}
  15. <div class="field">
  16. <label for="client-id">{{.i18n.Tr "settings.oauth2_client_id"}}</label>
  17. <input id="client-id" readonly value="{{.App.ClientID}}">
  18. </div>
  19. {{if .ClientSecret}}
  20. <div class="field">
  21. <label for="client-secret">{{.i18n.Tr "settings.oauth2_client_secret"}}</label>
  22. <input id="client-secret" type="text" readonly value="{{.ClientSecret}}">
  23. </div>
  24. {{else}}
  25. <div class="field">
  26. <label for="client-secret">{{.i18n.Tr "settings.oauth2_client_secret"}}</label>
  27. <input id="client-secret" type="password" readonly value="averysecuresecret">
  28. </div>
  29. {{end}}
  30. <div class="item">
  31. <!-- TODO add regenerate secret functionality */ -->
  32. {{.i18n.Tr "settings.oauth2_regenerate_secret_hint"}}
  33. <form class="ui form ignore-dirty" action="{{AppSubUrl}}/user/settings/applications/oauth2/{{.App.ID}}/regenerate_secret" method="post">
  34. {{.CsrfTokenHtml}}
  35. <a href="#" onclick="event.target.parentNode.submit()">{{.i18n.Tr "settings.oauth2_regenerate_secret"}}</a>
  36. </form>
  37. </div>
  38. </div>
  39. <div class="ui attached bottom segment">
  40. <form class="ui form ignore-dirty" action="{{AppSubUrl}}/user/settings/applications/oauth2/{{.App.ID}}" method="post">
  41. {{.CsrfTokenHtml}}
  42. <div class="field {{if .Err_AppName}}error{{end}}">
  43. <label for="application-name">{{.i18n.Tr "settings.oauth2_application_name"}}</label>
  44. <input id="application-name" value="{{.App.Name}}" name="application_name" required>
  45. </div>
  46. <div class="field {{if .Err_RedirectURI}}error{{end}}">
  47. <label for="redirect-uri">{{.i18n.Tr "settings.oauth2_redirect_uri"}}</label>
  48. <input type="url" name="redirect_uri" value="{{.App.PrimaryRedirectURI}}" id="redirect-uri">
  49. </div>
  50. <button class="ui green button">
  51. {{.i18n.Tr "settings.save_application"}}
  52. </button>
  53. </form>
  54. </div>
  55. </div>
  56. </div>
  57. <div class="ui small basic delete modal" id="delete-oauth2-application">
  58. <div class="ui icon header">
  59. <i class="trash icon"></i>
  60. {{.i18n.Tr "settings.remove_oauth2_application"}}
  61. </div>
  62. <div class="content">
  63. <p>{{.i18n.Tr "settings.remove_oauth2_application_desc"}}</p>
  64. </div>
  65. {{template "base/delete_modal_actions" .}}
  66. </div>
  67. {{template "base/footer" .}}