mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-22 14:15:22 +00:00
Add ip_blocks_expires_options
helper method for collection options
This commit is contained in:
parent
44d92fa4f6
commit
340219284a
|
@ -9,4 +9,8 @@ module Admin::IpBlocksHelper
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def ip_blocks_expires_options
|
||||||
|
[1.day, 2.weeks, 1.month, 6.months, 1.year, 3.years]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
.fields-group
|
.fields-group
|
||||||
= f.input :expires_in,
|
= f.input :expires_in,
|
||||||
collection: [1.day, 2.weeks, 1.month, 6.months, 1.year, 3.years].map(&:to_i),
|
collection: ip_blocks_expires_options.map(&:to_i),
|
||||||
label_method: ->(i) { I18n.t("admin.ip_blocks.expires_in.#{i}") },
|
label_method: ->(i) { I18n.t("admin.ip_blocks.expires_in.#{i}") },
|
||||||
prompt: I18n.t('invites.expires_in_prompt'),
|
prompt: I18n.t('invites.expires_in_prompt'),
|
||||||
wrapper: :with_block_label
|
wrapper: :with_block_label
|
||||||
|
|
Loading…
Reference in a new issue