1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-11-24 08:57:03 -05:00
forgejo/templates/package/shared/cleanup_rules/list.tmpl
2023-09-25 20:42:40 +08:00

56 lines
2.2 KiB
Go HTML Template

<h4 class="ui top attached header">
{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.title"}}
<div class="ui right">
<a class="ui primary tiny button" href="{{.Link}}/rules/add">{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.add"}}</a>
</div>
</h4>
<div class="ui attached segment">
<div class="flex-list">
{{range .CleanupRules}}
<div class="flex-item">
<div class="flex-item-leading">
{{svg .Type.SVGName 32}}
</div>
<div class="flex-item-main">
<div class="flex-item-title">
<a class="item" href="{{$.Link}}/rules/{{.ID}}">{{.Type.Name}}</a>
</div>
<div class="flex-item-body">
<i>{{if .Enabled}}{{ctx.Locale.Tr "enabled"}}{{else}}{{ctx.Locale.Tr "disabled"}}{{end}}</i>
</div>
{{if .KeepCount}}
<div class="flex-item-body">
<i>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.count"}}:</i> {{if eq .KeepCount 1}}{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.count.1"}}{{else}}{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.count.n" .KeepCount}}{{end}}
</div>
{{end}}
{{if .KeepPattern}}
<div class="flex-item-body">
<i>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.pattern"}}:</i> {{StringUtils.EllipsisString .KeepPattern 100}}
</div>
{{end}}
{{if .RemoveDays}}
<div class="flex-item-body">
<i>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.remove.days"}}:</i> {{ctx.Locale.Tr "tool.days" .RemoveDays}}
</div>
{{end}}
{{if .RemovePattern}}
<div class="flex-item-body">
<i>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.remove.pattern"}}:</i> {{StringUtils.EllipsisString .RemovePattern 100}}
</div>
{{end}}
</div>
<div class="flex-item-trailing">
<div class="ui dropdown tiny basic button">
{{svg "octicon-kebab-horizontal"}}
<div class="menu">
<a class="item" href="{{$.Link}}/rules/{{.ID}}">{{ctx.Locale.Tr "edit"}}</a>
<a class="item" href="{{$.Link}}/rules/{{.ID}}/preview">{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.preview"}}</a>
</div>
</div>
</div>
</div>
{{else}}
<div class="item">{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.none"}}</div>
{{end}}
</div>
</div>