Organisations' administration page display more columns as requested in Refs #15

This commit is contained in:
echarp 2015-12-27 17:01:43 +01:00
parent f3fce5fc6c
commit 099794cc9e
2 changed files with 31 additions and 15 deletions

View File

@ -5,16 +5,22 @@ ActiveAdmin.register Orga do
scope :active scope :active
scope :moderated scope :moderated
scope :unmoderated scope :unmoderated
config.sort_order = 'updated_at_desc' config.sort_order = 'updated_at_desc'
filter :kind, as: :check_boxes
filter :name
filter :region
index do index do
column :kind column :kind
column :name column :name
column :url
column :city column :city
column :department column :department
column :region column :region
column :active column :url
column :feed
column :contact
column :updated_at column :updated_at
actions actions
end end
@ -24,12 +30,18 @@ ActiveAdmin.register Orga do
row :kind row :kind
row :name row :name
row :description, as: :pagedown_text row :description, as: :pagedown_text
row :url do
link_to l.url, l.url
end
row :city row :city
row :department row :department
row :region row :region
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
row :active row :active
end end
active_admin_comments active_admin_comments
@ -39,11 +51,13 @@ ActiveAdmin.register Orga do
f.inputs do f.inputs do
f.input :kind f.input :kind
f.input :name f.input :name
f.input :description
f.input :url
f.input :city f.input :city
f.input :department f.input :department
f.input :region f.input :region
f.input :description
f.input :url
f.input :feed
f.input :contact
f.input :active f.input :active
end end
f.actions f.actions

View File

@ -1,13 +1,15 @@
===================================================== =====================================================
#{Orga.human_attribute_name(:kind).concat(':').ljust 12 } #{@orga.kind.name} #{Orga.human_attribute_name(:kind).concat(':').ljust 12 } #{@orga.kind.name}
#{Orga.human_attribute_name(:name).concat(':').ljust 12 } #{@orga.name} #{Orga.human_attribute_name(:name).concat(':').ljust 12 } #{@orga.name}
#{Orga.human_attribute_name(:region).concat(':').ljust 12 } #{@orga.region} #{Orga.human_attribute_name(:city).concat(':').ljust 12 } #{@orga.city}
#{Orga.human_attribute_name(:url).concat(':').ljust 12 } #{@orga.url} #{Orga.human_attribute_name(:department).concat(':').ljust 12 } #{@orga.department}
#{Orga.human_attribute_name(:feed).concat(':').ljust 12 } #{@orga.feed} #{Orga.human_attribute_name(:region).concat(':').ljust 12 } #{@orga.region}
#{Orga.human_attribute_name(:contact).concat(':').ljust 12 } #{@orga.contact} #{Orga.human_attribute_name(:url).concat(':').ljust 12 } #{@orga.url}
#{Orga.human_attribute_name(:submitter).concat(':').ljust 12} #{@orga.submitter} #{Orga.human_attribute_name(:feed).concat(':').ljust 12 } #{@orga.feed}
#{Orga.human_attribute_name(:contact).concat(':').ljust 12 } #{@orga.contact}
#{Orga.human_attribute_name(:submitter).concat(':').ljust 12 } #{@orga.submitter}
- if @orga.active.present? - if @orga.active.present?
#{Orga.human_attribute_name(:active).concat(':').ljust 12 } #{t @orga.active.to_s} #{Orga.human_attribute_name(:active).concat(':').ljust 12 } #{t @orga.active.to_s}
- unless @orga.description.blank? - unless @orga.description.blank?
#{Orga.human_attribute_name(:description).concat(':').ljust 12} #{Orga.human_attribute_name(:description).concat(':').ljust 12}
= wrap(strip_tags(@orga.description).gsub(/
/, '')).gsub /^/, ' ' = wrap(strip_tags(@orga.description).gsub(/
/, '')).gsub /^/, ' '