forgejo/templates/repo/create_basic.tmpl
Otto Richter 81599155e8 New repo: Rework basic settings
- separate template
- ensure correct labelling of elements
- drop additional required indicators for field that already have
  browser semantics (the icon has colour contrast issues anyway),
especially as the first dropdown cannot be left empty
2024-12-28 22:32:11 +01:00

45 lines
2 KiB
Go HTML Template

<label id="repo_owner_label" {{if .Err_Owner}}class="field error"{{end}}>{{ctx.Locale.Tr "repo.owner"}}
<div class="ui selection required dropdown" aria-labelledby="repo_owner_label">
<input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required>
<span class="text truncated-item-container" title="{{.ContextUser.Name}}">
{{ctx.AvatarUtils.Avatar .ContextUser 28 "mini"}}
<span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span>
</span>
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="menu">
<div class="item truncated-item-container" data-value="{{.SignedUser.ID}}" title="{{.SignedUser.Name}}">
{{ctx.AvatarUtils.Avatar .SignedUser 28 "mini"}}
<span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span>
</div>
{{range .Orgs}}
<div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}">
{{ctx.AvatarUtils.Avatar . 28 "mini"}}
<span class="truncated-item-name">{{.ShortName 40}}</span>
</div>
{{end}}
</div>
</div>
<span class="help">{{ctx.Locale.Tr "repo.owner_helper"}}</span>
</label>
<label {{if .Err_RepoName}}class="field error"{{end}}>
{{ctx.Locale.Tr "repo.repo_name"}}
<input name="repo_name" value="{{.repo_name}}" required maxlength="100">
<span class="help">{{ctx.Locale.Tr "repo.repo_name_helper"}}</span>
</label>
<label>
<input name="private" type="checkbox"
{{if .IsForcedPrivate}}
checked disabled
{{else}}
{{if .private}}checked{{end}}
{{end}}>
{{ctx.Locale.Tr "repo.visibility_helper"}}
{{if .IsForcedPrivate}}
<span class="help">{{ctx.Locale.Tr "repo.visibility_helper_forced"}}</span>
{{end}}
<span class="help">{{ctx.Locale.Tr "repo.visibility_description"}}</span>
</label>
<label {{if .Err_Description}}class="field error"{{end}}>
{{ctx.Locale.Tr "repo.repo_desc"}}
<textarea rows="2" name="description" placeholder="{{ctx.Locale.Tr "repo.repo_desc_helper"}}" maxlength="2048">{{.description}}</textarea>
</label>