2019-03-08 19:42:50 +03:00
{{ template "base/head" . }}
2020-12-01 07:00:14 +03:00
<div class="page-content user settings applications">
2019-03-08 19:42:50 +03:00
{{ template "user/settings/navbar" . }}
<div class="ui container">
{{ template "base/alert" . }}
<h4 class="ui top attached header">
2022-06-27 23:58:46 +03:00
{{ .locale .Tr "settings.edit_oauth2_application" }}
2019-03-08 19:42:50 +03:00
</h4>
<div class="ui attached segment">
2022-06-27 23:58:46 +03:00
<p> {{ .locale .Tr "settings.oauth2_application_create_description" }} </p>
2019-03-08 19:42:50 +03:00
</div>
<div class="ui attached segment form ignore-dirty">
{{ .CsrfTokenHtml }}
<div class="field">
2022-06-27 23:58:46 +03:00
<label for="client-id"> {{ .locale .Tr "settings.oauth2_client_id" }} </label>
2019-03-08 19:42:50 +03:00
<input id="client-id" readonly value=" {{ .App .ClientID }} ">
</div>
{{ if .ClientSecret }}
<div class="field">
2022-06-27 23:58:46 +03:00
<label for="client-secret"> {{ .locale .Tr "settings.oauth2_client_secret" }} </label>
2019-03-08 19:42:50 +03:00
<input id="client-secret" type="text" readonly value=" {{ .ClientSecret }} ">
</div>
{{ else }}
<div class="field">
2022-06-27 23:58:46 +03:00
<label for="client-secret"> {{ .locale .Tr "settings.oauth2_client_secret" }} </label>
2019-03-08 19:42:50 +03:00
<input id="client-secret" type="password" readonly value="averysecuresecret">
</div>
{{ end }}
<div class="item">
<!-- TODO add regenerate secret functionality */ -->
2022-06-27 23:58:46 +03:00
{{ .locale .Tr "settings.oauth2_regenerate_secret_hint" }}
2020-02-25 18:58:37 +03:00
<form class="ui form ignore-dirty" action=" {{ AppSubUrl }} /user/settings/applications/oauth2/ {{ .App .ID }} /regenerate_secret" method="post">
2019-03-09 19:29:58 +03:00
{{ .CsrfTokenHtml }}
2022-06-27 23:58:46 +03:00
<a href="#" onclick="event.target.parentNode.submit()"> {{ .locale .Tr "settings.oauth2_regenerate_secret" }} </a>
2019-03-09 19:29:58 +03:00
</form>
2019-03-08 19:42:50 +03:00
</div>
</div>
<div class="ui attached bottom segment">
2020-02-25 18:58:37 +03:00
<form class="ui form ignore-dirty" action=" {{ AppSubUrl }} /user/settings/applications/oauth2/ {{ .App .ID }} " method="post">
2019-03-08 19:42:50 +03:00
{{ .CsrfTokenHtml }}
<div class="field {{ if .Err_AppName }} error {{ end }} ">
2022-06-27 23:58:46 +03:00
<label for="application-name"> {{ .locale .Tr "settings.oauth2_application_name" }} </label>
2019-03-08 19:42:50 +03:00
<input id="application-name" value=" {{ .App .Name }} " name="application_name" required>
</div>
<div class="field {{ if .Err_RedirectURI }} error {{ end }} ">
2022-06-27 23:58:46 +03:00
<label for="redirect-uri"> {{ .locale .Tr "settings.oauth2_redirect_uri" }} </label>
2019-03-08 19:42:50 +03:00
<input type="url" name="redirect_uri" value=" {{ .App .PrimaryRedirectURI }} " id="redirect-uri">
</div>
<button class="ui green button">
2022-06-27 23:58:46 +03:00
{{ .locale .Tr "settings.save_application" }}
2019-03-08 19:42:50 +03:00
</button>
</form>
</div>
</div>
</div>
<div class="ui small basic delete modal" id="delete-oauth2-application">
<div class="ui icon header">
2021-03-22 07:04:19 +03:00
{{ svg "octicon-trash" }}
2022-06-27 23:58:46 +03:00
{{ .locale .Tr "settings.remove_oauth2_application" }}
2019-03-08 19:42:50 +03:00
</div>
<div class="content">
2022-06-27 23:58:46 +03:00
<p> {{ .locale .Tr "settings.remove_oauth2_application_desc" }} </p>
2019-03-08 19:42:50 +03:00
</div>
{{ template "base/delete_modal_actions" . }}
</div>
{{ template "base/footer" . }}