Skip to content

Commit c082689

Browse files
authored
Use flex instead of float for sort button and search input (#25519)
Right now some sort buttons beside search input are unclickable because #25338 removed `max-width` and the sort button is using float, sort button is then covered by the `input`. The way to fix this in this PR is changing the layout to `flex` and put `input form` and sort `button` into `secondary menu`. After: <img width="1411" alt="Screen Shot 2023-06-26 at 16 40 52" src="https://github.com/go-gitea/gitea/assets/17645053/63c12b17-793a-4ae7-bbda-f67b13b87212"> <img width="1428" alt="Screen Shot 2023-06-26 at 16 34 06" src="https://github.com/go-gitea/gitea/assets/17645053/cb7d967e-355d-4cb0-955c-6139580fc17a"> <img width="716" alt="Screen Shot 2023-06-26 at 16 34 22" src="https://github.com/go-gitea/gitea/assets/17645053/c74b5ef2-d46e-4487-8794-28bec984bb36"> <img width="1424" alt="Screen Shot 2023-06-26 at 16 34 32" src="https://github.com/go-gitea/gitea/assets/17645053/8a5fdc05-a2c5-4ec4-979d-15a21501fe14"> <img width="1425" alt="Screen Shot 2023-06-26 at 16 35 21" src="https://github.com/go-gitea/gitea/assets/17645053/eb73cd31-3914-4bc9-92ab-aba56f25128b"> <img width="1437" alt="Screen Shot 2023-06-26 at 16 36 14" src="https://github.com/go-gitea/gitea/assets/17645053/1c3b4595-bb26-491f-aa68-60dc9ab22b84">
1 parent 65d3e11 commit c082689

File tree

6 files changed

+51
-51
lines changed

6 files changed

+51
-51
lines changed

templates/admin/base/search.tmpl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
<div class="ui right floated secondary filter menu">
2-
<!-- Sort -->
3-
<div class="ui dropdown type jump item">
1+
<div class="ui secondary filter menu gt-ac gt-mx-0">
2+
<form class="ui form ignore-dirty gt-f1">
3+
<div class="ui fluid action input">
4+
{{template "shared/searchinput" dict "locale" .locale "Value" .Keyword "AutoFocus" true}}
5+
<button class="ui primary button">{{.locale.Tr "explore.search"}}</button>
6+
</div>
7+
</form>
8+
<!-- Sort -->
9+
<div class="ui dropdown type jump item gt-mr-0">
410
<span class="text">
511
{{.locale.Tr "repo.issues.filter_sort"}}
612
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
@@ -15,9 +21,3 @@
1521
</div>
1622
</div>
1723
</div>
18-
<form class="ui form ignore-dirty">
19-
<div class="ui fluid action input">
20-
{{template "shared/searchinput" dict "locale" .locale "Value" .Keyword "AutoFocus" true}}
21-
<button class="ui primary button">{{.locale.Tr "explore.search"}}</button>
22-
</div>
23-
</form>

templates/admin/emails/list.tmpl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@
44
{{.locale.Tr "admin.emails.email_manage_panel"}} ({{.locale.Tr "admin.total" .Total}})
55
</h4>
66
<div class="ui attached segment">
7-
<div class="ui right floated secondary filter menu">
8-
<!-- Sort -->
9-
<div class="ui dropdown type jump item">
7+
<div class="ui secondary filter menu gt-ac gt-mx-0">
8+
<form class="ui form ignore-dirty gt-f1">
9+
<div class="ui fluid action input">
10+
{{template "shared/searchinput" dict "locale" .locale "Value" .Keyword "AutoFocus" true}}
11+
<button class="ui primary button">{{.locale.Tr "explore.search"}}</button>
12+
</div>
13+
</form>
14+
<!-- Sort -->
15+
<div class="ui dropdown type jump item gt-mr-0">
1016
<span class="text">
1117
{{.locale.Tr "repo.issues.filter_sort"}}
1218
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
@@ -19,12 +25,6 @@
1925
</div>
2026
</div>
2127
</div>
22-
<form class="ui form ignore-dirty">
23-
<div class="ui fluid action input">
24-
{{template "shared/searchinput" dict "locale" .locale "Value" .Keyword "AutoFocus" true}}
25-
<button class="ui primary button">{{.locale.Tr "explore.search"}}</button>
26-
</div>
27-
</form>
2828
</div>
2929
<div class="ui attached table segment">
3030
<table class="ui very basic striped table unstackable">

templates/admin/repo/search.tmpl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
<div class="ui right floated secondary filter menu">
1+
<div class="ui secondary filter menu gt-ac gt-mx-0">
2+
<form class="ui form ignore-dirty gt-f1">
3+
<div class="ui fluid action input">
4+
{{template "shared/searchinput" dict "locale" .locale "Value" .Keyword "AutoFocus" true}}
5+
<button class="ui primary button">{{.locale.Tr "explore.search"}}</button>
6+
</div>
7+
</form>
28
<!-- Sort -->
3-
<div class="ui dropdown type jump item">
9+
<div class="ui dropdown type jump item gt-mr-0">
410
<span class="text">
511
{{.locale.Tr "repo.issues.filter_sort"}}
612
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
@@ -21,9 +27,3 @@
2127
</div>
2228
</div>
2329
</div>
24-
<form class="ui form ignore-dirty">
25-
<div class="ui fluid action input">
26-
{{template "shared/searchinput" dict "locale" .locale "Value" .Keyword "AutoFocus" true}}
27-
<button class="ui primary button">{{.locale.Tr "explore.search"}}</button>
28-
</div>
29-
</form>

templates/code/searchform.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<form class="ui form ignore-dirty" style="max-width: 100%">
1+
<form class="ui form ignore-dirty">
22
<div class="ui fluid action input">
33
{{template "shared/searchinput" dict "locale" .locale "Value" .Keyword "AutoFocus" true "Disabled" .CodeIndexerUnavailable}}
44
<div class="ui dropdown selection {{if .CodeIndexerUnavailable}} disabled{{end}}" data-tooltip-content="{{.locale.Tr "explore.search.type.tooltip"}}">

templates/explore/repo_search.tmpl

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
1-
<div class="ui right floated secondary filter menu">
1+
<div class="ui secondary filter menu gt-ac gt-mx-0">
2+
<form class="ui form ignore-dirty gt-f1">
3+
<input type="hidden" name="sort" value="{{$.SortType}}">
4+
<input type="hidden" name="language" value="{{$.Language}}">
5+
<div class="ui fluid action input">
6+
{{template "shared/searchinput" dict "locale" .locale "Value" .Keyword "AutoFocus" true}}
7+
{{if .PageIsExploreRepositories}}
8+
<input type="hidden" name="only_show_relevant" value="{{.OnlyShowRelevant}}">
9+
{{else}}
10+
<input type="hidden" name="tab" value="repositories">
11+
{{end}}
12+
<button class="ui primary button">{{.locale.Tr "explore.search"}}</button>
13+
</div>
14+
</form>
215
<!-- Sort -->
3-
<div class="ui right dropdown type jump item">
16+
<div class="ui dropdown type jump item gt-mr-0">
417
<span class="text">
518
{{.locale.Tr "repo.issues.filter_sort"}}
619
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
@@ -21,19 +34,6 @@
2134
</div>
2235
</div>
2336
</div>
24-
<form class="ui form ignore-dirty">
25-
<input type="hidden" name="sort" value="{{$.SortType}}">
26-
<input type="hidden" name="language" value="{{$.Language}}">
27-
<div class="ui fluid action input">
28-
{{template "shared/searchinput" dict "locale" .locale "Value" .Keyword "AutoFocus" true}}
29-
{{if .PageIsExploreRepositories}}
30-
<input type="hidden" name="only_show_relevant" value="{{.OnlyShowRelevant}}">
31-
{{else}}
32-
<input type="hidden" name="tab" value="repositories">
33-
{{end}}
34-
<button class="ui primary button">{{.locale.Tr "explore.search"}}</button>
35-
</div>
36-
</form>
3737
{{if and .PageIsExploreRepositories .OnlyShowRelevant}}
3838
<div class="ui message explore-relevancy-note">
3939
<span data-tooltip-content="{{.locale.Tr "explore.relevant_repositories_tooltip"}}">{{.locale.Tr "explore.relevant_repositories" ((printf "%s%s" $.Link "?only_show_relevant=0")|Escape) | Safe}}</span>

templates/explore/search.tmpl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
<div class="ui right floated secondary filter menu">
2-
<!-- Sort -->
3-
<div class="ui right dropdown type jump item">
1+
<div class="ui secondary filter menu gt-ac gt-mx-0">
2+
<form class="ui form ignore-dirty gt-f1">
3+
<div class="ui fluid action input">
4+
{{template "shared/searchinput" dict "locale" .locale "Value" .Keyword "AutoFocus" true}}
5+
<button class="ui primary button">{{.locale.Tr "explore.search"}}</button>
6+
</div>
7+
</form>
8+
<!-- Sort -->
9+
<div class="ui dropdown type jump item gt-mr-0">
410
<span class="text">
511
{{.locale.Tr "repo.issues.filter_sort"}}
612
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
@@ -15,10 +21,4 @@
1521
</div>
1622
</div>
1723
</div>
18-
<form class="ui form ignore-dirty">
19-
<div class="ui fluid action input">
20-
{{template "shared/searchinput" dict "locale" .locale "Value" .Keyword "AutoFocus" true}}
21-
<button class="ui primary button">{{.locale.Tr "explore.search"}}</button>
22-
</div>
23-
</form>
2424
<div class="ui divider"></div>

0 commit comments

Comments
 (0)