Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow both fullname and username search when DEFAULT_SHOW_FULL_NAME is true #23463

Merged
merged 32 commits into from
Mar 16, 2023
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
d9bf9c6
support fullname search
HesterG Mar 10, 2023
79af17f
Merge branch 'go-gitea:main' into fullname-search
HesterG Mar 13, 2023
d7432ce
Merge branch 'go-gitea:main' into fullname-search
HesterG Mar 13, 2023
1a333ac
Merge branch 'go-gitea:main' into fullname-search
HesterG Mar 13, 2023
8a8b4bb
pass ui setting to template
HesterG Mar 13, 2023
15faa66
pass bool
HesterG Mar 13, 2023
7b4f594
update
HesterG Mar 13, 2023
888cd09
remove unnecessary change
HesterG Mar 13, 2023
e99af66
Merge branch 'go-gitea:main' into fullname-search
HesterG Mar 14, 2023
8edc4de
fullname support added to search user related
HesterG Mar 14, 2023
d43597f
add ctx
HesterG Mar 14, 2023
ae41379
Merge branch 'go-gitea:main' into fullname-search
HesterG Mar 14, 2023
61fcdd6
use config to decide if show fullname in search
HesterG Mar 14, 2023
27f57a3
rename isShowFullName to IsShowFullName
HesterG Mar 14, 2023
1e30e66
rename
HesterG Mar 14, 2023
c110521
move inline css to less
HesterG Mar 14, 2023
d581a20
use GetSearchNameHTML instead of passing contexts
HesterG Mar 14, 2023
aded8c1
show fullname only it is not empty
HesterG Mar 14, 2023
b758321
Merge branch 'main' into fullname-search
HesterG Mar 14, 2023
3f8e447
escape strings
HesterG Mar 14, 2023
6ae1968
fix conflict
HesterG Mar 15, 2023
405ac99
Merge branch 'main' into fullname-search
HesterG Mar 15, 2023
c500ce8
add css
HesterG Mar 15, 2023
be58413
new line
HesterG Mar 15, 2023
084a2ac
use template instead of server generate
HesterG Mar 15, 2023
ab4f1e1
new line
HesterG Mar 15, 2023
7e03788
define DefaultShowFullName inhelper.go
HesterG Mar 15, 2023
b34193f
change params passed to template
HesterG Mar 15, 2023
34db52a
Merge branch 'main' into fullname-search
HesterG Mar 15, 2023
0298f42
Merge branch 'main' into fullname-search
HesterG Mar 16, 2023
74b7cdf
Merge branch 'main' into fullname-search
lunny Mar 16, 2023
f3cc545
Merge branch 'main' into fullname-search
jolheiser Mar 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions modules/templates/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ func NewFuncMap() []template.FuncMap {
"CustomEmojis": func() map[string]string {
return setting.UI.CustomEmojisMap
},
"IsShowFullName": func() bool {
return setting.UI.DefaultShowFullName
},
lunny marked this conversation as resolved.
Show resolved Hide resolved
"Safe": Safe,
"SafeJS": SafeJS,
"JSEscape": JSEscape,
Expand Down
4 changes: 2 additions & 2 deletions templates/repo/issue/list.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}">{{.locale.Tr "repo.issues.filter_poster_no_select"}}</a>
{{range .Posters}}
<a class="{{if eq $.PosterID .ID}}active selected{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{.ID}}">
{{avatar $.Context .}} {{.GetDisplayName}}
{{avatar $.Context .}}{{template "repo/search_name" .}}
</a>
{{end}}
</div>
Expand All @@ -154,7 +154,7 @@
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_assginee_no_select"}}</a>
{{range .Assignees}}
<a class="{{if eq $.AssigneeID .ID}}active selected{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{.ID}}&poster={{$.PosterID}}">
{{avatar $.Context .}} {{.GetDisplayName}}
{{avatar $.Context .}}{{template "repo/search_name" .}}
</a>
{{end}}
</div>
Expand Down
9 changes: 6 additions & 3 deletions templates/repo/issue/milestone_issues.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,14 @@
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
</span>
<div class="menu">
<div class="ui icon search input">
<i class="icon gt-df gt-ac gt-jc">{{svg "octicon-search" 16}}</i>
<input type="text" placeholder="{{.locale.Tr "repo.issues.filter_poster"}}">
</div>
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&assignee={{$.AssigneeID}}">{{.locale.Tr "repo.issues.filter_poster_no_select"}}</a>
{{range .Posters}}
<a class="{{if eq $.PosterID .ID}}active selected{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&assignee={{$.AssigneeID}}&poster={{.ID}}">
{{avatar $.Context .}} {{.GetDisplayName}}
{{avatar $.Context .}}{{template "repo/search_name" .}}
</a>
{{end}}
</div>
Expand All @@ -93,8 +97,7 @@
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_assginee_no_select"}}</a>
{{range .Assignees}}
<a class="{{if eq $.AssigneeID .ID}}active selected{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&assignee={{.ID}}&poster={{$.PosterID}}">
{{avatar $.Context . 28 "gt-mr-2"}}
{{.GetDisplayName}}
{{avatar $.Context . 28 "gt-mr-2"}}{{template "repo/search_name" .}}
</a>
{{end}}
</div>
Expand Down
2 changes: 1 addition & 1 deletion templates/repo/issue/new_form.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
<a class="item muted" href="#" data-id="{{.ID}}" data-id-selector="#assignee_{{.ID}}">
<span class="octicon-check invisible">{{svg "octicon-check"}}</span>
<span class="text">
{{avatar $.Context . 28 "gt-mr-3"}}{{.GetDisplayName}}
{{avatar $.Context . 28 "gt-mr-3"}}{{template "repo/search_name" .}}
</span>
</a>
{{end}}
Expand Down
6 changes: 2 additions & 4 deletions templates/repo/issue/view_content/sidebar.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
<a class="{{if not .CanChange}}ui tooltip{{end}} item {{if .Checked}} checked {{end}} {{if not .CanChange}}ban-change{{end}}" href="#" data-id="{{.ItemID}}" data-id-selector="#review_request_{{.ItemID}}" {{if not .CanChange}} data-content="{{$.locale.Tr "repo.issues.remove_request_review_block"}}"{{end}}>
<span class="octicon-check {{if not .Checked}}invisible{{end}}">{{svg "octicon-check"}}</span>
<span class="text">
{{avatar $.Context .User 28 "gt-mr-3"}}
{{.User.GetDisplayName}}
{{avatar $.Context .User 28 "gt-mr-3"}}{{template "repo/search_name" .User}}
</span>
</a>
{{end}}
Expand Down Expand Up @@ -258,8 +257,7 @@
{{end}}
<span class="octicon-check {{if not $checked}}invisible{{end}}">{{svg "octicon-check"}}</span>
<span class="text">
{{avatar $.Context . 28 "gt-mr-3"}}
{{.GetDisplayName}}
{{avatar $.Context . 28 "gt-mr-3"}}{{template "repo/search_name" .}}
</span>
</a>
{{end}}
Expand Down
1 change: 1 addition & 0 deletions templates/repo/search_name.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{.Name}}{{if IsShowFullName}}<span class="search-fullname"> {{.FullName}}</span>{{end}}
9 changes: 3 additions & 6 deletions templates/repo/settings/protected_branch.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@
<div class="menu">
{{range .Users}}
<div class="item" data-value="{{.ID}}">
{{avatar $.Context . 28 "mini"}}
{{.GetDisplayName}}
{{avatar $.Context . 28 "mini"}}{{template "repo/search_name" .}}
</div>
{{end}}
</div>
Expand Down Expand Up @@ -101,8 +100,7 @@
<div class="menu">
{{range .Users}}
<div class="item" data-value="{{.ID}}">
{{avatar $.Context . 28 "mini"}}
{{.GetDisplayName}}
{{avatar $.Context . 28 "mini"}}{{template "repo/search_name" .}}
</div>
{{end}}
</div>
Expand Down Expand Up @@ -181,8 +179,7 @@
<div class="menu">
{{range .Users}}
<div class="item" data-value="{{.ID}}">
{{avatar $.Context . 28 "mini"}}
{{.GetDisplayName}}
{{avatar $.Context . 28 "mini"}}{{template "repo/search_name" .}}
</div>
{{end}}
</div>
Expand Down
3 changes: 1 addition & 2 deletions templates/repo/settings/tags.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@
<div class="menu">
{{range .Users}}
<div class="item" data-value="{{.ID}}">
{{avatar $.Context . 28 "mini"}}
{{.GetDisplayName}}
{{avatar $.Context . 28 "mini"}}{{template "repo/search_name" .}}
</div>
{{end}}
</div>
Expand Down
4 changes: 4 additions & 0 deletions web_src/css/repository.css
Original file line number Diff line number Diff line change
Expand Up @@ -3627,3 +3627,7 @@ td.blob-excerpt {
.pr-status .status-details > span {
padding-right: 0.5em; /* To match the alignment with the "required" label */
}

.search-fullname {
color: var(--color-text-light-2);
}