Skip to content

Commit 9b76df5

Browse files
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: <img width="783" alt="Screenshot 2023-08-31 at 00 10 28" src="https://github.com/go-gitea/gitea/assets/115237/b75f70d7-8704-4afb-866d-fea0484c52d4"> After: <img width="783" alt="Screenshot 2023-08-31 at 00 10 08" src="https://github.com/go-gitea/gitea/assets/115237/50ed0c47-6f7c-449e-a054-13091369d43f"> --------- Co-authored-by: wxiaoguang <[email protected]>
1 parent c0ab707 commit 9b76df5

File tree

12 files changed

+39
-23
lines changed

12 files changed

+39
-23
lines changed

templates/devtest/flex-list.tmpl

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/devtest.css?v={{AssetVersion}}">
33
<div class="page-content devtest">
44
<div class="ui container">
5-
<h1 class="gt-border-secondary-bottom">Flex List (standalone)</h1>
5+
<h1>Flex List (standalone)</h1>
6+
<div class="divider"></div>
67
<div class="flex-list">
78
<div class="flex-item">
89
<div class="flex-item-leading">
@@ -85,7 +86,7 @@
8586
</div>
8687
</div>
8788

88-
<div class="divider gt-my-0"></div>
89+
<div class="divider"></div>
8990

9091
<h1>Flex List (with "ui segment")</h1>
9192
<div class="ui attached segment">
@@ -101,6 +102,14 @@
101102
<div class="flex-item">item 2</div>
102103
</div>
103104
</div>
105+
106+
<h1>If parent provides the padding/margin space:</h1>
107+
<div class="gt-border-secondary gt-py-4">
108+
<div class="flex-list flex-space-fitted">
109+
<div class="flex-item">item 1 (no padding top)</div>
110+
<div class="flex-item">item 2 (no padding bottom)</div>
111+
</div>
112+
</div>
104113
</div>
105114
</div>
106115
{{template "base/footer" .}}

templates/package/shared/list.tmpl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
<button class="ui primary button">{{.locale.Tr "explore.search"}}</button>
1313
</div>
1414
</form>
15-
<div class="{{if .PackageDescriptors}}flex-list{{end}} gt-pt-4">
15+
<div>
1616
{{range .PackageDescriptors}}
17+
<div class="flex-list">
1718
<div class="flex-item">
1819
<div class="flex-item-main">
1920
<div class="flex-item-title">
@@ -34,6 +35,7 @@
3435
</div>
3536
</div>
3637
</div>
38+
</div>
3739
{{else}}
3840
{{if not .HasPackages}}
3941
<div class="empty center">
@@ -46,7 +48,7 @@
4648
<p>{{.locale.Tr "packages.empty.documentation" "https://docs.gitea.com/usage/packages/overview/" | Safe}}</p>
4749
</div>
4850
{{else}}
49-
<p>{{.locale.Tr "packages.filter.no_result"}}</p>
51+
<p class="gt-py-4">{{.locale.Tr "packages.filter.no_result"}}</p>
5052
{{end}}
5153
{{end}}
5254
{{template "base/paginate" .}}

templates/package/shared/versionlist.tmpl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@
1818
<button class="ui primary button">{{.locale.Tr "explore.search"}}</button>
1919
</div>
2020
</form>
21-
<div class="{{if .PackageDescriptors}}flex-list{{end}} gt-pt-4">
21+
<div>
2222
{{range .PackageDescriptors}}
23+
<div class="flex-list">
2324
<div class="flex-item">
2425
<div class="flex-item-main">
2526
<a class="flex-item-title" href="{{.FullWebLink}}">{{.Version.LowerVersion}}</a>
@@ -28,8 +29,9 @@
2829
</div>
2930
</div>
3031
</div>
32+
</div>
3133
{{else}}
32-
<p>{{.locale.Tr "packages.filter.no_result"}}</p>
34+
<p class="gt-py-4">{{.locale.Tr "packages.filter.no_result"}}</p>
3335
{{end}}
3436
{{template "base/paginate" .}}
3537
</div>

templates/repo/actions/runs_list.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="flex-list gt-m-0">
1+
<div class="flex-list">
22
{{if eq (len .Runs) 0}}
33
<div class="empty center">
44
{{svg "octicon-no-entry" 48}}

