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