show.html.haml 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. - content_for :page_title do
  2. = t('settings.statuses_cleanup')
  3. - content_for :heading_actions do
  4. = button_tag t('generic.save_changes'), class: 'button', form: 'edit_policy'
  5. = simple_form_for @policy, url: statuses_cleanup_path, method: :put, html: { id: 'edit_policy' } do |f|
  6. .fields-row
  7. .fields-row__column.fields-row__column-6.fields-group
  8. = f.input :enabled,
  9. as: :boolean,
  10. hint: t('statuses_cleanup.enabled_hint'),
  11. label: t('statuses_cleanup.enabled'),
  12. wrapper: :with_label
  13. .fields-row__column.fields-row__column-6.fields-group
  14. = f.input :min_status_age,
  15. disabled: !@policy.enabled?,
  16. collection: AccountStatusesCleanupPolicy::ALLOWED_MIN_STATUS_AGE.map(&:to_i),
  17. hint: false,
  18. include_blank: false,
  19. label_method: ->(i) { t("statuses_cleanup.min_age.#{i}") },
  20. label: t('statuses_cleanup.min_age_label'),
  21. wrapper: :with_label
  22. .flash-message= t('statuses_cleanup.explanation')
  23. %h4= t('statuses_cleanup.exceptions')
  24. .fields-row
  25. .fields-row__column.fields-row__column-6.fields-group
  26. = f.input :keep_pinned,
  27. disabled: !@policy.enabled?,
  28. hint: t('statuses_cleanup.keep_pinned_hint'),
  29. label: t('statuses_cleanup.keep_pinned'),
  30. wrapper: :with_label
  31. .fields-row__column.fields-row__column-6.fields-group
  32. = f.input :keep_direct,
  33. disabled: !@policy.enabled?,
  34. hint: t('statuses_cleanup.keep_direct_hint'),
  35. label: t('statuses_cleanup.keep_direct'),
  36. wrapper: :with_label
  37. .fields-row
  38. .fields-row__column.fields-row__column-6.fields-group
  39. = f.input :keep_self_fav,
  40. disabled: !@policy.enabled?,
  41. hint: t('statuses_cleanup.keep_self_fav_hint'),
  42. label: t('statuses_cleanup.keep_self_fav'),
  43. wrapper: :with_label
  44. .fields-row__column.fields-row__column-6.fields-group
  45. = f.input :keep_self_bookmark,
  46. disabled: !@policy.enabled?,
  47. hint: t('statuses_cleanup.keep_self_bookmark_hint'),
  48. label: t('statuses_cleanup.keep_self_bookmark'),
  49. wrapper: :with_label
  50. .fields-row
  51. .fields-row__column.fields-row__column-6.fields-group
  52. = f.input :keep_polls,
  53. disabled: !@policy.enabled?,
  54. hint: t('statuses_cleanup.keep_polls_hint'),
  55. label: t('statuses_cleanup.keep_polls'),
  56. wrapper: :with_label
  57. .fields-row__column.fields-row__column-6.fields-group
  58. = f.input :keep_media,
  59. disabled: !@policy.enabled?,
  60. hint: t('statuses_cleanup.keep_media_hint'),
  61. label: t('statuses_cleanup.keep_media'),
  62. wrapper: :with_label
  63. %h4= t('statuses_cleanup.interaction_exceptions')
  64. .fields-row
  65. .fields-row__column.fields-row__column-6.fields-group
  66. = f.input :min_favs,
  67. disabled: !@policy.enabled?,
  68. hint: t('statuses_cleanup.min_favs_hint'),
  69. input_html: { min: 1, placeholder: t('statuses_cleanup.ignore_favs') },
  70. label: t('statuses_cleanup.min_favs'),
  71. wrapper: :with_label
  72. .fields-row__column.fields-row__column-6.fields-group
  73. = f.input :min_reblogs,
  74. disabled: !@policy.enabled?,
  75. hint: t('statuses_cleanup.min_reblogs_hint'),
  76. input_html: { min: 1, placeholder: t('statuses_cleanup.ignore_reblogs') },
  77. label: t('statuses_cleanup.min_reblogs'),
  78. wrapper: :with_label
  79. .flash-message= t('statuses_cleanup.interaction_exceptions_explanation')