Class: Decidim::Exporters::FormPDF

Inherits:
PDF
  • Object
show all
Defined in:
lib/decidim/exporters/form_pdf.rb

Overview

Inherits from abstract PDF exporter. This class is used to set the parameters used to create a PDF when exporting Survey Answers.

Instance Method Summary collapse

Instance Method Details

#controllerObject

i18n-tasks-use t(‘decidim.admin.exports.formats.FormPDF’)



13
14
15
# File 'lib/decidim/exporters/form_pdf.rb', line 13

def controller
  @controller ||= FormPDFControllerHelper.new
end

#layoutObject



21
22
23
# File 'lib/decidim/exporters/form_pdf.rb', line 21

def layout
  "decidim/forms/admin/questionnaires/questionnaire_answers"
end

#localsObject



25
26
27
28
29
30
# File 'lib/decidim/exporters/form_pdf.rb', line 25

def locals
  {
    questionnaire: collection.first.first.questionnaire,
    collection: collection.map { |answer| Decidim::Forms::Admin::QuestionnaireParticipantPresenter.new(participant: answer.first) }
  }
end

#templateObject



17
18
19
# File 'lib/decidim/exporters/form_pdf.rb', line 17

def template
  "decidim/forms/admin/questionnaires/answers/export/pdf"
end