aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorHesterG <hestergong@gmail.com>2023-06-07 10:49:48 +0800
committerGitHub <noreply@github.com>2023-06-07 10:49:48 +0800
commit58536093b3112841bc69edb542189893b57e7a47 (patch)
tree0402280727eb536151dd3edc4cf8f54d42c27a49 /templates
parent379ec1303013d0440dbeebf8e639f2e7844ecb18 (diff)
downloadgitea-58536093b3112841bc69edb542189893b57e7a47.tar.gz
gitea-58536093b3112841bc69edb542189893b57e7a47.zip
Add details summary for vertical menus in settings to allow toggling (#25098)
Close #25051 [referenced answer](https://stackoverflow.com/questions/10813581/can-i-replace-the-expand-icon-of-the-details-element/69722686#69722686) for marker overwrite. One limitation is that fomantic does not have hover and active effects for the vertical submenu ([reference](https://fomantic-ui.com/collections/menu.html#sub-menu)). And we might need to overwrite some styles if hover and active effects are needed. Update: Used `data:image/svg` instead of `marker` content. And adjusted styles for hover effect. Take admin settings as an example: https://github.com/go-gitea/gitea/assets/17645053/63f69823-ef43-47d5-a518-544b5ea35ba6 --------- Co-authored-by: silverwind <me@silverwind.io>
Diffstat (limited to 'templates')
-rw-r--r--templates/admin/navbar.tmpl12
-rw-r--r--templates/org/settings/navbar.tmpl6
-rw-r--r--templates/repo/settings/navbar.tmpl6
-rw-r--r--templates/user/settings/navbar.tmpl6
4 files changed, 15 insertions, 15 deletions
diff --git a/templates/admin/navbar.tmpl b/templates/admin/navbar.tmpl
index 777fe29924..641d3fad81 100644
--- a/templates/admin/navbar.tmpl
+++ b/templates/admin/navbar.tmpl
@@ -35,14 +35,14 @@
</a>
{{end}}
{{if .EnableActions}}
- <div class="item">
- {{.locale.Tr "actions.actions"}}
+ <details class="item toggleable-item" {{if .PageIsSharedSettingsRunners}}open{{end}}>
+ <summary>{{.locale.Tr "actions.actions"}}</summary>
<div class="menu">
<a class="{{if .PageIsSharedSettingsRunners}}active {{end}}item" href="{{AppSubUrl}}/admin/actions/runners">
{{.locale.Tr "actions.runners"}}
</a>
</div>
- </div>
+ </details>
{{end}}
<a class="{{if .PageIsAdminConfig}}active {{end}}item" href="{{AppSubUrl}}/admin/config">
{{.locale.Tr "admin.config"}}
@@ -50,8 +50,8 @@
<a class="{{if .PageIsAdminNotices}}active {{end}}item" href="{{AppSubUrl}}/admin/notices">
{{.locale.Tr "admin.notices"}}
</a>
- <div class="item">
- {{.locale.Tr "admin.monitor"}}
+ <details class="item toggleable-item" {{if or .PageIsAdminMonitorStats .PageIsAdminMonitorCron .PageIsAdminMonitorQueue .PageIsAdminMonitorStacktrace}}open{{end}}>
+ <summary>{{.locale.Tr "admin.monitor"}}</summary>
<div class="menu">
<a class="{{if .PageIsAdminMonitorStats}}active {{end}}item" href="{{AppSubUrl}}/admin/monitor/stats">
{{.locale.Tr "admin.monitor.stats"}}
@@ -66,6 +66,6 @@
{{.locale.Tr "admin.monitor.stacktrace"}}
</a>
</div>
- </div>
+ </details>
</div>
</div>
diff --git a/templates/org/settings/navbar.tmpl b/templates/org/settings/navbar.tmpl
index fcce43f914..6bea9f5f60 100644
--- a/templates/org/settings/navbar.tmpl
+++ b/templates/org/settings/navbar.tmpl
@@ -23,8 +23,8 @@
</a>
{{end}}
{{if .EnableActions}}
- <div class="item">
- {{.locale.Tr "actions.actions"}}
+ <details class="item toggleable-item" {{if or .PageIsSharedSettingsRunners .PageIsSharedSettingsSecrets}}open{{end}}>
+ <summary>{{.locale.Tr "actions.actions"}}</summary>
<div class="menu">
<a class="{{if .PageIsSharedSettingsRunners}}active {{end}}item" href="{{.OrgLink}}/settings/actions/runners">
{{.locale.Tr "actions.runners"}}
@@ -33,7 +33,7 @@
{{.locale.Tr "secrets.secrets"}}
</a>
</div>
- </div>
+ </details>
{{end}}
<a class="{{if .PageIsSettingsDelete}}active {{end}}item" href="{{.OrgLink}}/settings/delete">
{{.locale.Tr "org.settings.delete"}}
diff --git a/templates/repo/settings/navbar.tmpl b/templates/repo/settings/navbar.tmpl
index b1beda7c94..e21f23f6a0 100644
--- a/templates/repo/settings/navbar.tmpl
+++ b/templates/repo/settings/navbar.tmpl
@@ -34,8 +34,8 @@
</a>
{{end}}
{{if and .EnableActions (not .UnitActionsGlobalDisabled) (.Permission.CanRead $.UnitTypeActions)}}
- <div class="item">
- {{.locale.Tr "actions.actions"}}
+ <details class="item toggleable-item" {{if or .PageIsSharedSettingsRunners .PageIsSharedSettingsSecrets}}open{{end}}>
+ <summary>{{.locale.Tr "actions.actions"}}</summary>
<div class="menu">
<a class="{{if .PageIsSharedSettingsRunners}}active {{end}}item" href="{{.RepoLink}}/settings/actions/runners">
{{.locale.Tr "actions.runners"}}
@@ -44,7 +44,7 @@
{{.locale.Tr "secrets.secrets"}}
</a>
</div>
- </div>
+ </details>
{{end}}
</div>
</div>
diff --git a/templates/user/settings/navbar.tmpl b/templates/user/settings/navbar.tmpl
index 26f4982029..4ef2abeaab 100644
--- a/templates/user/settings/navbar.tmpl
+++ b/templates/user/settings/navbar.tmpl
@@ -20,8 +20,8 @@
{{.locale.Tr "settings.ssh_gpg_keys"}}
</a>
{{if .EnableActions}}
- <div class="item">
- {{.locale.Tr "actions.actions"}}
+ <details class="item toggleable-item" {{if or .PageIsSharedSettingsRunners .PageIsSharedSettingsSecrets}}open{{end}}>
+ <summary>{{.locale.Tr "actions.actions"}}</summary>
<div class="menu">
<a class="{{if .PageIsSharedSettingsRunners}}active {{end}}item" href="{{AppSubUrl}}/user/settings/actions/runners">
{{.locale.Tr "actions.runners"}}
@@ -30,7 +30,7 @@
{{.locale.Tr "secrets.secrets"}}
</a>
</div>
- </div>
+ </details>
{{end}}
{{if .EnablePackages}}
<a class="{{if .PageIsSettingsPackages}}active {{end}}item" href="{{AppSubUrl}}/user/settings/packages">