agenda-libre-ruby/app/admin/orga.rb

86 lines
1.5 KiB
Ruby
Raw Normal View History

2015-02-15 17:10:17 +01:00
ActiveAdmin.register Orga do
2019-04-26 17:20:49 +02:00
permit_params :active, :kind_id, :name, :description, :url, :city, :region_id
2019-04-26 18:46:38 +02:00
scope :all
scope :active, default: true
scope :inactive
scope :unmoderated
config.sort_order = 'updated_at_desc'
2014-07-18 17:01:51 +02:00
filter :kind, as: :check_boxes
filter :name
filter :region
2014-07-18 17:01:51 +02:00
index do
2015-03-17 23:33:20 +01:00
column :kind
2014-07-18 17:01:51 +02:00
column :name
column :city
column :region
column :url
column :feed
column :contact
2019-04-26 17:20:49 +02:00
column :submitter
column :updated_at
2019-04-26 17:20:49 +02:00
column :active
2014-07-18 17:01:51 +02:00
actions
end
2019-04-26 17:20:49 +02:00
csv do
column(:kind) { |o| o.kind.name }
column :name
column :city
column :region
column :url
column :feed
2019-04-26 17:20:49 +02:00
column :contact
column :submitter
column :updated_at
column :active
end
show do
2014-07-18 17:01:51 +02:00
attributes_table do
2015-03-17 23:33:20 +01:00
row :kind
2014-07-18 17:01:51 +02:00
row :name
2019-04-26 17:20:49 +02:00
row :address
row :city
row :region
row :description do
simple_format orga.description
2019-04-26 17:20:49 +02:00
end
row :url do
link_to orga.url, orga.url
end
row :feed do
link_to orga.feed, orga.feed
end
row :contact do
mail_to orga.contact, orga.contact
end
row :active
2014-07-18 17:01:51 +02:00
end
active_admin_comments
end
form do |f|
2019-04-26 17:20:49 +02:00
f.semantic_errors
2014-07-18 17:01:51 +02:00
f.inputs do
2015-03-17 23:33:20 +01:00
f.input :kind
2014-07-18 17:01:51 +02:00
f.input :name
2019-04-26 17:20:49 +02:00
f.input :address, as: :string
2014-07-18 17:01:51 +02:00
f.input :city
f.input :region
2019-04-26 17:20:49 +02:00
f.input :latitude
f.input :longitude
f.input :description
f.input :url
f.input :feed
f.input :contact
2019-04-26 17:20:49 +02:00
f.input :submitter
f.input :active
2014-07-18 17:01:51 +02:00
end
f.actions
end
end