forgejo/templates/repo/create_init.tmpl
Gusted 03d4073cdd fix(ui): wrap items in gitignore dropdown (#8830)
- Resolves forgejo/forgejo#2639
- Simple E2E test to check that it doesn't overflow

Preview:
- https://codeberg.org/attachments/0466343b-7684-407b-bf97-311512bc5793
- https://codeberg.org/attachments/95626222-2f7c-4d56-9089-4fb4b7cac6ad

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8830
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-08-09 19:33:18 +02:00

56 lines
1.9 KiB
Go HTML Template

<label>
<input name="auto_init" type="checkbox" {{if .auto_init}}checked{{end}}>
{{ctx.Locale.Tr "repo.auto_init"}}
<span class="help">{{ctx.Locale.Tr "repo.auto_init_description"}}</span>
</label>
<div class="hide-unless-checked">
<label>
.gitignore
<div class="ui multiple search selection dropdown tw-flex-wrap">
<input type="hidden" name="gitignores" value="{{.gitignores}}">
<div class="default text">{{ctx.Locale.Tr "repo.repo_gitignore_helper"}}</div>
<div class="menu">
{{range .Gitignores}}
<div class="item" data-value="{{.}}">{{.}}</div>
{{end}}
</div>
</div>
<span class="help">{{ctx.Locale.Tr "repo.repo_gitignore_helper_desc"}}</span>
</label>
<label>
{{ctx.Locale.Tr "repo.license"}}
<div class="ui search selection dropdown">
<input type="hidden" name="license" value="{{.license}}">
<div class="default text">{{ctx.Locale.Tr "repo.license_helper"}}</div>
<div class="menu">
<div class="item" data-value="">{{ctx.Locale.Tr "repo.license_helper"}}</div>
{{range .Licenses}}
<div class="item" data-value="{{.}}">{{.}}</div>
{{end}}
</div>
</div>
<span class="help">{{ctx.Locale.Tr "repo.license_helper_desc" "https://choosealicense.com/"}}</span>
</label>
{{$supportedReadmesLength := len .Readmes}}
{{/* Only offer README selection if there is an actual choice */}}
{{if ge $supportedReadmesLength 2}}
<label>
{{ctx.Locale.Tr "repo.readme"}}
<div class="ui selection dropdown">
<input type="hidden" name="readme" value="{{.readme}}">
<div class="default text">{{ctx.Locale.Tr "repo.readme_helper"}}</div>
<div class="menu">
{{range .Readmes}}
<div class="item" data-value="{{.}}">{{.}}</div>
{{end}}
</div>
</div>
<span class="help">{{ctx.Locale.Tr "repo.readme_helper_desc"}}</span>
</label>
{{else}}
<input type="hidden" name="readme" value="Default">
{{end}}
</div>