mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Allow creation of OAuth2 applications for orgs (#18084)
Adds the settings pages to create OAuth2 apps also to the org settings and allows to create apps for orgs. Refactoring: the oauth2 related templates are shared for instance-wide/org/user, and the backend code uses `OAuth2CommonHandlers` to share code for instance-wide/org/user. Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
18
templates/org/settings/applications.tmpl
Normal file
18
templates/org/settings/applications.tmpl
Normal file
@@ -0,0 +1,18 @@
|
||||
{{template "base/head" .}}
|
||||
<div class="page-content organization settings options">
|
||||
{{template "org/header" .}}
|
||||
<div class="ui container">
|
||||
<div class="ui grid">
|
||||
{{template "org/settings/navbar" .}}
|
||||
<div class="twelve wide column content">
|
||||
{{template "base/alert" .}}
|
||||
<h4 class="ui top attached header">
|
||||
{{.locale.Tr "settings.applications"}}
|
||||
</h4>
|
||||
|
||||
{{template "user/settings/applications_oauth2_list" .}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "base/footer" .}}
|
7
templates/org/settings/applications_oauth2_edit.tmpl
Normal file
7
templates/org/settings/applications_oauth2_edit.tmpl
Normal file
@@ -0,0 +1,7 @@
|
||||
{{template "base/head" .}}
|
||||
<div class="page-content organization settings options">
|
||||
{{template "org/header" .}}
|
||||
|
||||
{{template "user/settings/applications_oauth2_edit_form" .}}
|
||||
</div>
|
||||
{{template "base/footer" .}}
|
@@ -12,6 +12,11 @@
|
||||
<a class="{{if .PageIsOrgSettingsLabels}}active{{end}} item" href="{{.OrgLink}}/settings/labels">
|
||||
{{.locale.Tr "repo.labels"}}
|
||||
</a>
|
||||
{{if .EnableOAuth2}}
|
||||
<a class="{{if .PageIsSettingsApplications}}active{{end}} item" href="{{.OrgLink}}/settings/applications">
|
||||
{{.locale.Tr "settings.applications"}}
|
||||
</a>
|
||||
{{end}}
|
||||
<a class="{{if .PageIsSettingsDelete}}active{{end}} item" href="{{.OrgLink}}/settings/delete">
|
||||
{{.locale.Tr "org.settings.delete"}}
|
||||
</a>
|
||||
|
Reference in New Issue
Block a user