diff --git a/app/views/admin/registrations/index.csv.haml b/app/views/admin/registrations/index.csv.haml new file mode 100644 index 00000000..eace3122 --- /dev/null +++ b/app/views/admin/registrations/index.csv.haml @@ -0,0 +1,4 @@ +- headers = ['Name', 'Email'] += CSV.generate_line headers +- @registrations.each do |registration| + = CSV.generate_line([registration.name, registration.email]) \ No newline at end of file diff --git a/app/views/admin/registrations/index.html.haml b/app/views/admin/registrations/index.html.haml index 11ab9144..3e581914 100644 --- a/app/views/admin/registrations/index.html.haml +++ b/app/views/admin/registrations/index.html.haml @@ -6,6 +6,7 @@ = "(#{@registrations.length})" if @registrations .btn-group.pull-right - if can? :read, Registration + = link_to 'Export CSV', admin_conference_registrations_path(@conference.short_title, format: :csv), class: 'btn btn-success' = link_to 'Export PDF', admin_conference_registrations_path(@conference.short_title, format: :pdf), class: 'btn btn-success' = link_to 'Export XLS', {format: :xlsx}, class: 'btn btn-success' %p.text-muted