Skip to content
Snippets Groups Projects
Commit a2a3f8a1 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

climate

parent e18423b4
No related branches found
No related tags found
No related merge requests found
......@@ -11,22 +11,7 @@ class Admin::Communication::Extranets::ContactsController < Admin::Communication
.ordered
.page(params[:organizations_page])
}
format.xlsx {
# params[export] can be "people" oe "organizations"
export = params['export']
case params['export']
when 'people'
@people = @extranet.connected_people.ordered
when 'organizations'
@organizations = @extranet.connected_organizations.ordered
else
raise ActionController::RoutingError.new('Not Found')
end
filename = "#{export}-#{Time.now.strftime("%Y%m%d%H%M%S")}.xlsx"
response.headers['Content-Disposition'] = "attachment; filename=#{filename}"
render "admin/university/#{export}/index"
}
format.xlsx { export }
end
......@@ -54,7 +39,6 @@ class Admin::Communication::Extranets::ContactsController < Admin::Communication
head :ok
end
protected
def load_object
......@@ -62,4 +46,21 @@ class Admin::Communication::Extranets::ContactsController < Admin::Communication
object_id = params[:objectId]
@object = object_type.constantize.find object_id
end
def export
# params[export] can be "people" or "organizations"
export = params['export']
case params['export']
when 'people'
@people = @extranet.connected_people.ordered
when 'organizations'
@organizations = @extranet.connected_organizations.ordered
else
raise ActionController::RoutingError.new('Not Found')
end
filename = "#{export}-#{Time.now.strftime("%Y%m%d%H%M%S")}.xlsx"
response.headers['Content-Disposition'] = "attachment; filename=#{filename}"
render "admin/university/#{export}/index"
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment