gitea源码

applications_oauth2_edit_form.tmpl 2.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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 bottom attached 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 class="disable-setting" type="checkbox" name="confidential_client" data-target="#skip-secondary-authorization" {{if .App.ConfidentialClient}}checked{{end}}>
  48. </div>
  49. </div>
  50. <div class="field {{if .Err_SkipSecondaryAuthorization}}error{{end}} {{if .App.ConfidentialClient}}disabled{{end}}" id="skip-secondary-authorization">
  51. <div class="ui checkbox">
  52. <label>{{ctx.Locale.Tr "settings.oauth2_skip_secondary_authorization"}}</label>
  53. <input type="checkbox" name="skip_secondary_authorization" {{if .App.SkipSecondaryAuthorization}}checked{{end}}>
  54. </div>
  55. </div>
  56. <button class="ui primary button">
  57. {{ctx.Locale.Tr "settings.save_application"}}
  58. </button>
  59. </form>
  60. </div>