From 9b76df53dc5c03b059bef784f15eaa96342ab63c Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 31 Aug 2023 23:28:45 +0200 Subject: [PATCH] Minor dashboard tweaks, fix flex-list margins (#26829) Some small dashboard tweaks: - Remove margin-bottom from divider so first item does not appear to have un-equal margins - Restore previous icon color - Add slight margin-right to icon Before: Screenshot 2023-08-31 at 00 10 28 After: Screenshot 2023-08-31 at 00 10 08 --------- Co-authored-by: wxiaoguang --- templates/devtest/flex-list.tmpl | 13 +++++++++++-- templates/package/shared/list.tmpl | 6 ++++-- templates/package/shared/versionlist.tmpl | 6 ++++-- templates/repo/actions/runs_list.tmpl | 2 +- templates/repo/settings/deploy_keys.tmpl | 2 +- templates/shared/issuelist.tmpl | 2 +- templates/user/dashboard/feeds.tmpl | 2 +- templates/user/profile.tmpl | 4 +--- templates/user/settings/keys_gpg.tmpl | 2 +- templates/user/settings/keys_ssh.tmpl | 2 +- web_src/css/dashboard.css | 7 ------- web_src/css/shared/flex-list.css | 14 +++++++++++++- 12 files changed, 39 insertions(+), 23 deletions(-) diff --git a/templates/devtest/flex-list.tmpl b/templates/devtest/flex-list.tmpl index cbc2632139..80cd22440d 100644 --- a/templates/devtest/flex-list.tmpl +++ b/templates/devtest/flex-list.tmpl @@ -2,7 +2,8 @@
-

Flex List (standalone)

+

Flex List (standalone)

+
@@ -85,7 +86,7 @@
-
+

Flex List (with "ui segment")

@@ -101,6 +102,14 @@
item 2
+ +

If parent provides the padding/margin space:

+
+
+
item 1 (no padding top)
+
item 2 (no padding bottom)
+
+
{{template "base/footer" .}} diff --git a/templates/package/shared/list.tmpl b/templates/package/shared/list.tmpl index 7cc11b073e..afa360fd93 100644 --- a/templates/package/shared/list.tmpl +++ b/templates/package/shared/list.tmpl @@ -12,8 +12,9 @@ -
+
{{range .PackageDescriptors}} +
@@ -34,6 +35,7 @@
+
{{else}} {{if not .HasPackages}}
@@ -46,7 +48,7 @@

{{.locale.Tr "packages.empty.documentation" "https://docs.gitea.com/usage/packages/overview/" | Safe}}

{{else}} -

{{.locale.Tr "packages.filter.no_result"}}

+

{{.locale.Tr "packages.filter.no_result"}}

{{end}} {{end}} {{template "base/paginate" .}} diff --git a/templates/package/shared/versionlist.tmpl b/templates/package/shared/versionlist.tmpl index 897f4d716a..e8043b9abb 100644 --- a/templates/package/shared/versionlist.tmpl +++ b/templates/package/shared/versionlist.tmpl @@ -18,8 +18,9 @@
-
+
{{range .PackageDescriptors}} +
{{.Version.LowerVersion}} @@ -28,8 +29,9 @@
+
{{else}} -

{{.locale.Tr "packages.filter.no_result"}}

+

{{.locale.Tr "packages.filter.no_result"}}

{{end}} {{template "base/paginate" .}}
diff --git a/templates/repo/actions/runs_list.tmpl b/templates/repo/actions/runs_list.tmpl index 1a45733b77..d8e27fab52 100644 --- a/templates/repo/actions/runs_list.tmpl +++ b/templates/repo/actions/runs_list.tmpl @@ -1,4 +1,4 @@ -
+
{{if eq (len .Runs) 0}}
{{svg "octicon-no-entry" 48}} diff --git a/templates/repo/settings/deploy_keys.tmpl b/templates/repo/settings/deploy_keys.tmpl index 10e79f6b82..a9e540bc65 100644 --- a/templates/repo/settings/deploy_keys.tmpl +++ b/templates/repo/settings/deploy_keys.tmpl @@ -11,7 +11,7 @@
-
+
{{.CsrfTokenHtml}}
diff --git a/templates/shared/issuelist.tmpl b/templates/shared/issuelist.tmpl index 72cf1dd6c8..2cd0fb92ac 100644 --- a/templates/shared/issuelist.tmpl +++ b/templates/shared/issuelist.tmpl @@ -1,4 +1,4 @@ -
+
{{$approvalCounts := .ApprovalCounts}} {{range .Issues}}
diff --git a/templates/user/dashboard/feeds.tmpl b/templates/user/dashboard/feeds.tmpl index 6bfd8b12be..bf69763474 100644 --- a/templates/user/dashboard/feeds.tmpl +++ b/templates/user/dashboard/feeds.tmpl @@ -116,7 +116,7 @@
{{TimeSince .GetCreate $.locale}}
- {{svg (printf "octicon-%s" (ActionIcon .GetOpType)) 32}} + {{svg (printf "octicon-%s" (ActionIcon .GetOpType)) 32 "text grey gt-mr-2"}}
{{end}} diff --git a/templates/user/profile.tmpl b/templates/user/profile.tmpl index 396d9ebcd4..2b81a23492 100644 --- a/templates/user/profile.tmpl +++ b/templates/user/profile.tmpl @@ -17,9 +17,7 @@
{{end}} {{template "user/heatmap" .}} -
- {{template "user/dashboard/feeds" .}} -
+ {{template "user/dashboard/feeds" .}} {{else if eq .TabName "stars"}}
{{template "explore/repo_search" .}} diff --git a/templates/user/settings/keys_gpg.tmpl b/templates/user/settings/keys_gpg.tmpl index 5ab96eb63a..e7a66de23f 100644 --- a/templates/user/settings/keys_gpg.tmpl +++ b/templates/user/settings/keys_gpg.tmpl @@ -5,7 +5,7 @@
-
+
{{.CsrfTokenHtml}} diff --git a/templates/user/settings/keys_ssh.tmpl b/templates/user/settings/keys_ssh.tmpl index 0d2916d30c..30c4133b6e 100644 --- a/templates/user/settings/keys_ssh.tmpl +++ b/templates/user/settings/keys_ssh.tmpl @@ -7,7 +7,7 @@
-
+
{{.CsrfTokenHtml}}
diff --git a/web_src/css/dashboard.css b/web_src/css/dashboard.css index 6dcf73e2a7..0168ee0bd7 100644 --- a/web_src/css/dashboard.css +++ b/web_src/css/dashboard.css @@ -95,10 +95,3 @@ position: static; } } - -.feeds code { - padding: 2px 4px; - border-radius: var(--border-radius); - background-color: var(--color-markup-code-block); - word-break: break-all; -} diff --git a/web_src/css/shared/flex-list.css b/web_src/css/shared/flex-list.css index 1489983cfd..27f9bc2d69 100644 --- a/web_src/css/shared/flex-list.css +++ b/web_src/css/shared/flex-list.css @@ -91,11 +91,23 @@ border-top: 1px solid var(--color-secondary); } -/* Fomantic UI segment has default "padding: 1em", so here it removes the padding-top and padding-bottom accordingly */ +/* Fomantic UI segment has default "padding: 1em", so here it removes the padding-top and padding-bottom accordingly. +Developers could also use "flex-space-fitted" class to remove the first item's padding-top and the last item's padding-bottom */ +.flex-list.flex-space-fitted > .flex-item:first-child, .ui.segment > .flex-list:first-child > .flex-item:first-child { padding-top: 0; } +.flex-list.flex-space-fitted > .flex-item:last-child, .ui.segment > .flex-list:last-child > .flex-item:last-child { padding-bottom: 0; } + +/* If there is a divider besides the flex-list, some padding/margin are not needs */ +.divider + .flex-list > .flex-item:first-child { + padding-top: 0; +} + +.flex-list + .divider { + margin-top: 0; +}