1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-12-14 11:48:09 -05:00
forgejo/templates/repo/wiki/search.tmpl
Oto Šťáva c0777279fe
Fix wiki search overflowing on wide screens (#6047)
Confine the search menu to be at most the width of the page, or 80% of
the viewport width, whichever is smaller. To do this, introduce a new
`--container-width` variable for the descendant elements of
`.ui.container` to be able to access.

Also update the relevant e2e test: add a long 'lorem ipsum' page, add a
search for it, parameterize the width.
2024-11-25 09:50:13 +01:00

12 lines
420 B
Go HTML Template

{{if .Results}}
{{range .Results}}
<a class="item tw-max-w-[min(80vw,var(--container-width))]" href="{{$.RepoLink}}/wiki/{{.Filename}}">
<b class="tw-block tw-mb-2 tw-whitespace-break-spaces">{{.Title}}</b>
{{range .LineCodes}}
<p class="tw-my-0 tw-whitespace-break-spaces">{{.}}</p>
{{end}}
</a>
{{end}}
{{else}}
<div class="item muted">{{ctx.Locale.Tr "repo.wiki.no_search_results"}}</div>
{{end}}