Organisations' administration is now more complete. Refs #19

This commit is contained in:
echarp 2015-12-27 14:35:46 +01:00
parent 0b3db18477
commit fbbe57f873
5 changed files with 21 additions and 22 deletions

2
app/admin/kind.rb Normal file
View File

@ -0,0 +1,2 @@
ActiveAdmin.register Kind do
end

View File

@ -1,5 +1,11 @@
ActiveAdmin.register Orga do ActiveAdmin.register Orga do
permit_params :kind_id, :name, :url, :city, :department, :region_id permit_params :kind_id, :name, :description, :url, :city, :department,
:region_id, :active
scope :active
scope :moderated
scope :unmoderated
config.sort_order = 'updated_at_desc'
index do index do
column :kind column :kind
@ -8,6 +14,8 @@ ActiveAdmin.register Orga do
column :city column :city
column :department column :department
column :region column :region
column :active
column :updated_at
actions actions
end end
@ -15,12 +23,14 @@ ActiveAdmin.register Orga do
attributes_table do attributes_table do
row :kind row :kind
row :name row :name
row :description, as: :pagedown_text
row :url do row :url do
link_to l.url, l.url link_to l.url, l.url
end end
row :city row :city
row :department row :department
row :region row :region
row :active
end end
active_admin_comments active_admin_comments
end end
@ -29,10 +39,12 @@ 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 :url
f.input :city f.input :city
f.input :department f.input :department
f.input :region f.input :region
f.input :active
end end
f.actions f.actions
end end

View File

@ -1,5 +1,3 @@
@import compass
.quantity .quantity
text-align: right text-align: right
white-space: nowrap white-space: nowrap
@ -40,19 +38,5 @@ dl
dt + dd + dt +dd dt + dd + dt +dd
border-top: 1px solid #999 border-top: 1px solid #999
.view_link:link, .edit_link:link, .delete_link:link .edit_link:link, .delete_link:link
font-size: 0 display: none
font-weight: normal
text-decoration: none
&:hover
+text-shadow(2px 2px 1px lightblue)
&:before
padding: 0.5em
font-size: 20px
font-family: FontAwesome
.view_link:link:before
content: ''
.edit_link:link:before
content: ''
.delete_link:link:before
content: ''

View File

@ -6,8 +6,9 @@
#{Orga.human_attribute_name(:feed).concat(':').ljust 12 } #{@orga.feed} #{Orga.human_attribute_name(:feed).concat(':').ljust 12 } #{@orga.feed}
#{Orga.human_attribute_name(:contact).concat(':').ljust 12 } #{@orga.contact} #{Orga.human_attribute_name(:contact).concat(':').ljust 12 } #{@orga.contact}
#{Orga.human_attribute_name(:submitter).concat(':').ljust 12} #{@orga.submitter} #{Orga.human_attribute_name(:submitter).concat(':').ljust 12} #{@orga.submitter}
#{Orga.human_attribute_name(:active).concat(':').ljust 12 } #{t @orga.active.to_s} - if @orga.active.present?
- if @orga.description #{Orga.human_attribute_name(:active).concat(':').ljust 12 } #{t @orga.active.to_s}
- 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 /^/, ' '
===================================================== =====================================================

View File

@ -4,7 +4,7 @@ ActiveAdmin.setup do |config|
# Set the title that is displayed on the main layout # Set the title that is displayed on the main layout
# for each of the active admin pages. # for each of the active admin pages.
# #
config.site_title = 'Agenda Du Libre' config.site_title = 'Agenda du Libre'
# Set the link url for the title. For example, to take # Set the link url for the title. For example, to take
# users to your main site. Defaults to no link. # users to your main site. Defaults to no link.