2023-09-25 13:15:51 +00:00
<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>
2022-11-20 14:08:38 +00:00
<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">
2023-09-25 13:15:51 +00:00
<label> {{ ctx .Locale .Tr "enabled" }} </label>
2022-11-20 14:08:38 +00:00
<input type="checkbox" name="enabled" {{ if .CleanupRule .Enabled }} checked {{ end }} >
</div>
</div>
<div class=" {{ if .IsEditRule }} disabled {{ end }} field {{ if .Err_Type }} error {{ end }} ">
2023-09-25 13:15:51 +00:00
<label> {{ ctx .Locale .Tr "packages.filter.type" }} </label>
2022-11-20 14:08:38 +00:00
<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">
2023-09-25 13:15:51 +00:00
<label> {{ ctx .Locale .Tr "packages.owner.settings.cleanuprules.pattern_full_match" }} </label>
2022-11-20 14:08:38 +00:00
<input type="checkbox" name="match_full_name" {{ if .CleanupRule .MatchFullName }} checked {{ end }} >
</div>
</div>
2023-06-29 12:24:22 +00:00
<div class="divider"></div>
2023-09-25 13:15:51 +00:00
<p> {{ ctx .Locale .Tr "packages.owner.settings.cleanuprules.keep.title" }} </p>
2022-11-20 14:08:38 +00:00
<div class="field {{ if .Err_KeepCount }} error {{ end }} ">
2023-09-25 13:15:51 +00:00
<label> {{ ctx .Locale .Tr "packages.owner.settings.cleanuprules.keep.count" }} :</label>
2022-11-20 14:08:38 +00:00
<select class="ui selection dropdown" name="keep_count">
<option {{ if eq .CleanupRule .KeepCount 0 }} selected="selected" {{ end }} value="0"></option>
2023-09-25 13:15:51 +00:00
<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 1 0 }} selected="selected" {{ end }} value="10"> {{ ctx .Locale .Tr "packages.owner.settings.cleanuprules.keep.count.n" 1 0 }} </option>
<option {{ if eq .CleanupRule .KeepCount 2 5 }} selected="selected" {{ end }} value="25"> {{ ctx .Locale .Tr "packages.owner.settings.cleanuprules.keep.count.n" 2 5 }} </option>
<option {{ if eq .CleanupRule .KeepCount 5 0 }} selected="selected" {{ end }} value="50"> {{ ctx .Locale .Tr "packages.owner.settings.cleanuprules.keep.count.n" 5 0 }} </option>
<option {{ if eq .CleanupRule .KeepCount 1 0 0 }} selected="selected" {{ end }} value="100"> {{ ctx .Locale .Tr "packages.owner.settings.cleanuprules.keep.count.n" 1 0 0 }} </option>
2022-11-20 14:08:38 +00:00
</select>
</div>
<div class="field {{ if .Err_KeepPattern }} error {{ end }} ">
2023-09-25 13:15:51 +00:00
<label> {{ ctx .Locale .Tr "packages.owner.settings.cleanuprules.keep.pattern" }} :</label>
2022-11-20 14:08:38 +00:00
<input name="keep_pattern" type="text" value=" {{ .CleanupRule .KeepPattern }} ">
2023-09-25 13:15:51 +00:00
<p> {{ ctx .Locale .Tr "packages.owner.settings.cleanuprules.keep.pattern.container" | Safe }} </p>
2022-11-20 14:08:38 +00:00
</div>
2023-06-29 12:24:22 +00:00
<div class="divider"></div>
2023-09-25 13:15:51 +00:00
<p> {{ ctx .Locale .Tr "packages.owner.settings.cleanuprules.remove.title" }} </p>
2022-11-20 14:08:38 +00:00
<div class="field {{ if .Err_RemoveDays }} error {{ end }} ">
2023-09-25 13:15:51 +00:00
<label> {{ ctx .Locale .Tr "packages.owner.settings.cleanuprules.remove.days" }} :</label>
2022-11-20 14:08:38 +00:00
<select class="ui selection dropdown" name="remove_days">
<option {{ if eq .CleanupRule .RemoveDays 0 }} selected="selected" {{ end }} value="0"></option>
2023-09-25 13:15:51 +00:00
<option {{ if eq .CleanupRule .RemoveDays 7 }} selected="selected" {{ end }} value="7"> {{ ctx .Locale .Tr "tool.days" 7 }} </option>
<option {{ if eq .CleanupRule .RemoveDays 1 4 }} selected="selected" {{ end }} value="14"> {{ ctx .Locale .Tr "tool.days" 1 4 }} </option>
<option {{ if eq .CleanupRule .RemoveDays 3 0 }} selected="selected" {{ end }} value="30"> {{ ctx .Locale .Tr "tool.days" 3 0 }} </option>
<option {{ if eq .CleanupRule .RemoveDays 6 0 }} selected="selected" {{ end }} value="60"> {{ ctx .Locale .Tr "tool.days" 6 0 }} </option>
<option {{ if eq .CleanupRule .RemoveDays 9 0 }} selected="selected" {{ end }} value="90"> {{ ctx .Locale .Tr "tool.days" 9 0 }} </option>
<option {{ if eq .CleanupRule .RemoveDays 1 8 0 }} selected="selected" {{ end }} value="180"> {{ ctx .Locale .Tr "tool.days" 1 8 0 }} </option>
2022-11-20 14:08:38 +00:00
</select>
</div>
<div class="field {{ if .Err_RemovePattern }} error {{ end }} ">
2023-09-25 13:15:51 +00:00
<label> {{ ctx .Locale .Tr "packages.owner.settings.cleanuprules.remove.pattern" }} :</label>
2022-11-20 14:08:38 +00:00
<input name="remove_pattern" type="text" value=" {{ .CleanupRule .RemovePattern }} ">
</div>
<div class="field">
{{ if .IsEditRule }}
2023-09-25 13:15:51 +00:00
<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>
2022-11-20 14:08:38 +00:00
{{ else }}
2023-09-25 13:15:51 +00:00
<button class="ui primary button" name="action" value="save"> {{ ctx .Locale .Tr "add" }} </button>
2022-11-20 14:08:38 +00:00
{{ end }}
</div>
</form>
</div>