summaryrefslogtreecommitdiffstats
path: root/templates/org/settings
diff options
context:
space:
mode:
authorqwerty287 <80460567+qwerty287@users.noreply.github.com>2022-10-09 14:07:41 +0200
committerGitHub <noreply@github.com>2022-10-09 20:07:41 +0800
commita813c9d8f3862fec934ff657fb4e490530167183 (patch)
tree877ca996565a94fa0f22d53e9e737dfd47ba8077 /templates/org/settings
parent97f3f1988b2b544350f58aa8b49cb958bb4da5b5 (diff)
downloadgitea-a813c9d8f3862fec934ff657fb4e490530167183.tar.gz
gitea-a813c9d8f3862fec934ff657fb4e490530167183.zip
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>
Diffstat (limited to 'templates/org/settings')
-rw-r--r--templates/org/settings/applications.tmpl18
-rw-r--r--templates/org/settings/applications_oauth2_edit.tmpl7
-rw-r--r--templates/org/settings/navbar.tmpl5
3 files changed, 30 insertions, 0 deletions
diff --git a/templates/org/settings/applications.tmpl b/templates/org/settings/applications.tmpl
new file mode 100644
index 0000000000..8bdd99deb8
--- /dev/null
+++ b/templates/org/settings/applications.tmpl
@@ -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" .}}
diff --git a/templates/org/settings/applications_oauth2_edit.tmpl b/templates/org/settings/applications_oauth2_edit.tmpl
new file mode 100644
index 0000000000..2c7fa842b3
--- /dev/null
+++ b/templates/org/settings/applications_oauth2_edit.tmpl
@@ -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" .}}
diff --git a/templates/org/settings/navbar.tmpl b/templates/org/settings/navbar.tmpl
index 0c8423cd75..e7cbb87344 100644
--- a/templates/org/settings/navbar.tmpl
+++ b/templates/org/settings/navbar.tmpl
@@ -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>