bans.rb 775 B

1234567891011121314151617181920212223242526272829303132
  1. ActiveAdmin.register Ban do
  2. menu :priority => 22 #,:parent => "Bots"
  3. index do
  4. column :id
  5. column :frequency, :sortable => :frequency_id
  6. column :hostmask
  7. column :reason
  8. column :valid_from
  9. column :valid_to
  10. column :activate
  11. column :created_at
  12. column :updated_at
  13. default_actions
  14. end
  15. form do |f|
  16. f.inputs "Details" do
  17. f.input :frequency, :as => :select, :member_label => :name # https://github.com/justinfrench/formtastic/blob/master/lib/formtastic/inputs/select_input.rb
  18. f.input :hostmask
  19. f.input :reason
  20. f.input :valid_from, :as => :datetime_picker
  21. f.input :valid_to, :as => :datetime_picker
  22. f.input :activate, :input_html => { :checked => 'checked' }
  23. end
  24. f.buttons
  25. end
  26. end