Class: Decidim::Exporters::FormPDF

Inherits:
PDF show all
Defined in:
decidim-forms/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

Methods inherited from PDF

#export, #orientation

Methods inherited from Exporter

#export, #initialize

Constructor Details

This class inherits a constructor from Decidim::Exporters::Exporter

Instance Method Details

#controllerObject

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



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

def controller
  @controller ||= FormPDFControllerHelper.new
end

#layoutObject



21
22
23
# File 'decidim-forms/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 'decidim-forms/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 'decidim-forms/lib/decidim/exporters/form_pdf.rb', line 17

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