summaryrefslogtreecommitdiffstats
path: root/templates/admin
diff options
context:
space:
mode:
authorEarl Warren <earl-warren@noreply.codeberg.org>2024-03-24 06:33:13 +0100
committerEarl Warren <earl-warren@noreply.codeberg.org>2024-03-24 06:33:13 +0100
commit33ede091354e3d10c15d28bebe64df8a6f2cdb44 (patch)
treea3c3eb4efe14cdbddf25b622ff4f17f742a76030 /templates/admin
parentMerge pull request '[port] gitea#29833: Refactor markdown attention render' (... (diff)
parentsimplify template (diff)
downloadforgejo-33ede091354e3d10c15d28bebe64df8a6f2cdb44.tar.xz
forgejo-33ede091354e3d10c15d28bebe64df8a6f2cdb44.zip
Merge pull request '[PORT] Unify search boxes (gitea#29530)' (#2688) from snematoda/port-29530 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2688 Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Diffstat (limited to 'templates/admin')
-rw-r--r--templates/admin/base/search.tmpl23
-rw-r--r--templates/admin/emails/list.tmpl5
-rw-r--r--templates/admin/org/list.tmpl21
-rw-r--r--templates/admin/packages/list.tmpl8
-rw-r--r--templates/admin/repo/unadopted.tmpl8
-rw-r--r--templates/admin/user/list.tmpl6
6 files changed, 30 insertions, 41 deletions
diff --git a/templates/admin/base/search.tmpl b/templates/admin/base/search.tmpl
deleted file mode 100644
index 0fecb61d9e..0000000000
--- a/templates/admin/base/search.tmpl
+++ /dev/null
@@ -1,23 +0,0 @@
-<div class="ui secondary filter menu gt-ac gt-mx-0">
- <form class="ui form ignore-dirty gt-f1">
- <div class="ui fluid action input">
- {{template "shared/searchinput" dict "Value" .Keyword}}
- <button class="ui primary button">{{ctx.Locale.Tr "explore.search"}}</button>
- </div>
- </form>
- <!-- Sort -->
- <div class="ui dropdown type jump item gt-mr-0">
- <span class="text">
- {{ctx.Locale.Tr "repo.issues.filter_sort"}}
- </span>
- {{svg "octicon-triangle-down" 14 "dropdown icon"}}
- <div class="menu">
- <a class="{{if or (eq .SortType "oldest") (not .SortType)}}active {{end}}item" href="{{$.Link}}?sort=oldest&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.oldest"}}</a>
- <a class="{{if eq .SortType "newest"}}active {{end}}item" href="{{$.Link}}?sort=newest&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.latest"}}</a>
- <a class="{{if eq .SortType "alphabetically"}}active {{end}}item" href="{{$.Link}}?sort=alphabetically&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.alphabetically"}}</a>
- <a class="{{if eq .SortType "reversealphabetically"}}active {{end}}item" href="{{$.Link}}?sort=reversealphabetically&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</a>
- <a class="{{if eq .SortType "recentupdate"}}active {{end}}item" href="{{$.Link}}?sort=recentupdate&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.recentupdate"}}</a>
- <a class="{{if eq .SortType "leastupdate"}}active {{end}}item" href="{{$.Link}}?sort=leastupdate&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.leastupdate"}}</a>
- </div>
- </div>
-</div>
diff --git a/templates/admin/emails/list.tmpl b/templates/admin/emails/list.tmpl
index 29fbb5f039..1e552fba88 100644
--- a/templates/admin/emails/list.tmpl
+++ b/templates/admin/emails/list.tmpl
@@ -6,10 +6,7 @@
<div class="ui attached segment">
<div class="ui secondary filter menu gt-ac gt-mx-0">
<form class="ui form ignore-dirty gt-f1">
- <div class="ui fluid action input">
- {{template "shared/searchinput" dict "Value" .Keyword}}
- <button class="ui primary button">{{ctx.Locale.Tr "explore.search"}}</button>
- </div>
+ {{template "shared/search/combo" dict "Value" .Keyword}}
</form>
<!-- Sort -->
<div class="ui dropdown type jump item gt-mr-0">
diff --git a/templates/admin/org/list.tmpl b/templates/admin/org/list.tmpl
index 0d79456b47..efb0a8847e 100644
--- a/templates/admin/org/list.tmpl
+++ b/templates/admin/org/list.tmpl
@@ -7,7 +7,26 @@
</div>
</h4>
<div class="ui attached segment">
- {{template "admin/base/search" .}}
+ <div class="ui secondary filter menu gt-ac gt-mx-0">
+ <form class="ui form ignore-dirty gt-f1">
+ {{template "shared/search/combo" dict "Value" .Keyword "Placeholder" (ctx.Locale.Tr "search.org_kind")}}
+ </form>
+ <!-- Sort -->
+ <div class="ui dropdown type jump item gt-mr-0">
+ <span class="text">
+ {{ctx.Locale.Tr "repo.issues.filter_sort"}}
+ </span>
+ {{svg "octicon-triangle-down" 14 "dropdown icon"}}
+ <div class="menu">
+ <a class="{{if or (eq .SortType "oldest") (not .SortType)}}active {{end}}item" href="{{$.Link}}?sort=oldest&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.oldest"}}</a>
+ <a class="{{if eq .SortType "newest"}}active {{end}}item" href="{{$.Link}}?sort=newest&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.latest"}}</a>
+ <a class="{{if eq .SortType "alphabetically"}}active {{end}}item" href="{{$.Link}}?sort=alphabetically&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.alphabetically"}}</a>
+ <a class="{{if eq .SortType "reversealphabetically"}}active {{end}}item" href="{{$.Link}}?sort=reversealphabetically&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</a>
+ <a class="{{if eq .SortType "recentupdate"}}active {{end}}item" href="{{$.Link}}?sort=recentupdate&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.recentupdate"}}</a>
+ <a class="{{if eq .SortType "leastupdate"}}active {{end}}item" href="{{$.Link}}?sort=leastupdate&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.leastupdate"}}</a>
+ </div>
+ </div>
+ </div>
</div>
<div class="ui attached table segment">
<table class="ui very basic striped table unstackable">
diff --git a/templates/admin/packages/list.tmpl b/templates/admin/packages/list.tmpl
index aef4815424..863f11da25 100644
--- a/templates/admin/packages/list.tmpl
+++ b/templates/admin/packages/list.tmpl
@@ -13,16 +13,16 @@
</h4>
<div class="ui attached segment">
<form class="ui form ignore-dirty">
- <div class="ui fluid action input">
- {{template "shared/searchinput" dict "Value" .Query}}
- <select class="ui dropdown" name="type">
+ <div class="ui small fluid action input">
+ {{template "shared/search/input" dict "Value" .Query}}
+ <select class="ui small dropdown" name="type">
<option value="">{{ctx.Locale.Tr "packages.filter.type"}}</option>
<option value="all">{{ctx.Locale.Tr "packages.filter.type.all"}}</option>
{{range $type := .AvailableTypes}}
<option{{if eq $.PackageType $type}} selected="selected"{{end}} value="{{$type}}">{{$type.Name}}</option>
{{end}}
</select>
- <button class="ui primary button">{{ctx.Locale.Tr "explore.search"}}</button>
+ {{template "shared/search/button"}}
</div>
</form>
</div>
diff --git a/templates/admin/repo/unadopted.tmpl b/templates/admin/repo/unadopted.tmpl
index fb4f16791d..c65cfd9db4 100644
--- a/templates/admin/repo/unadopted.tmpl
+++ b/templates/admin/repo/unadopted.tmpl
@@ -8,10 +8,10 @@
</h4>
<div class="ui attached segment">
<form class="ui form ignore-dirty">
- <div class="ui fluid action input">
- <input name="search" value="true" type="hidden">
- <input name="q" value="{{.Keyword}}" placeholder="{{ctx.Locale.Tr "repo.adopt_search"}}" autofocus>
- <button class="ui primary button">{{ctx.Locale.Tr "explore.search"}}</button>
+ <div class="ui small fluid action input">
+ <input name="search" value="true" type="hidden">
+ <input name="q" value="{{.Keyword}}" placeholder="{{ctx.Locale.Tr "repo.adopt_search"}}" autofocus>
+ {{template "shared/search/button"}}
</div>
</form>
</div>
diff --git a/templates/admin/user/list.tmpl b/templates/admin/user/list.tmpl
index e9ce17ac90..11c2fa5940 100644
--- a/templates/admin/user/list.tmpl
+++ b/templates/admin/user/list.tmpl
@@ -52,11 +52,7 @@
</div>
</div>
- <!-- Search Text -->
- <div class="ui fluid action input">
- {{template "shared/searchinput" dict "Value" .Keyword}}
- <button class="ui primary button">{{ctx.Locale.Tr "explore.search"}}</button>
- </div>
+ {{template "shared/search/combo" dict "Value" .Keyword "Placeholder" (ctx.Locale.Tr "search.user_kind")}}
</form>
</div>
<div class="ui attached table segment">