new.html.haml 1.3 KB

123456789101112131415161718192021222324252627282930
  1. - content_for :page_title do
  2. = t('admin.account_actions.title', acct: @account.pretty_acct)
  3. = simple_form_for @account_action, url: admin_account_action_path(@account.id) do |f|
  4. = f.input :report_id, as: :hidden
  5. .fields-group
  6. = f.input :type, as: :radio_buttons, collection: Admin::AccountAction.types_for_account(@account), include_blank: false, wrapper: :with_block_label, label_method: ->(type) { account_action_type_label(type) }, hint: t('simple_form.hints.admin_account_action.type_html', acct: @account.pretty_acct)
  7. - if @account.local?
  8. %hr.spacer/
  9. .fields-group
  10. = f.input :send_email_notification, as: :boolean, wrapper: :with_label
  11. - if params[:report_id].present?
  12. .fields-group
  13. = f.input :include_statuses, as: :boolean, wrapper: :with_label
  14. %hr.spacer/
  15. - unless @warning_presets.empty?
  16. .fields-group
  17. = f.input :warning_preset_id, collection: @warning_presets, label_method: ->(warning_preset) { [warning_preset.title.presence, truncate(warning_preset.text)].compact.join(' - ') }, wrapper: :with_block_label
  18. .fields-group
  19. = f.input :text, as: :text, wrapper: :with_block_label, hint: t('simple_form.hints.admin_account_action.text_html', path: admin_warning_presets_path)
  20. .actions
  21. = f.button :button, t('admin.account_actions.action'), type: :submit