templates/repo/settings/deploy_keys.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</div>
1212
</h4>
1313
<div class="ui attached segment">
14-
<div class="{{if not .HasError}}gt-hidden{{end}} gt-mb-4" id="add-deploy-key-panel">
14+
<div class="{{if not .HasError}}gt-hidden{{end}}" id="add-deploy-key-panel">
1515
<form class="ui form" action="{{.Link}}" method="post">
1616
{{.CsrfTokenHtml}}
1717
<div class="field">

templates/shared/issuelist.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div id="issue-list" class="flex-list gt-pt-4">
1+
<div id="issue-list" class="flex-list">
22
{{$approvalCounts := .ApprovalCounts}}
33
{{range .Issues}}
44
<div class="flex-item flex-item-baseline">

templates/user/dashboard/feeds.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
<div class="flex-item-body">{{TimeSince .GetCreate $.locale}}</div>
117117
</div>
118118
<div class="flex-item-trailing">
119-
{{svg (printf "octicon-%s" (ActionIcon .GetOpType)) 32}}
119+
{{svg (printf "octicon-%s" (ActionIcon .GetOpType)) 32 "text grey gt-mr-2"}}
120120
</div>
121121
</div>
122122
{{end}}

templates/user/profile.tmpl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717
</div>
1818
{{end}}
1919
{{template "user/heatmap" .}}
20-
<div class="feeds">
21-
{{template "user/dashboard/feeds" .}}
22-
</div>
20+
{{template "user/dashboard/feeds" .}}
2321
{{else if eq .TabName "stars"}}
2422
<div class="stars">
2523
{{template "explore/repo_search" .}}

templates/user/settings/keys_gpg.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</div>
66
</h4>
77
<div class="ui attached segment">
8-
<div class="{{if not .HasGPGError}}gt-hidden{{end}} gt-mb-4" id="add-gpg-key-panel">
8+
<div class="{{if not .HasGPGError}}gt-hidden{{end}}" id="add-gpg-key-panel">
99
<form class="ui form{{if .HasGPGError}} error{{end}}" action="{{.Link}}" method="post">
1010
{{.CsrfTokenHtml}}
1111
<input type="hidden" name="title" value="none">

templates/user/settings/keys_ssh.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</div>
88
</h4>
99
<div class="ui attached segment">
10-
<div class="{{if not .HasSSHError}}gt-hidden{{end}} gt-mb-4" id="add-ssh-key-panel">
10+
<div class="{{if not .HasSSHError}}gt-hidden{{end}}" id="add-ssh-key-panel">
1111
<form class="ui form" action="{{.Link}}" method="post">
1212
{{.CsrfTokenHtml}}
1313
<div class="field {{if .Err_Title}}error{{end}}">

web_src/css/dashboard.css

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,3 @@
9595
position: static;
9696
}
9797
}
98-
99-
.feeds code {
100-
padding: 2px 4px;
101-
border-radius: var(--border-radius);
102-
background-color: var(--color-markup-code-block);
103-
word-break: break-all;
104-
}

web_src/css/shared/flex-list.css

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,23 @@
9191
border-top: 1px solid var(--color-secondary);
9292
}
9393

94-
/* Fomantic UI segment has default "padding: 1em", so here it removes the padding-top and padding-bottom accordingly */
94+
/* Fomantic UI segment has default "padding: 1em", so here it removes the padding-top and padding-bottom accordingly.
95+
Developers could also use "flex-space-fitted" class to remove the first item's padding-top and the last item's padding-bottom */
96+
.flex-list.flex-space-fitted > .flex-item:first-child,
9597
.ui.segment > .flex-list:first-child > .flex-item:first-child {
9698
padding-top: 0;
9799
}
98100

101+
.flex-list.flex-space-fitted > .flex-item:last-child,
99102
.ui.segment > .flex-list:last-child > .flex-item:last-child {
100103
padding-bottom: 0;
101104
}
105+
106+
/* If there is a divider besides the flex-list, some padding/margin are not needs */
107+
.divider + .flex-list > .flex-item:first-child {
108+
padding-top: 0;
109+
}
110+
111+
.flex-list + .divider {
112+
margin-top: 0;
113+
}

0 commit comments

Comments
 (0)