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.

applications_oauth2_edit_form.tmpl 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <h4 class="ui top attached header">
  2. {{ctx.Locale.Tr "settings.edit_oauth2_application"}}
  3. </h4>
  4. <div class="ui attached segment">
  5. <p>{{ctx.Locale.Tr "settings.oauth2_application_create_description"}}</p>
  6. </div>
  7. <div class="ui attached segment form ignore-dirty">
  8. {{.CsrfTokenHtml}}
  9. <div class="field">
  10. <label for="client-id">{{ctx.Locale.Tr "settings.oauth2_client_id"}}</label>
  11. <input id="client-id" readonly value="{{.App.ClientID}}">
  12. </div>
  13. {{if .ClientSecret}}
  14. <div class="field">
  15. <label for="client-secret">{{ctx.Locale.Tr "settings.oauth2_client_secret"}}</label>
  16. <input id="client-secret" type="text" readonly value="{{.ClientSecret}}">
  17. </div>
  18. {{else}}
  19. <div class="field">
  20. <label for="client-secret">{{ctx.Locale.Tr "settings.oauth2_client_secret"}}</label>
  21. <input id="client-secret" type="password" readonly value="averysecuresecret">
  22. </div>
  23. {{end}}
  24. <div class="item">
  25. <!-- TODO add regenerate secret functionality */ -->
  26. <form class="ui form ignore-dirty" action="{{.FormActionPath}}/regenerate_secret" method="post">
  27. {{.CsrfTokenHtml}}
  28. {{ctx.Locale.Tr "settings.oauth2_regenerate_secret_hint"}}
  29. <button class="ui mini button tw-ml-2" type="submit">{{ctx.Locale.Tr "settings.oauth2_regenerate_secret"}}</button>
  30. </form>
  31. </div>
  32. </div>
  33. <div class="ui attached bottom segment">
  34. <form class="ui form ignore-dirty" action="{{.FormActionPath}}" method="post">
  35. {{.CsrfTokenHtml}}
  36. <div class="field {{if .Err_AppName}}error{{end}}">
  37. <label for="application-name">{{ctx.Locale.Tr "settings.oauth2_application_name"}}</label>
  38. <input id="application-name" value="{{.App.Name}}" name="application_name" required maxlength="255">
  39. </div>
  40. <div class="field {{if .Err_RedirectURI}}error{{end}}">
  41. <label for="redirect-uris">{{ctx.Locale.Tr "settings.oauth2_redirect_uris"}}</label>
  42. <textarea name="redirect_uris" id="redirect-uris" required>{{StringUtils.Join .App.RedirectURIs "\n"}}</textarea>
  43. </div>
  44. <div class="field {{if .Err_ConfidentialClient}}error{{end}}">
  45. <div class="ui checkbox">
  46. <label>{{ctx.Locale.Tr "settings.oauth2_confidential_client"}}</label>
  47. <input type="checkbox" name="confidential_client" {{if .App.ConfidentialClient}}checked{{end}}>
  48. </div>
  49. </div>
  50. <button class="ui primary button">
  51. {{ctx.Locale.Tr "settings.save_application"}}
  52. </button>
  53. </form>
  54. </div>