You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

edit.tmpl 4.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <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>
  2. <div class="ui attached segment">
  3. <form class="ui form" action="{{.Link}}" method="post">
  4. {{.CsrfTokenHtml}}
  5. <input name="id" type="hidden" value="{{.CleanupRule.ID}}">
  6. <div class="field">
  7. <div class="ui checkbox">
  8. <label>{{ctx.Locale.Tr "enabled"}}</label>
  9. <input type="checkbox" name="enabled" {{if .CleanupRule.Enabled}}checked{{end}}>
  10. </div>
  11. </div>
  12. <div class="{{if .IsEditRule}}disabled {{end}}field {{if .Err_Type}}error{{end}}">
  13. <label>{{ctx.Locale.Tr "packages.filter.type"}}</label>
  14. <select class="ui selection dropdown" name="type">
  15. {{range $type := .AvailableTypes}}
  16. <option{{if eq $.CleanupRule.Type $type}} selected="selected"{{end}} value="{{$type}}">{{$type.Name}}</option>
  17. {{end}}
  18. </select>
  19. </div>
  20. <div class="field">
  21. <div class="ui checkbox">
  22. <label>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.pattern_full_match"}}</label>
  23. <input type="checkbox" name="match_full_name" {{if .CleanupRule.MatchFullName}}checked{{end}}>
  24. </div>
  25. </div>
  26. <div class="divider"></div>
  27. <p>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.title"}}</p>
  28. <div class="field {{if .Err_KeepCount}}error{{end}}">
  29. <label>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.count"}}:</label>
  30. <select class="ui selection dropdown" name="keep_count">
  31. <option{{if eq .CleanupRule.KeepCount 0}} selected="selected"{{end}} value="0"></option>
  32. <option{{if eq .CleanupRule.KeepCount 1}} selected="selected"{{end}} value="1">{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.count.1"}}</option>
  33. <option{{if eq .CleanupRule.KeepCount 5}} selected="selected"{{end}} value="5">{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.count.n" 5}}</option>
  34. <option{{if eq .CleanupRule.KeepCount 10}} selected="selected"{{end}} value="10">{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.count.n" 10}}</option>
  35. <option{{if eq .CleanupRule.KeepCount 25}} selected="selected"{{end}} value="25">{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.count.n" 25}}</option>
  36. <option{{if eq .CleanupRule.KeepCount 50}} selected="selected"{{end}} value="50">{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.count.n" 50}}</option>
  37. <option{{if eq .CleanupRule.KeepCount 100}} selected="selected"{{end}} value="100">{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.count.n" 100}}</option>
  38. </select>
  39. </div>
  40. <div class="field {{if .Err_KeepPattern}}error{{end}}">
  41. <label>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.pattern"}}:</label>
  42. <input name="keep_pattern" type="text" value="{{.CleanupRule.KeepPattern}}">
  43. <p>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.pattern.container"}}</p>
  44. </div>
  45. <div class="divider"></div>
  46. <p>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.remove.title"}}</p>
  47. <div class="field {{if .Err_RemoveDays}}error{{end}}">
  48. <label>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.remove.days"}}:</label>
  49. <select class="ui selection dropdown" name="remove_days">
  50. <option{{if eq .CleanupRule.RemoveDays 0}} selected="selected"{{end}} value="0"></option>
  51. <option{{if eq .CleanupRule.RemoveDays 7}} selected="selected"{{end}} value="7">{{ctx.Locale.Tr "tool.days" 7}}</option>
  52. <option{{if eq .CleanupRule.RemoveDays 14}} selected="selected"{{end}} value="14">{{ctx.Locale.Tr "tool.days" 14}}</option>
  53. <option{{if eq .CleanupRule.RemoveDays 30}} selected="selected"{{end}} value="30">{{ctx.Locale.Tr "tool.days" 30}}</option>
  54. <option{{if eq .CleanupRule.RemoveDays 60}} selected="selected"{{end}} value="60">{{ctx.Locale.Tr "tool.days" 60}}</option>
  55. <option{{if eq .CleanupRule.RemoveDays 90}} selected="selected"{{end}} value="90">{{ctx.Locale.Tr "tool.days" 90}}</option>
  56. <option{{if eq .CleanupRule.RemoveDays 180}} selected="selected"{{end}} value="180">{{ctx.Locale.Tr "tool.days" 180}}</option>
  57. </select>
  58. </div>
  59. <div class="field {{if .Err_RemovePattern}}error{{end}}">
  60. <label>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.remove.pattern"}}:</label>
  61. <input name="remove_pattern" type="text" value="{{.CleanupRule.RemovePattern}}">
  62. </div>
  63. <div class="field">
  64. {{if .IsEditRule}}
  65. <button class="ui primary button" name="action" value="save">{{ctx.Locale.Tr "save"}}</button>
  66. <button class="ui red button" name="action" value="remove">{{ctx.Locale.Tr "remove"}}</button>
  67. <a class="ui button" href="{{.Link}}/preview">{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.preview"}}</a>
  68. {{else}}
  69. <button class="ui primary button" name="action" value="save">{{ctx.Locale.Tr "add"}}</button>
  70. {{end}}
  71. </div>
  72. </form>
  73. </div>