Skip to content

Commit 24c3bb9

Browse files
authored
Categorize admin settings sidebar panel (#26030)
This PR reorganize and categorize the admin settings sidebar panel into groups: - User Accounts, User Emails, Organizations, Authentication Sources -> Identity & Access - Repositories, Packages -> Code Assets - Webhooks, Applications -> Integrations Before: <img width="1346" alt="Screen Shot 2023-07-21 at 10 30 28" src="https://github.com/go-gitea/gitea/assets/17645053/e0c5ae83-464f-4aaa-8bab-2c5258c9278d"> After: all configurable settings enabled (package, oauth, webhook) <img width="1153" alt="Screen Shot 2023-07-21 at 10 27 30" src="https://github.com/go-gitea/gitea/assets/17645053/88acf3f5-0623-4307-8654-69c654d80874"> all configurable settings disabled (package, oauth, webhook) <img width="1391" alt="Screen Shot 2023-07-21 at 10 25 19" src="https://github.com/go-gitea/gitea/assets/17645053/9e13aa60-e75c-4077-afd6-3da9e0ae18dd"> only oauth enabled <img width="1323" alt="Screen Shot 2023-07-21 at 10 26 23" src="https://github.com/go-gitea/gitea/assets/17645053/ce4f9ec0-b141-4d5e-ac13-46d001724dc5"> only webhook enabled <img width="1350" alt="Screen Shot 2023-07-21 at 10 26 55" src="https://github.com/go-gitea/gitea/assets/17645053/702491bd-083e-44fa-82bc-52c4571e54ac">
1 parent 4e4a71f commit 24c3bb9

File tree

2 files changed

+54
-26
lines changed

2 files changed

+54
-26
lines changed

options/locale/locale_en-US.ini

+3
Original file line numberDiff line numberDiff line change
@@ -2627,10 +2627,13 @@ teams.invite.description = Please click the button below to join the team.
26272627
26282628
[admin]
26292629
dashboard = Dashboard
2630+
identity_access = Identity & Access
26302631
users = User Accounts
26312632
organizations = Organizations
2633+
assets = Code Assets
26322634
repositories = Repositories
26332635
hooks = Webhooks
2636+
integrations = Integrations
26342637
authentication = Authentication Sources
26352638
emails = User Emails
26362639
config = Configuration

templates/admin/navbar.tmpl

+51-26
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,60 @@
44
<a class="{{if .PageIsAdminDashboard}}active {{end}}item" href="{{AppSubUrl}}/admin">
55
{{.locale.Tr "admin.dashboard"}}
66
</a>
7-
<a class="{{if .PageIsAdminUsers}}active {{end}}item" href="{{AppSubUrl}}/admin/users">
8-
{{.locale.Tr "admin.users"}}
9-
</a>
10-
<a class="{{if .PageIsAdminOrganizations}}active {{end}}item" href="{{AppSubUrl}}/admin/orgs">
11-
{{.locale.Tr "admin.organizations"}}
12-
</a>
13-
<a class="{{if .PageIsAdminRepositories}}active {{end}}item" href="{{AppSubUrl}}/admin/repos">
14-
{{.locale.Tr "admin.repositories"}}
15-
</a>
16-
{{if .EnablePackages}}
17-
<a class="{{if .PageIsAdminPackages}}active {{end}}item" href="{{AppSubUrl}}/admin/packages">
18-
{{.locale.Tr "packages.title"}}
19-
</a>
20-
{{end}}
21-
{{if not DisableWebhooks}}
7+
<details class="item toggleable-item" {{if or .PageIsAdminUsers .PageIsAdminEmails .PageIsAdminOrganizations .PageIsAdminAuthentications}}open{{end}}>
8+
<summary>{{.locale.Tr "admin.identity_access"}}</summary>
9+
<div class="menu">
10+
<a class="{{if .PageIsAdminAuthentications}}active {{end}}item" href="{{AppSubUrl}}/admin/auths">
11+
{{.locale.Tr "admin.authentication"}}
12+
</a>
13+
<a class="{{if .PageIsAdminOrganizations}}active {{end}}item" href="{{AppSubUrl}}/admin/orgs">
14+
{{.locale.Tr "admin.organizations"}}
15+
</a>
16+
<a class="{{if .PageIsAdminUsers}}active {{end}}item" href="{{AppSubUrl}}/admin/users">
17+
{{.locale.Tr "admin.users"}}
18+
</a>
19+
<a class="{{if .PageIsAdminEmails}}active {{end}}item" href="{{AppSubUrl}}/admin/emails">
20+
{{.locale.Tr "admin.emails"}}
21+
</a>
22+
</div>
23+
</details>
24+
<details class="item toggleable-item" {{if or .PageIsAdminRepositories (and .EnablePackages .PageIsAdminPackages)}}open{{end}}>
25+
<summary>{{.locale.Tr "admin.assets"}}</summary>
26+
<div class="menu">
27+
{{if .EnablePackages}}
28+
<a class="{{if .PageIsAdminPackages}}active {{end}}item" href="{{AppSubUrl}}/admin/packages">
29+
{{.locale.Tr "packages.title"}}
30+
</a>
31+
{{end}}
32+
<a class="{{if .PageIsAdminRepositories}}active {{end}}item" href="{{AppSubUrl}}/admin/repos">
33+
{{.locale.Tr "admin.repositories"}}
34+
</a>
35+
</div>
36+
</details>
37+
<!-- Webhooks and OAuth can be both disabled here, so add this if statement to display different ui -->
38+
{{if and (not DisableWebhooks) .EnableOAuth2}}
39+
<details class="item toggleable-item" {{if or .PageIsAdminDefaultHooks .PageIsAdminSystemHooks .PageIsAdminApplications}}open{{end}}>
40+
<summary>{{.locale.Tr "admin.integrations"}}</summary>
41+
<div class="menu">
42+
<a class="{{if .PageIsAdminApplications}}active {{end}}item" href="{{AppSubUrl}}/admin/applications">
43+
{{.locale.Tr "settings.applications"}}
44+
</a>
45+
<a class="{{if or .PageIsAdminDefaultHooks .PageIsAdminSystemHooks}}active {{end}}item" href="{{AppSubUrl}}/admin/hooks">
46+
{{.locale.Tr "admin.hooks"}}
47+
</a>
48+
</div>
49+
</details>
50+
{{else}}
51+
{{if not DisableWebhooks}}
2252
<a class="{{if or .PageIsAdminDefaultHooks .PageIsAdminSystemHooks}}active {{end}}item" href="{{AppSubUrl}}/admin/hooks">
2353
{{.locale.Tr "admin.hooks"}}
2454
</a>
25-
{{end}}
26-
<a class="{{if .PageIsAdminAuthentications}}active {{end}}item" href="{{AppSubUrl}}/admin/auths">
27-
{{.locale.Tr "admin.authentication"}}
28-
</a>
29-
<a class="{{if .PageIsAdminEmails}}active {{end}}item" href="{{AppSubUrl}}/admin/emails">
30-
{{.locale.Tr "admin.emails"}}
31-
</a>
32-
{{if .EnableOAuth2}}
33-
<a class="{{if .PageIsAdminApplications}}active {{end}}item" href="{{AppSubUrl}}/admin/applications">
34-
{{.locale.Tr "settings.applications"}}
35-
</a>
55+
{{end}}
56+
{{if .EnableOAuth2}}
57+
<a class="{{if .PageIsAdminApplications}}active {{end}}item" href="{{AppSubUrl}}/admin/applications">
58+
{{.locale.Tr "settings.applications"}}
59+
</a>
60+
{{end}}
3661
{{end}}
3762
{{if .EnableActions}}
3863
<details class="item toggleable-item" {{if .PageIsSharedSettingsRunners}}open{{end}}>

0 commit comments

Comments
 (0)