|
|
|
@ -1,13 +1,13 @@
|
|
|
|
|
ActiveAdmin.register Orga do |
|
|
|
|
permit_params :kind_id, :name, :description, :url, :city, :department, |
|
|
|
|
:region_id, :active |
|
|
|
|
permit_params :active, :kind_id, :name, :description, :url, :city, :region_id |
|
|
|
|
|
|
|
|
|
scope :active |
|
|
|
|
scope :all, default: true |
|
|
|
|
scope :moderated |
|
|
|
|
scope :unmoderated |
|
|
|
|
|
|
|
|
|
config.sort_order = 'updated_at_desc' |
|
|
|
|
|
|
|
|
|
filter :active, as: :radio |
|
|
|
|
filter :kind, as: :check_boxes |
|
|
|
|
filter :name |
|
|
|
|
filter :region |
|
|
|
@ -16,23 +16,36 @@ ActiveAdmin.register Orga do
|
|
|
|
|
column :kind |
|
|
|
|
column :name |
|
|
|
|
column :city |
|
|
|
|
column :department |
|
|
|
|
column :region |
|
|
|
|
column :url |
|
|
|
|
column :feed |
|
|
|
|
column :contact |
|
|
|
|
column :submitter |
|
|
|
|
column :updated_at |
|
|
|
|
column :active |
|
|
|
|
actions |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
csv do |
|
|
|
|
column(:kind) { |o| o.kind.name } |
|
|
|
|
column :name |
|
|
|
|
column :contact |
|
|
|
|
column :submitter |
|
|
|
|
column :updated_at |
|
|
|
|
column :active |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
show do |l| |
|
|
|
|
attributes_table do |
|
|
|
|
row :kind |
|
|
|
|
row :name |
|
|
|
|
row :description |
|
|
|
|
row :address |
|
|
|
|
row :city |
|
|
|
|
row :department |
|
|
|
|
row :region |
|
|
|
|
h3 Orga.human_attribute_name :description |
|
|
|
|
section do |
|
|
|
|
simple_format l.description |
|
|
|
|
end |
|
|
|
|
row :url do |
|
|
|
|
link_to l.url, l.url |
|
|
|
|
end |
|
|
|
@ -48,16 +61,20 @@ ActiveAdmin.register Orga do
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
form do |f| |
|
|
|
|
f.semantic_errors |
|
|
|
|
f.inputs do |
|
|
|
|
f.input :kind |
|
|
|
|
f.input :name |
|
|
|
|
f.input :address, as: :string |
|
|
|
|
f.input :city |
|
|
|
|
f.input :department |
|
|
|
|
f.input :region |
|
|
|
|
f.input :latitude |
|
|
|
|
f.input :longitude |
|
|
|
|
f.input :description |
|
|
|
|
f.input :url |
|
|
|
|
f.input :feed |
|
|
|
|
f.input :contact |
|
|
|
|
f.input :submitter |
|
|
|
|
f.input :active |
|
|
|
|
end |
|
|
|
|
f.actions |
|
|
|
|