mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-24 08:57:03 -05:00
60447a7097
Follow #29165 (cherry picked from commit 7a1557d2cc893030ae900c4333eeb12d84b891dc) Conflicts: templates/package/content/alpine.tmpl templates/package/content/cargo.tmpl templates/package/content/chef.tmpl templates/package/content/composer.tmpl templates/package/content/conan.tmpl templates/package/content/conda.tmpl templates/package/content/container.tmpl templates/package/content/cran.tmpl templates/package/content/debian.tmpl templates/package/content/generic.tmpl templates/package/content/go.tmpl templates/package/content/helm.tmpl templates/package/content/maven.tmpl templates/package/content/npm.tmpl templates/package/content/nuget.tmpl templates/package/content/pub.tmpl templates/package/content/pypi.tmpl templates/package/content/rpm.tmpl templates/package/content/rubygems.tmpl templates/package/content/swift.tmpl templates/package/content/vagrant.tmpl templates/package/shared/cargo.tmpl templates/package/shared/list.tmpl templates/repo/code/recently_pushed_new_branches.tmpl templates/repo/issue/view_content/comments.tmpl templates/status/404.tmpl templates/user/settings/packages.tmpl context
73 lines
4.8 KiB
Go HTML Template
73 lines
4.8 KiB
Go HTML Template
<h4 class="ui top attached header">{{if .IsEditRule}}{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.edit"}}{{else}}{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.add"}}{{end}}</h4>
|
|
<div class="ui attached segment">
|
|
<form class="ui form" action="{{.Link}}" method="post">
|
|
{{.CsrfTokenHtml}}
|
|
<input name="id" type="hidden" value="{{.CleanupRule.ID}}">
|
|
<div class="field">
|
|
<div class="ui checkbox">
|
|
<label>{{ctx.Locale.Tr "enabled"}}</label>
|
|
<input type="checkbox" name="enabled" {{if .CleanupRule.Enabled}}checked{{end}}>
|
|
</div>
|
|
</div>
|
|
<div class="{{if .IsEditRule}}disabled {{end}}field {{if .Err_Type}}error{{end}}">
|
|
<label>{{ctx.Locale.Tr "packages.filter.type"}}</label>
|
|
<select class="ui selection dropdown" name="type">
|
|
{{range $type := .AvailableTypes}}
|
|
<option{{if eq $.CleanupRule.Type $type}} selected="selected"{{end}} value="{{$type}}">{{$type.Name}}</option>
|
|
{{end}}
|
|
</select>
|
|
</div>
|
|
<div class="field">
|
|
<div class="ui checkbox">
|
|
<label>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.pattern_full_match"}}</label>
|
|
<input type="checkbox" name="match_full_name" {{if .CleanupRule.MatchFullName}}checked{{end}}>
|
|
</div>
|
|
</div>
|
|
<div class="divider"></div>
|
|
<p>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.title"}}</p>
|
|
<div class="field {{if .Err_KeepCount}}error{{end}}">
|
|
<label>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.count"}}:</label>
|
|
<select class="ui selection dropdown" name="keep_count">
|
|
<option{{if eq .CleanupRule.KeepCount 0}} selected="selected"{{end}} value="0"></option>
|
|
<option{{if eq .CleanupRule.KeepCount 1}} selected="selected"{{end}} value="1">{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.count.1"}}</option>
|
|
<option{{if eq .CleanupRule.KeepCount 5}} selected="selected"{{end}} value="5">{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.count.n" 5}}</option>
|
|
<option{{if eq .CleanupRule.KeepCount 10}} selected="selected"{{end}} value="10">{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.count.n" 10}}</option>
|
|
<option{{if eq .CleanupRule.KeepCount 25}} selected="selected"{{end}} value="25">{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.count.n" 25}}</option>
|
|
<option{{if eq .CleanupRule.KeepCount 50}} selected="selected"{{end}} value="50">{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.count.n" 50}}</option>
|
|
<option{{if eq .CleanupRule.KeepCount 100}} selected="selected"{{end}} value="100">{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.count.n" 100}}</option>
|
|
</select>
|
|
</div>
|
|
<div class="field {{if .Err_KeepPattern}}error{{end}}">
|
|
<label>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.pattern"}}:</label>
|
|
<input name="keep_pattern" type="text" value="{{.CleanupRule.KeepPattern}}">
|
|
<p>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.pattern.container"}}</p>
|
|
</div>
|
|
<div class="divider"></div>
|
|
<p>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.remove.title"}}</p>
|
|
<div class="field {{if .Err_RemoveDays}}error{{end}}">
|
|
<label>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.remove.days"}}:</label>
|
|
<select class="ui selection dropdown" name="remove_days">
|
|
<option{{if eq .CleanupRule.RemoveDays 0}} selected="selected"{{end}} value="0"></option>
|
|
<option{{if eq .CleanupRule.RemoveDays 7}} selected="selected"{{end}} value="7">{{ctx.Locale.Tr "tool.days" 7}}</option>
|
|
<option{{if eq .CleanupRule.RemoveDays 14}} selected="selected"{{end}} value="14">{{ctx.Locale.Tr "tool.days" 14}}</option>
|
|
<option{{if eq .CleanupRule.RemoveDays 30}} selected="selected"{{end}} value="30">{{ctx.Locale.Tr "tool.days" 30}}</option>
|
|
<option{{if eq .CleanupRule.RemoveDays 60}} selected="selected"{{end}} value="60">{{ctx.Locale.Tr "tool.days" 60}}</option>
|
|
<option{{if eq .CleanupRule.RemoveDays 90}} selected="selected"{{end}} value="90">{{ctx.Locale.Tr "tool.days" 90}}</option>
|
|
<option{{if eq .CleanupRule.RemoveDays 180}} selected="selected"{{end}} value="180">{{ctx.Locale.Tr "tool.days" 180}}</option>
|
|
</select>
|
|
</div>
|
|
<div class="field {{if .Err_RemovePattern}}error{{end}}">
|
|
<label>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.remove.pattern"}}:</label>
|
|
<input name="remove_pattern" type="text" value="{{.CleanupRule.RemovePattern}}">
|
|
</div>
|
|
<div class="field">
|
|
{{if .IsEditRule}}
|
|
<button class="ui primary button" name="action" value="save">{{ctx.Locale.Tr "save"}}</button>
|
|
<button class="ui red button" name="action" value="remove">{{ctx.Locale.Tr "remove"}}</button>
|
|
<a class="ui button" href="{{.Link}}/preview">{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.preview"}}</a>
|
|
{{else}}
|
|
<button class="ui primary button" name="action" value="save">{{ctx.Locale.Tr "add"}}</button>
|
|
{{end}}
|
|
</div>
|
|
</form>
|
|
</div>
|