summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorGusted <gusted@noreply.codeberg.org>2024-11-02 23:33:30 +0100
committerGusted <gusted@noreply.codeberg.org>2024-11-02 23:33:30 +0100
commitd5426b0626f415875ac184d8c1a72a5b2cf113c1 (patch)
tree9a78ebff5d840f92d6dcb5b0e9d7d0dad5a3280e /templates
parentMerge pull request 'Update module github.com/yuin/goldmark to v1.7.8 (forgejo... (diff)
parentfeat: Add Search to Releases Page (diff)
downloadforgejo-d5426b0626f415875ac184d8c1a72a5b2cf113c1.tar.xz
forgejo-d5426b0626f415875ac184d8c1a72a5b2cf113c1.zip
Merge pull request 'feat: Add Search to Releases Page' (#5777) from JakobDev/forgejo:releasesearch into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5777 Reviewed-by: Gusted <gusted@noreply.codeberg.org> Reviewed-by: Shiny Nematoda <snematoda@noreply.codeberg.org>
Diffstat (limited to 'templates')
-rw-r--r--templates/repo/release_tag_header.tmpl11
-rw-r--r--templates/swagger/v1_json.tmpl6
2 files changed, 14 insertions, 3 deletions
diff --git a/templates/repo/release_tag_header.tmpl b/templates/repo/release_tag_header.tmpl
index dafe9f2fa6..63d0689c50 100644
--- a/templates/repo/release_tag_header.tmpl
+++ b/templates/repo/release_tag_header.tmpl
@@ -5,15 +5,20 @@
<div class="tw-flex">
<div class="tw-flex-1 tw-flex tw-items-center">
<h2 class="ui compact small menu small-menu-items">
- <a class="{{if and .PageIsReleaseList (not .PageIsSingleTag)}}active {{end}}item" href="{{.RepoLink}}/releases">{{ctx.Locale.TrN .NumReleases "repo.n_release_one" "repo.n_release_few" (ctx.Locale.PrettyNumber .NumReleases)}}</a>
+ <a class="{{if and .PageIsReleaseList (not .PageIsSingleTag)}}active {{end}}item" href="{{.RepoLink}}/releases{{if .Keyword}}?q={{.Keyword}}{{end}}">{{ctx.Locale.TrN .NumReleases "repo.n_release_one" "repo.n_release_few" (ctx.Locale.PrettyNumber .NumReleases)}}</a>
{{if $canReadCode}}
- <a class="{{if or .PageIsTagList .PageIsSingleTag}}active {{end}}item" href="{{.RepoLink}}/tags">{{ctx.Locale.TrN .NumTags "repo.n_tag_one" "repo.n_tag_few" (ctx.Locale.PrettyNumber .NumTags)}}</a>
+ <a class="{{if or .PageIsTagList .PageIsSingleTag}}active {{end}}item" href="{{.RepoLink}}/tags{{if .Keyword}}?q={{.Keyword}}{{end}}">{{ctx.Locale.TrN .NumTags "repo.n_tag_one" "repo.n_tag_few" (ctx.Locale.PrettyNumber .NumTags)}}</a>
{{end}}
</h2>
</div>
+ {{if .ShowReleaseSearch}}
+ <form class="ignore-dirty tw-w-1/5 tw-mr-3" method="get">
+ {{template "shared/search/combo" dict "Value" .Keyword}}
+ </form>
+ {{end}}
<div class="button-row">
{{if .EnableFeed}}
- <a class="ui small button" href="{{.RepoLink}}/{{if .PageIsTagList}}tags{{else}}releases{{end}}.rss">
+ <a class="ui small button tw-h-full" href="{{.RepoLink}}/{{if .PageIsTagList}}tags{{else}}releases{{end}}.rss">
{{svg "octicon-rss" 16}} {{ctx.Locale.Tr "rss_feed"}}
</a>
{{end}}
diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl
index dcf505cc7d..8e64c68f89 100644
--- a/templates/swagger/v1_json.tmpl
+++ b/templates/swagger/v1_json.tmpl
@@ -14164,6 +14164,12 @@
"in": "query"
},
{
+ "type": "string",
+ "description": "Search string",
+ "name": "q",
+ "in": "query"
+ },
+ {
"type": "integer",
"description": "page number of results to return (1-based)",
"name": "page",