Skip to content

Commit cad517a

Browse files
committed
fix
1 parent 87ed3ba commit cad517a

File tree

9 files changed

+38
-14
lines changed

9 files changed

+38
-14
lines changed

templates/devtest/flex-list.tmpl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<div class="page-content devtest">
44
<div class="ui container">
55
<h1>Flex List (standalone)</h1>
6-
<div class="ui divider"></div>
6+
<div class="divider"></div>
77
<div class="flex-list">
88
<div class="flex-item">
99
<div class="flex-item-leading">
@@ -102,6 +102,14 @@
102102
<div class="flex-item">item 2</div>
103103
</div>
104104
</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>
105113
</div>
106114
</div>
107115
{{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/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/shared/flex-list.css

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

94-
/* remove padding on first and last child so it better fits into .ui.segment or
95-
when preceded or followed by a .ui.divider */
96-
.flex-list > .flex-item:first-child {
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,
97+
.ui.segment > .flex-list:first-child > .flex-item:first-child {
9798
padding-top: 0;
9899
}
99-
.flex-list > .flex-item:last-child {
100+
101+
.flex-list.flex-space-fitted > .flex-item:last-child,
102+
.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)