From fad7ea3a6fcd28128f6cf0a429d262edb525d345 Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 17 Aug 2023 01:59:25 +0200 Subject: [PATCH 1/7] Minor dashboard tweaks --- templates/user/dashboard/feeds.tmpl | 2 +- templates/user/heatmap.tmpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/user/dashboard/feeds.tmpl b/templates/user/dashboard/feeds.tmpl index 6bfd8b12be710..bf697634741ad 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/heatmap.tmpl b/templates/user/heatmap.tmpl index 3bf7e6cbbc87e..2102368d0b61d 100644 --- a/templates/user/heatmap.tmpl +++ b/templates/user/heatmap.tmpl @@ -6,5 +6,5 @@ data-locale-more="{{.locale.Tr "heatmap.more"}}" data-locale-less="{{.locale.Tr "heatmap.less"}}" > -
+
{{end}} From 70a1c8e9402766624e0653b70a8609f95cad3f65 Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 31 Aug 2023 01:22:28 +0200 Subject: [PATCH 2/7] more general padding removal fix --- templates/user/heatmap.tmpl | 2 +- web_src/css/shared/flex-list.css | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/templates/user/heatmap.tmpl b/templates/user/heatmap.tmpl index 2102368d0b61d..3bf7e6cbbc87e 100644 --- a/templates/user/heatmap.tmpl +++ b/templates/user/heatmap.tmpl @@ -6,5 +6,5 @@ data-locale-more="{{.locale.Tr "heatmap.more"}}" data-locale-less="{{.locale.Tr "heatmap.less"}}" > -
+
{{end}} diff --git a/web_src/css/shared/flex-list.css b/web_src/css/shared/flex-list.css index 1489983cfdcbf..36864fd2679da 100644 --- a/web_src/css/shared/flex-list.css +++ b/web_src/css/shared/flex-list.css @@ -91,11 +91,11 @@ 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 */ -.ui.segment > .flex-list:first-child > .flex-item:first-child { +/* remove padding on first and last child so it better fits into .ui.segment or + when preceded by a .ui.divider */ +.flex-list > .flex-item:first-child { padding-top: 0; } - -.ui.segment > .flex-list:last-child > .flex-item:last-child { +.flex-list > .flex-item:last-child { padding-bottom: 0; } From 6200d49309b86656412fb3faa3a59422c101f2fb Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 31 Aug 2023 01:26:00 +0200 Subject: [PATCH 3/7] adapt devtest to use plain dividers --- templates/devtest/flex-list.tmpl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/templates/devtest/flex-list.tmpl b/templates/devtest/flex-list.tmpl index cbc2632139372..c962ba8c724b9 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")

From ef820bfcb5b148babf09d3479e0d0bb52673906a Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 31 Aug 2023 01:31:30 +0200 Subject: [PATCH 4/7] update comment --- web_src/css/shared/flex-list.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_src/css/shared/flex-list.css b/web_src/css/shared/flex-list.css index 36864fd2679da..7ecd7f7c09fb5 100644 --- a/web_src/css/shared/flex-list.css +++ b/web_src/css/shared/flex-list.css @@ -92,7 +92,7 @@ } /* remove padding on first and last child so it better fits into .ui.segment or - when preceded by a .ui.divider */ + when preceded or followed by a .ui.divider */ .flex-list > .flex-item:first-child { padding-top: 0; } From cf75825222511f9f1e623709b8973b75049b1a8b Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Thu, 31 Aug 2023 11:19:43 +0800 Subject: [PATCH 5/7] fix --- templates/devtest/flex-list.tmpl | 10 +++++++++- 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/settings/keys_gpg.tmpl | 2 +- templates/user/settings/keys_ssh.tmpl | 2 +- web_src/css/shared/flex-list.css | 20 ++++++++++++++++---- 9 files changed, 38 insertions(+), 14 deletions(-) diff --git a/templates/devtest/flex-list.tmpl b/templates/devtest/flex-list.tmpl index c962ba8c724b9..80cd22440d48e 100644 --- a/templates/devtest/flex-list.tmpl +++ b/templates/devtest/flex-list.tmpl @@ -3,7 +3,7 @@

Flex List (standalone)

-
+
@@ -102,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 7cc11b073e13b..afa360fd93d18 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 897f4d716ae86..e8043b9abba35 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 1a45733b77ca4..d8e27fab52ab7 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 10e79f6b82ac4..a9e540bc65d61 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 72cf1dd6c8292..2cd0fb92ac5f7 100644 --- a/templates/shared/issuelist.tmpl +++ b/templates/shared/issuelist.tmpl @@ -1,4 +1,4 @@ -
+
{{$approvalCounts := .ApprovalCounts}} {{range .Issues}}
diff --git a/templates/user/settings/keys_gpg.tmpl b/templates/user/settings/keys_gpg.tmpl index 5ab96eb63adae..e7a66de23f72e 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 0d2916d30cd5d..30c4133b6e331 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/shared/flex-list.css b/web_src/css/shared/flex-list.css index 7ecd7f7c09fb5..27f9bc2d69e8e 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); } -/* remove padding on first and last child so it better fits into .ui.segment or - when preceded or followed by a .ui.divider */ -.flex-list > .flex-item:first-child { +/* 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-item:last-child { + +.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; +} From 914344eee6a8d4d2baa54eedb101ec544f246046 Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 31 Aug 2023 22:49:44 +0200 Subject: [PATCH 6/7] fix margin on user dashboard by removing useless wrapper --- templates/user/profile.tmpl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/templates/user/profile.tmpl b/templates/user/profile.tmpl index 396d9ebcd4701..2b81a23492876 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" .}} From 65d6fa73f43e5351073aa30af636b706937c9e37 Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 31 Aug 2023 22:51:28 +0200 Subject: [PATCH 7/7] remove dead css --- web_src/css/dashboard.css | 7 ------- 1 file changed, 7 deletions(-) diff --git a/web_src/css/dashboard.css b/web_src/css/dashboard.css index 6dcf73e2a772f..0168ee0bd70ac 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; -}