diff --git a/app/models/custom_filter.rb b/app/models/custom_filter.rb index 5833530d764693..2b568bad6a1a78 100644 --- a/app/models/custom_filter.rb +++ b/app/models/custom_filter.rb @@ -54,7 +54,7 @@ def expires_in return @expires_in if defined?(@expires_in) return nil if expires_at.nil? - [30.minutes, 1.hour, 6.hours, 12.hours, 1.day, 1.week].find { |expires_in| expires_in.from_now >= expires_at } + [30.minutes, 1.hour, 6.hours, 12.hours, 1.day, 1.week, 2.weeks, 1.month, 3.months].find { |expires_in| expires_in.from_now >= expires_at } end def irreversible=(value) diff --git a/app/views/filters/_filter_fields.html.haml b/app/views/filters/_filter_fields.html.haml index dfd104330eb655..98cd9153e1c0c6 100644 --- a/app/views/filters/_filter_fields.html.haml +++ b/app/views/filters/_filter_fields.html.haml @@ -2,7 +2,7 @@ .fields-row__column.fields-row__column-6.fields-group = f.input :title, as: :string, wrapper: :with_label, hint: false .fields-row__column.fields-row__column-6.fields-group - = f.input :expires_in, wrapper: :with_label, collection: [30.minutes, 1.hour, 6.hours, 12.hours, 1.day, 1.week].map(&:to_i), label_method: ->(i) { I18n.t("invites.expires_in.#{i}") }, include_blank: I18n.t('invites.expires_in_prompt') + = f.input :expires_in, wrapper: :with_label, collection: [30.minutes, 1.hour, 6.hours, 12.hours, 1.day, 1.week, 2.weeks, 1.month, 3.months].map(&:to_i), label_method: ->(i) { I18n.t("invites.expires_in.#{i}") }, include_blank: I18n.t('invites.expires_in_prompt') .fields-group = f.input :context, wrapper: :with_block_label, collection: CustomFilter::VALID_CONTEXTS, as: :check_boxes, collection_wrapper_tag: 'ul', item_wrapper_tag: 'li', label_method: ->(context) { I18n.t("filters.contexts.#{context}") }, include_blank: false @@ -10,7 +10,7 @@ %hr.spacer/ .fields-group - = f.input :filter_action, as: :radio_buttons, collection: %i(warn hide), include_blank: false, wrapper: :with_block_label, label_method: ->(action) { filter_action_label(action) }, hint: t('simple_form.hints.filters.action'), required: true + = f.input :filter_action, as: :radio_buttons, collection: %i(half_warn warn hide), include_blank: false, wrapper: :with_block_label, label_method: ->(action) { filter_action_label(action) }, hint: t('simple_form.hints.filters.action'), required: true .fields-group = f.input :exclude_follows, wrapper: :with_label, kmyblue: true, label: t('simple_form.labels.filters.options.exclude_follows') diff --git a/config/locales/en.yml b/config/locales/en.yml index 17f2783c28dd94..1902ef2af92afb 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1555,6 +1555,9 @@ en: '3600': 1 hour '43200': 12 hours '604800': 1 week + '1209600': 2 weeks + '2629746': 1 month + '7889238': 3 months '86400': 1 day expires_in_prompt: Never generate: Generate invite link diff --git a/config/locales/ja.yml b/config/locales/ja.yml index c3a3d4104b1fdb..ff7c827aa2f8ae 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -1543,6 +1543,9 @@ ja: '3600': 1時間 '43200': 12時間 '604800': 1週間 + '1209600': 2週間 + '2629746': 1ヶ月 + '7889238': 3ヶ月 '86400': 1日 expires_in_prompt: 無期限 generate: 招待リンクを作成