2015-02-15 17:10:17 +01:00
|
|
|
ActiveAdmin.register Orga do
|
2015-12-27 14:35:46 +01:00
|
|
|
permit_params :kind_id, :name, :description, :url, :city, :department,
|
|
|
|
:region_id, :active
|
|
|
|
|
|
|
|
scope :active
|
|
|
|
scope :moderated
|
|
|
|
scope :unmoderated
|
2015-12-27 17:01:43 +01:00
|
|
|
|
2015-12-27 14:35:46 +01:00
|
|
|
config.sort_order = 'updated_at_desc'
|
2014-07-18 17:01:51 +02:00
|
|
|
|
2015-12-27 17:01:43 +01: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 :department
|
2015-02-15 15:50:47 +01:00
|
|
|
column :region
|
2015-12-27 17:01:43 +01:00
|
|
|
column :url
|
|
|
|
column :feed
|
|
|
|
column :contact
|
2015-12-27 14:35:46 +01:00
|
|
|
column :updated_at
|
2014-07-18 17:01:51 +02:00
|
|
|
actions
|
|
|
|
end
|
|
|
|
|
|
|
|
show do |l|
|
|
|
|
attributes_table do
|
2015-03-17 23:33:20 +01:00
|
|
|
row :kind
|
2014-07-18 17:01:51 +02:00
|
|
|
row :name
|
2015-12-27 14:35:46 +01:00
|
|
|
row :description, as: :pagedown_text
|
2014-10-13 21:53:25 +02:00
|
|
|
row :city
|
2014-07-18 17:01:51 +02:00
|
|
|
row :department
|
2015-02-15 15:50:47 +01:00
|
|
|
row :region
|
2015-12-27 17:01:43 +01:00
|
|
|
row :url do
|
|
|
|
link_to l.url, l.url
|
|
|
|
end
|
|
|
|
row :feed do
|
|
|
|
link_to l.feed, l.feed
|
|
|
|
end
|
|
|
|
row :contact do
|
|
|
|
mail_to l.contact, l.contact
|
|
|
|
end
|
2015-12-27 14:35:46 +01:00
|
|
|
row :active
|
2014-07-18 17:01:51 +02:00
|
|
|
end
|
|
|
|
active_admin_comments
|
|
|
|
end
|
|
|
|
|
|
|
|
form do |f|
|
|
|
|
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
|
|
|
|
f.input :city
|
|
|
|
f.input :department
|
2015-02-15 15:50:47 +01:00
|
|
|
f.input :region
|
2015-12-27 17:01:43 +01:00
|
|
|
f.input :description
|
|
|
|
f.input :url
|
|
|
|
f.input :feed
|
|
|
|
f.input :contact
|
2015-12-27 14:35:46 +01:00
|
|
|
f.input :active
|
2014-07-18 17:01:51 +02:00
|
|
|
end
|
|
|
|
f.actions
|
|
|
|
end
|
2013-12-28 15:45:21 +01:00
|
|
|
end
|