Skip to content

Commit

Permalink
Change to vertical navbar layout for secondary navbar for repo/user/a…
Browse files Browse the repository at this point in the history
…dmin settings (#24246)

Co-Author: @wxiaoguang 

This is the first step of #24229. And this PR will only includes html
changes, and followed by other PRs that fine tune css and change to
submenus.

After:

Admin Level

<img width="1400" alt="Screen Shot 2023-04-21 at 10 07 16"
src="https://user-images.githubusercontent.com/17645053/233523870-f848b61d-056a-4b41-9760-a9a49fea1fe8.png">

User Level

<img width="1422" alt="Screen Shot 2023-04-21 at 10 07 23"
src="https://user-images.githubusercontent.com/17645053/233523878-979adb20-a657-43d9-99a6-ad414010c0ef.png">

Repo Level

<img width="1404" alt="Screen Shot 2023-04-21 at 10 07 07"
src="https://user-images.githubusercontent.com/17645053/233523863-337440bd-c03a-4dfd-87fa-cef40300bfe0.png">

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
  • Loading branch information
HesterG and wxiaoguang committed Apr 23, 2023
1 parent 476a043 commit 44e0cfa
Show file tree
Hide file tree
Showing 85 changed files with 350 additions and 582 deletions.
20 changes: 7 additions & 13 deletions templates/admin/applications/list.tmpl
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
{{template "base/head" .}}
<div role="main" aria-label="{{.Title}}" class="page-content admin config">
{{template "admin/navbar" .}}
<div class="ui container">
<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>
{{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin config")}}
<div class="admin-setting-content">
<h4 class="ui top attached header">
{{.locale.Tr "settings.applications"}}
</h4>
{{template "user/settings/applications_oauth2_list" .}}
</div>
</div>
{{template "base/footer" .}}
{{template "admin/layout_footer" .}}
11 changes: 5 additions & 6 deletions templates/admin/applications/oauth2_edit.tmpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{{template "base/head" .}}
<div role="main" aria-label="{{.Title}}" class="page-content admin config">
{{template "admin/navbar" .}}
{{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin config")}}
<div class="admin-setting-content">

{{template "user/settings/applications_oauth2_edit_form" .}}
</div>
{{template "base/footer" .}}
{{template "user/settings/applications_oauth2_edit_form" .}}
</div>
{{template "admin/layout_footer" .}}
11 changes: 4 additions & 7 deletions templates/admin/auth/edit.tmpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{{template "base/head" .}}
<div role="main" aria-label="{{.Title}}" class="page-content admin edit authentication">
{{template "admin/navbar" .}}
<div class="ui container">
{{template "base/alert" .}}
{{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin edit authentication")}}
<div class="admin-setting-content">
<h4 class="ui top attached header">
{{.locale.Tr "admin.auths.edit"}}
</h4>
Expand Down Expand Up @@ -438,7 +435,6 @@
</form>
</div>
</div>
</div>

<div class="ui gitea-confirm-modal delete modal">
<div class="header">
Expand All @@ -450,4 +446,5 @@
</div>
{{template "base/modal_actions_confirm" .}}
</div>
{{template "base/footer" .}}

{{template "admin/layout_footer" .}}
10 changes: 3 additions & 7 deletions templates/admin/auth/list.tmpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{{template "base/head" .}}
<div role="main" aria-label="{{.Title}}" class="page-content admin authentication">
{{template "admin/navbar" .}}
<div class="ui container">
{{template "base/alert" .}}
{{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin authentication")}}
<div class="admin-setting-content">
<h4 class="ui top attached header">
{{.locale.Tr "admin.auths.auth_manage_panel"}} ({{.locale.Tr "admin.total" .Total}})
<div class="ui right">
Expand Down Expand Up @@ -38,5 +35,4 @@
</table>
</div>
</div>
</div>
{{template "base/footer" .}}
{{template "admin/layout_footer" .}}
10 changes: 3 additions & 7 deletions templates/admin/auth/new.tmpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{{template "base/head" .}}
<div role="main" aria-label="{{.Title}}" class="page-content admin new authentication">
{{template "admin/navbar" .}}
<div class="ui container">
{{template "base/alert" .}}
{{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin new authentication")}}
<div class="admin-setting-content">
<h4 class="ui top attached header">
{{.locale.Tr "admin.auths.new"}}
</h4>
Expand Down Expand Up @@ -122,5 +119,4 @@
</div>
</div>
</div>
</div>
{{template "base/footer" .}}
{{template "admin/layout_footer" .}}
10 changes: 3 additions & 7 deletions templates/admin/config.tmpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{{template "base/head" .}}
<div role="main" aria-label="{{.Title}}" class="page-content admin config">
{{template "admin/navbar" .}}
<div class="ui container">
{{template "base/alert" .}}
{{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin config")}}
<div class="admin-setting-content">
<h4 class="ui top attached header">
{{.locale.Tr "admin.config.server_config"}}
</h4>
Expand Down Expand Up @@ -426,5 +423,4 @@
</dl>
</div>
</div>
</div>
{{template "base/footer" .}}
{{template "admin/layout_footer" .}}
10 changes: 3 additions & 7 deletions templates/admin/dashboard.tmpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{{template "base/head" .}}
<div role="main" aria-label="{{.Title}}" class="page-content admin dashboard">
{{template "admin/navbar" .}}
<div class="ui container">
{{template "base/alert" .}}
{{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin dashboard")}}
<div class="admin-setting-content">
{{if .NeedUpdate}}
<div class="ui negative message flash-error">
<p>{{(.locale.Tr "admin.dashboard.new_version_hint" .RemoteVersion AppVer) | Str2html}}</p>
Expand Down Expand Up @@ -145,5 +142,4 @@
</dl>
</div>
</div>
</div>
{{template "base/footer" .}}
{{template "admin/layout_footer" .}}
10 changes: 3 additions & 7 deletions templates/admin/emails/list.tmpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{{template "base/head" .}}
<div role="main" aria-label="{{.Title}}" class="page-content admin user">
{{template "admin/navbar" .}}
<div class="ui container">
{{template "base/alert" .}}
{{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin user")}}
<div class="admin-setting-content">
<h4 class="ui top attached header">
{{.locale.Tr "admin.emails.email_manage_panel"}} ({{.locale.Tr "admin.total" .Total}})
</h4>
Expand Down Expand Up @@ -101,5 +98,4 @@
</div>

</div>
</div>
{{template "base/footer" .}}
{{template "admin/layout_footer" .}}
10 changes: 3 additions & 7 deletions templates/admin/hook_new.tmpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{{template "base/head" .}}
<div role="main" aria-label="{{.Title}}" class="page-content admin settings new webhook">
{{template "admin/navbar" .}}
<div class="ui container">
{{template "base/alert" .}}
{{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin settings new webhook")}}
<div class="admin-setting-content">
<h4 class="ui top attached header">
{{if .PageIsAdminDefaultHooksNew}}
{{.locale.Tr "admin.defaulthooks.add_webhook"}}
Expand Down Expand Up @@ -55,5 +52,4 @@

{{template "repo/settings/webhook/history" .}}
</div>
</div>
{{template "base/footer" .}}
{{template "admin/layout_footer" .}}
10 changes: 3 additions & 7 deletions templates/admin/hooks.tmpl
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
{{template "base/head" .}}
<div role="main" aria-label="{{.Title}}" class="page-content admin hooks">
{{template "admin/navbar" .}}
<div class="ui container">
{{template "base/alert" .}}
{{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin hooks")}}
<div class="admin-setting-content">

{{template "repo/settings/webhook/base_list" .SystemWebhooks}}
{{template "repo/settings/webhook/base_list" .DefaultWebhooks}}

{{template "repo/settings/webhook/delete_modal" .}}
</div>
</div>
{{template "base/footer" .}}
{{template "admin/layout_footer" .}}
11 changes: 11 additions & 0 deletions templates/admin/layout_footer.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{if false}}{{/* to make html structure "likely" complete to prevent IDE warnings */}}
<div class="page-content">
<div class="admin-layout-right">
<div>
{{/* block: admin-setting-content */}}
{{end}}

</div>
</div>
</div>
{{template "base/footer" .}}
13 changes: 13 additions & 0 deletions templates/admin/layout_head.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{template "base/head" .ctxData}}
<div role="main" aria-label="{{.ctxData.Title}}" class="page-content {{.pageClass}}">
<div class="ui container stackable grid">
{{template "admin/navbar" .ctxData}}
<div class="twelve wide column">
{{template "base/alert" .ctxData}}
{{/* block: admin-setting-content */}}

{{if false}}{{/* to make html structure "likely" complete to prevent IDE warnings */}}
</div>
</div>
</div>
{{end}}
14 changes: 6 additions & 8 deletions templates/admin/monitor.tmpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{{template "base/head" .}}
<div role="main" aria-label="{{.Title}}" class="page-content admin monitor">
{{template "admin/navbar" .}}
<div class="ui container">
{{template "base/alert" .}}
{{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin monitor")}}
<div class="admin-setting-content">
{{template "admin/cron" .}}
<h4 class="ui top attached header">
{{.locale.Tr "admin.monitor.queues"}}
Expand All @@ -26,7 +23,7 @@
<td>{{.Type}}</td>
<td>{{.ExemplarType}}</td>
<td>{{$sum := .NumberOfWorkers}}{{if lt $sum 0}}-{{else}}{{$sum}}{{end}}</td>
<td>{{$sum := .NumberInQueue}}{{if lt $sum 0}}-{{else}}{{$sum}}{{end}}</td>
<td>{{$sum = .NumberInQueue}}{{if lt $sum 0}}-{{else}}{{$sum}}{{end}}</td>
<td><a href="{{$.Link}}/queue/{{.QID}}" class="button">{{if lt $sum 0}}{{$.locale.Tr "admin.monitor.queue.review"}}{{else}}{{$.locale.Tr "admin.monitor.queue.review_add"}}{{end}}</a>
</tr>
{{end}}
Expand All @@ -36,7 +33,7 @@

{{template "admin/process" .}}
</div>
</div>

<div class="ui gitea-confirm-modal delete modal">
<div class="header">
{{.locale.Tr "admin.monitor.process.cancel"}}
Expand All @@ -47,4 +44,5 @@
</div>
{{template "base/modal_actions_confirm" .}}
</div>
{{template "base/footer" .}}

{{template "admin/layout_footer" .}}
5 changes: 3 additions & 2 deletions templates/admin/navbar.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<div class="ui secondary pointing tabular top attached borderless menu stackable new-menu navbar">
<div class="new-menu-inner">
<div class="four wide column">
<div class="ui fluid vertical menu">
<div class="header item">{{.locale.Tr "settings"}}</div>
<a class="{{if .PageIsAdminDashboard}}active {{end}}item" href="{{AppSubUrl}}/admin">
{{.locale.Tr "admin.dashboard"}}
</a>
Expand Down
11 changes: 4 additions & 7 deletions templates/admin/notice.tmpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{{template "base/head" .}}
<div role="main" aria-label="{{.Title}}" class="page-content admin notice">
{{template "admin/navbar" .}}
<div class="ui container">
{{template "base/alert" .}}
{{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin notice")}}
<div class="admin-setting-content">
<h4 class="ui top attached header">
{{.locale.Tr "admin.notices.system_notice_list"}} ({{.locale.Tr "admin.total" .Total}})
</h4>
Expand Down Expand Up @@ -69,7 +66,6 @@

{{template "base/paginate" .}}
</div>
</div>

<div class="ui modal admin" id="detail-modal">
<div class="header">{{$.locale.Tr "admin.notices.view_detail_header"}}</div>
Expand All @@ -78,4 +74,5 @@
<pre></pre>
</div>
</div>
{{template "base/footer" .}}

{{template "admin/layout_footer" .}}
10 changes: 3 additions & 7 deletions templates/admin/org/list.tmpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{{template "base/head" .}}
<div role="main" aria-label="{{.Title}}" class="page-content admin user">
{{template "admin/navbar" .}}
<div class="ui container">
{{template "base/alert" .}}
{{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin user")}}
<div class="admin-setting-content">
<h4 class="ui top attached header">
{{.locale.Tr "admin.orgs.org_manage_panel"}} ({{.locale.Tr "admin.total" .Total}})
<div class="ui right">
Expand Down Expand Up @@ -54,5 +51,4 @@

{{template "base/paginate" .}}
</div>
</div>
{{template "base/footer" .}}
{{template "admin/layout_footer" .}}
11 changes: 4 additions & 7 deletions templates/admin/packages/list.tmpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{{template "base/head" .}}
<div role="main" aria-label="{{.Title}}" class="page-content admin user">
{{template "admin/navbar" .}}
<div class="ui container">
{{template "base/alert" .}}
{{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin user")}}
<div class="admin-setting-content">
<h4 class="ui top attached header">
{{.locale.Tr "admin.packages.package_manage_panel"}} ({{.locale.Tr "admin.total" .TotalCount}},
{{.locale.Tr "admin.packages.total_size" (FileSize .TotalBlobSize)}},
Expand Down Expand Up @@ -78,7 +75,6 @@

{{template "base/paginate" .}}
</div>
</div>

<div class="ui gitea-confirm-modal delete modal">
<div class="header">
Expand All @@ -90,4 +86,5 @@
</div>
{{template "base/modal_actions_confirm" .}}
</div>
{{template "base/footer" .}}

{{template "admin/layout_footer" .}}
15 changes: 6 additions & 9 deletions templates/admin/queue.tmpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{{template "base/head" .}}
<div role="main" aria-label="{{.Title}}" class="page-content admin monitor">
{{template "admin/navbar" .}}
<div class="ui container">
{{template "base/alert" .}}
{{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin monitor")}}
<div class="admin-setting-content">
<h4 class="ui top attached header">
{{.locale.Tr "admin.monitor.queue" .Queue.Name}}
</h4>
Expand All @@ -25,7 +22,7 @@
<td>{{.Queue.ExemplarType}}</td>
<td>{{$sum := .Queue.NumberOfWorkers}}{{if lt $sum 0}}-{{else}}{{$sum}}{{end}}</td>
<td>{{if lt $sum 0}}-{{else}}{{.Queue.MaxNumberOfWorkers}}{{end}}</td>
<td>{{$sum := .Queue.NumberInQueue}}{{if lt $sum 0}}-{{else}}{{$sum}}{{end}}</td>
<td>{{$sum = .Queue.NumberInQueue}}{{if lt $sum 0}}-{{else}}{{$sum}}{{end}}</td>
</tr>
</tbody>
</table>
Expand Down Expand Up @@ -177,10 +174,10 @@
{{.locale.Tr "admin.monitor.queue.configuration"}}
</h4>
<div class="ui attached segment">
<pre>{{.Queue.Configuration | JsonPrettyPrint}}
<pre>{{.Queue.Configuration | JsonPrettyPrint}}</pre>
</div>
</div>
</div>

<div class="ui gitea-confirm-modal delete modal">
<div class="header">
{{.locale.Tr "admin.monitor.queue.pool.cancel"}}
Expand All @@ -192,4 +189,4 @@
{{template "base/modal_actions_confirm" .}}
</div>

{{template "base/footer" .}}
{{template "admin/layout_footer" .}}
11 changes: 4 additions & 7 deletions templates/admin/repo/list.tmpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{{template "base/head" .}}
<div role="main" aria-label="{{.Title}}" class="page-content admin user">
{{template "admin/navbar" .}}
<div class="ui container">
{{template "base/alert" .}}
{{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin user")}}
<div class="admin-setting-content">
<h4 class="ui top attached header">
{{.locale.Tr "admin.repos.repo_manage_panel"}} ({{.locale.Tr "admin.total" .Total}})
<div class="ui right">
Expand Down Expand Up @@ -93,7 +90,6 @@

{{template "base/paginate" .}}
</div>
</div>

<div class="ui gitea-confirm-modal delete modal">
<div class="header">
Expand All @@ -107,4 +103,5 @@
</div>
{{template "base/modal_actions_confirm" .}}
</div>
{{template "base/footer" .}}

{{template "admin/layout_footer" .}}
Loading

0 comments on commit 44e0cfa

Please sign in to comment.