2018-03-25 16:15:39 +00:00
|
|
|
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
2018-03-25 17:30:42 +00:00
|
|
|
module Campaigns
|
|
|
|
class DonationsController < ApplicationController
|
2018-08-08 21:31:42 +00:00
|
|
|
include Controllers::CampaignHelper
|
2018-03-25 17:30:42 +00:00
|
|
|
|
|
|
|
before_filter :authenticate_campaign_editor!, only: [:index]
|
|
|
|
|
|
|
|
def index
|
|
|
|
respond_to do |format|
|
|
|
|
format.csv do
|
|
|
|
file_date = Date.today.strftime("%m-%d-%Y")
|
|
|
|
donations = QueryDonations.campaign_export(current_campaign.id)
|
|
|
|
send_data(Format::Csv.from_vectors(donations), filename: "campaign-donations-#{file_date}.csv")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|