Use implicit controller/action path for i18n in admin/domain_blocks

pull/1949/head
Matt Jankowski 2017-04-16 11:52:15 -04:00
parent 0b44e62950
commit 93084845b5
2 changed files with 13 additions and 7 deletions

View File

@ -1,17 +1,17 @@
- content_for :page_title do
= t('admin.domain_blocks.new.title')
= t('.title')
= simple_form_for @domain_block, url: admin_domain_blocks_path do |f|
= render 'shared/error_messages', object: @domain_block
%p.hint= t('admin.domain_blocks.new.hint')
%p.hint= t('.hint')
= f.input :domain, placeholder: t('admin.domain_blocks.domain')
= f.input :severity, collection: DomainBlock.severities.keys, wrapper: :with_label, include_blank: false, label_method: lambda { |type| I18n.t("admin.domain_blocks.new.severity.#{type}") }
= f.input :severity, collection: DomainBlock.severities.keys, wrapper: :with_label, include_blank: false, label_method: lambda { |type| t(".severity.#{type}") }
%p.hint= t('admin.domain_blocks.new.severity.desc_html')
%p.hint= t('.severity.desc_html')
= f.input :reject_media, as: :boolean, wrapper: :with_label, label: I18n.t('admin.domain_blocks.reject_media'), hint: I18n.t('admin.domain_blocks.reject_media_hint')
.actions
= f.button :button, t('admin.domain_blocks.new.create'), type: :submit
= f.button :button, t('.create'), type: :submit

View File

@ -3,7 +3,13 @@
= simple_form_for @domain_block, url: admin_domain_block_path(@domain_block), method: :delete do |f|
= f.input :retroactive, as: :boolean, wrapper: :with_label, label: I18n.t("admin.domain_blocks.show.retroactive.#{@domain_block.severity}"), hint: I18n.t('admin.domain_blocks.show.affected_accounts', count: Account.where(domain: @domain_block.domain).count)
= f.input :retroactive,
as: :boolean,
wrapper: :with_label,
label: t(".retroactive.#{@domain_block.severity}"),
hint: t(:affected_accounts,
scope: [:admin, :domain_blocks, :show],
count: Account.where(domain: @domain_block.domain).count)
.actions
= f.button :button, t('admin.domain_blocks.show.undo'), type: :submit
= f.button :button, t('.undo'), type: :submit