Skip to content

Commit f13e4ba

Browse files
committed
fix
1 parent 85c59d6 commit f13e4ba

File tree

6 files changed

+34
-25
lines changed

6 files changed

+34
-25
lines changed

templates/admin/user/list.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<div class="ui dropdown type jump item">
1616
<span class="text">{{ctx.Locale.Tr "admin.users.list_status_filter.menu_text"}}</span>
1717
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
18-
<div class="menu">
18+
<div class="menu flex-items-block">
1919
<a class="item j-reset-status-filter">{{ctx.Locale.Tr "admin.users.list_status_filter.reset"}}</a>
2020
<div class="divider"></div>
2121
<label class="item"><input type="radio" name="status_filter[is_admin]" value="1"> {{ctx.Locale.Tr "admin.users.list_status_filter.is_admin"}}</label>

templates/devtest/gitea-ui.tmpl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,12 @@
178178
<h2>Dropdown with SVG</h2>
179179
<div>
180180
<div class="ui dropdown" style="border: 1px red dashed" data-tooltip-content="border for demo purpose only">
181-
<span class="text">simple</span>
181+
<span class="text">search-input & flex-item in menu</span>
182182
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
183-
<div class="menu">
183+
<div class="menu flex-items-block">
184184
<div class="ui icon search input"><i class="icon">{{svg "octicon-search"}}</i><input type="text" value="search input in menu"></div>
185-
<div class="item">item</div>
185+
<div class="item"><input type="radio">item</div>
186+
<div class="item"><input type="radio">item</div>
186187
</div>
187188
</div>
188189
<div class="ui search selection dropdown">

templates/shared/repo_search.tmpl

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11
<div class="ui secondary filter menu">
2-
<form id="repo-search-form" class="ui form ignore-dirty tw-flex-1 tw-flex tw-flex-row tw-gap-x-2">
2+
<form id="repo-search-form" class="ui form ignore-dirty tw-flex-1 tw-flex tw-gap-x-2">
33
{{if .Language}}<input hidden name="language" value="{{.Language}}">{{end}}
4+
{{if .PageIsExploreRepositories}}<input type="hidden" name="only_show_relevant" value="{{.OnlyShowRelevant}}">{{end}}
5+
{{if .TabName}}<input type="hidden" name="tab" value="{{.TabName}}">{{end}}
6+
{{if .TopicOnly}}<input hidden name="topic" value="{{.TopicOnly}}">{{end}}
47
<div class="ui fluid action input tw-flex-1">
58
{{template "shared/searchinput" dict "Value" .Keyword}}
6-
{{if .PageIsExploreRepositories}}
7-
<input type="hidden" name="only_show_relevant" value="{{.OnlyShowRelevant}}">
8-
{{else if .TabName}}
9-
<input type="hidden" name="tab" value="{{.TabName}}">
10-
{{end}}
119
<button class="ui primary button">{{ctx.Locale.Tr "explore.search"}}</button>
1210
</div>
1311
<!-- Filter -->
14-
<div class="ui dropdown type jump item tw-mr-0">
15-
<span class="text">
16-
{{ctx.Locale.Tr "filter"}}
17-
</span>
12+
<div class="item ui dropdown jump">
13+
<span class="text">{{ctx.Locale.Tr "filter"}}</span>
1814
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
19-
<div class="menu">
15+
<div class="menu flex-items-block">
2016
<label class="item"><input type="radio" name="clear-filter"> {{ctx.Locale.Tr "filter.clear"}}</label>
2117
<div class="divider"></div>
2218
<label class="item"><input type="radio" name="archived" {{if .IsArchived.Value}}checked{{end}} value="1"> {{ctx.Locale.Tr "filter.is_archived"}}</label>
@@ -36,10 +32,8 @@
3632
</div>
3733
</div>
3834
<!-- Sort -->
39-
<div class="ui dropdown type jump item gt-mr-0">
40-
<span class="text">
41-
{{ctx.Locale.Tr "repo.issues.filter_sort"}}
42-
</span>
35+
<div class="item ui dropdown jump">
36+
<span class="text">{{ctx.Locale.Tr "repo.issues.filter_sort"}}</span>
4337
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
4438
<div class="menu">
4539
<label class="{{if eq .SortType "newest"}}active {{end}}item"><input hidden type="radio" name="sort" {{if eq .SortType "newest"}}checked{{end}} value="newest"> {{ctx.Locale.Tr "repo.issues.filter_sort.latest"}}</label>
@@ -61,7 +55,9 @@
6155
</form>
6256
</div>
6357
{{if and .PageIsExploreRepositories .OnlyShowRelevant}}
64-
<div class="ui message explore-relevancy-note">
65-
<span data-tooltip-content="{{ctx.Locale.Tr "explore.relevant_repositories_tooltip"}}">{{ctx.Locale.Tr "explore.relevant_repositories" (printf "?only_show_relevant=0&sort=%s&q=%s&language=%s" $.SortType (QueryEscape $.Keyword) (QueryEscape $.Language))}}</span>
58+
<div class="ui message">
59+
<span data-tooltip-content="{{ctx.Locale.Tr "explore.relevant_repositories_tooltip"}}">
60+
{{ctx.Locale.Tr "explore.relevant_repositories" (printf "?only_show_relevant=0&sort=%s&q=%s&language=%s" $.SortType (QueryEscape $.Keyword) (QueryEscape $.Language))}}
61+
</span>
6662
</div>
6763
{{end}}

templates/shared/searchinput.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<input type="search" spellcheck="false" name="q" maxlength="255" placeholder="{{ctx.Locale.Tr "explore.search"}}…"{{if .Value}} value="{{.Value}}"{{end}}{{if .Disabled}} disabled{{end}}>
1+
<input type="search" name="q"{{if .Value}} value="{{.Value}}"{{end}}{{if .Disabled}} disabled{{end}} spellcheck="false" maxlength="255" placeholder="{{ctx.Locale.Tr "explore.search"}}…">

tests/integration/explore_repos_test.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,18 @@ import (
88
"testing"
99

1010
"code.gitea.io/gitea/tests"
11+
12+
"github.com/stretchr/testify/assert"
1113
)
1214

1315
func TestExploreRepos(t *testing.T) {
1416
defer tests.PrepareTestEnv(t)()
1517

16-
req := NewRequest(t, "GET", "/explore/repos")
17-
MakeRequest(t, req, http.StatusOK)
18+
req := NewRequest(t, "GET", "/explore/repos?q=TheKeyword&topic=1&language=TheLang")
19+
resp := MakeRequest(t, req, http.StatusOK)
20+
respStr := resp.Body.String()
21+
22+
assert.Contains(t, respStr, `<input hidden name="topic" value="true">`)
23+
assert.Contains(t, respStr, `<input hidden name="language" value="TheLang">`)
24+
assert.Contains(t, respStr, `<input type="search" name="q" value="TheKeyword"`)
1825
}

web_src/css/base.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2053,7 +2053,6 @@ table th[data-sortt-desc] .svg {
20532053
.ui.ui.button,
20542054
.ui.ui.dropdown,
20552055
.ui.ui.label,
2056-
.flex-items-inline > .item,
20572056
.flex-text-inline {
20582057
display: inline-flex;
20592058
align-items: center;
@@ -2090,3 +2089,9 @@ table th[data-sortt-desc] .svg {
20902089
align-items: center;
20912090
gap: .25rem;
20922091
}
2092+
2093+
.ui.dropdown .menu.flex-items-block > .item {
2094+
display: flex !important;
2095+
align-items: center;
2096+
gap: .5rem;
2097+
}

0 commit comments

Comments
 (0)