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
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
column :kind
@ -8,6 +14,8 @@ ActiveAdmin.register Orga do
column :city
column :department
column :region
column :active
column :updated_at
actions
end
@ -15,12 +23,14 @@ ActiveAdmin.register Orga do
attributes_table do
row :kind
row :name
row :description, as: :pagedown_text
row :url do
link_to l.url, l.url
end
row :city
row :department
row :region
row :active
end
active_admin_comments
end
@ -29,10 +39,12 @@ ActiveAdmin.register Orga do
f.inputs do
f.input :kind
f.input :name
f.input :description
f.input :url
f.input :city
f.input :department
f.input :region
f.input :active
end
f.actions
end

View File

@ -1,5 +1,3 @@
@import compass
.quantity
text-align: right
white-space: nowrap
@ -40,19 +38,5 @@ dl
dt + dd + dt +dd
border-top: 1px solid #999
.view_link:link, .edit_link:link, .delete_link:link
font-size: 0
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: ''
.edit_link:link, .delete_link:link
display: none

View File

@ -6,8 +6,9 @@
#{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}
#{Orga.human_attribute_name(:active).concat(':').ljust 12 } #{t @orga.active.to_s}
- if @orga.description
- if @orga.active.present?
#{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}
= 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
# 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
# users to your main site. Defaults to no link.