Event management added to the back office.
Includes date filters, and the possibility to extract most data. Refs #155
This commit is contained in:
parent
55122888e1
commit
f749ba984e
69
app/admin/event.rb
Normal file
69
app/admin/event.rb
Normal file
@ -0,0 +1,69 @@
|
||||
ActiveAdmin.register Event do
|
||||
permit_params :title, :start_time, :end_time, :repeat, :rule, :description,
|
||||
:place_name, :address, :city, :region_id, :locality, :url,
|
||||
:contact, :submitter, :tag_list
|
||||
|
||||
scope :all
|
||||
scope :moderated, default: true
|
||||
scope :unmoderated
|
||||
|
||||
config.sort_order = 'start_time_desc'
|
||||
|
||||
filter :region
|
||||
filter :start_time
|
||||
|
||||
index do
|
||||
column :title
|
||||
column :start_time
|
||||
column :end_time
|
||||
column :city
|
||||
column :region
|
||||
column :repeat
|
||||
column :rule
|
||||
column :moderated
|
||||
actions
|
||||
end
|
||||
|
||||
csv do
|
||||
column :title
|
||||
column :start_time
|
||||
column :end_time
|
||||
column :place_name
|
||||
column :address
|
||||
column :city
|
||||
column :region
|
||||
column :locality
|
||||
column :url
|
||||
column :contact
|
||||
column :submitter
|
||||
column :tag_list
|
||||
column :repeat
|
||||
column :rule
|
||||
end
|
||||
|
||||
show do
|
||||
attributes_table do
|
||||
row :title
|
||||
row :start_time
|
||||
row :end_time
|
||||
row :place_name
|
||||
row :address
|
||||
row :city
|
||||
row :region
|
||||
row :description do
|
||||
simple_format event.description
|
||||
end
|
||||
row :locality
|
||||
row :url do
|
||||
link_to event.url, event.url
|
||||
end
|
||||
row :contact do
|
||||
mail_to event.contact, event.contact
|
||||
end
|
||||
row :submitter do
|
||||
mail_to event.submitter, event.submitter
|
||||
end
|
||||
end
|
||||
active_admin_comments
|
||||
end
|
||||
end
|
@ -13,9 +13,6 @@ ActiveAdmin.register Orga do
|
||||
filter :region
|
||||
|
||||
index do
|
||||
column :id do |orga|
|
||||
link_to orga.id, orga
|
||||
end
|
||||
column :kind
|
||||
column :name
|
||||
column :city
|
||||
@ -42,25 +39,24 @@ ActiveAdmin.register Orga do
|
||||
column :active
|
||||
end
|
||||
|
||||
show do |l|
|
||||
show do
|
||||
attributes_table do
|
||||
row :kind
|
||||
row :name
|
||||
row :address
|
||||
row :city
|
||||
row :region
|
||||
h3 Orga.human_attribute_name :description
|
||||
section do
|
||||
simple_format l.description
|
||||
row :description do
|
||||
simple_format orga.description
|
||||
end
|
||||
row :url do
|
||||
link_to l.url, l.url
|
||||
link_to orga.url, orga.url
|
||||
end
|
||||
row :feed do
|
||||
link_to l.feed, l.feed
|
||||
link_to orga.feed, orga.feed
|
||||
end
|
||||
row :contact do
|
||||
mail_to l.contact, l.contact
|
||||
mail_to orga.contact, orga.contact
|
||||
end
|
||||
row :active
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user