Class: Decidim::DownloadYourDataController
- Inherits:
-
ApplicationController
- Object
- DecidimController
- ApplicationController
- Decidim::DownloadYourDataController
- Includes:
- Paginable, UserProfile
- Defined in:
- decidim-core/app/controllers/decidim/download_your_data_controller.rb
Overview
The controller to handle the user’s download_my_data page.
Constant Summary
Constants included from Paginable
Instance Method Summary collapse
- #download_file ⇒ Object
- #export ⇒ Object
-
#show ⇒ Object
i18n-tasks-use t(‘decidim.download_your_data.show.answers’) i18n-tasks-use t(‘decidim.download_your_data.show.assemblies’) i18n-tasks-use t(‘decidim.download_your_data.show.debate_comments’) i18n-tasks-use t(‘decidim.download_your_data.show.debates’) i18n-tasks-use t(‘decidim.download_your_data.show.initiatives’) i18n-tasks-use t(‘decidim.download_your_data.show.meeting_comments’) i18n-tasks-use t(‘decidim.download_your_data.show.meetings’) i18n-tasks-use t(‘decidim.download_your_data.show.participatory_processes’) i18n-tasks-use t(‘decidim.download_your_data.show.projects’) i18n-tasks-use t(‘decidim.download_your_data.show.proposal_comments’) i18n-tasks-use t(‘decidim.download_your_data.show.proposals’) i18n-tasks-use t(‘decidim.download_your_data.show.result_comments’) i18n-tasks-use t(‘decidim.download_your_data.show.results’) i18n-tasks-use t(‘decidim.download_your_data.show.survey_user_answers’).
Methods included from UserProfile
#available_verification_workflows
Methods included from UserGroups
Methods inherited from ApplicationController
Methods included from UserBlockedChecker
#check_user_block_status, #check_user_not_blocked
Methods included from NeedsSnippets
Methods included from Headers::HttpCachingDisabler
Methods included from HasStoredPath
#skip_store_location?, #store_current_location
Methods included from TranslatableAttributes
Methods included from RegistersPermissions
Methods included from NeedsOrganization
enhance_controller, extended, included
Instance Method Details
#download_file ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'decidim-core/app/controllers/decidim/download_your_data_controller.rb', line 41 def download_file (:download, :user, current_user:) if private_export.expired? flash[:error] = t("decidim.account.download_your_data_export.export_expired") redirect_to download_your_data_path elsif private_export.file.attached? redirect_to Rails.application.routes.url_helpers.rails_blob_url(private_export.file.blob, only_path: true) else flash[:error] = t("decidim.account.download_your_data_export.file_no_exists") redirect_to download_your_data_path end end |
#export ⇒ Object
32 33 34 35 36 37 38 39 |
# File 'decidim-core/app/controllers/decidim/download_your_data_controller.rb', line 32 def export (:export, :user, current_user:) DownloadYourDataExportJob.perform_later(current_user) flash[:notice] = t("decidim.account.download_your_data_export.notice") redirect_back(fallback_location: download_your_data_path) end |
#show ⇒ Object
i18n-tasks-use t(‘decidim.download_your_data.show.answers’) i18n-tasks-use t(‘decidim.download_your_data.show.assemblies’) i18n-tasks-use t(‘decidim.download_your_data.show.debate_comments’) i18n-tasks-use t(‘decidim.download_your_data.show.debates’) i18n-tasks-use t(‘decidim.download_your_data.show.initiatives’) i18n-tasks-use t(‘decidim.download_your_data.show.meeting_comments’) i18n-tasks-use t(‘decidim.download_your_data.show.meetings’) i18n-tasks-use t(‘decidim.download_your_data.show.participatory_processes’) i18n-tasks-use t(‘decidim.download_your_data.show.projects’) i18n-tasks-use t(‘decidim.download_your_data.show.proposal_comments’) i18n-tasks-use t(‘decidim.download_your_data.show.proposals’) i18n-tasks-use t(‘decidim.download_your_data.show.result_comments’) i18n-tasks-use t(‘decidim.download_your_data.show.results’) i18n-tasks-use t(‘decidim.download_your_data.show.survey_user_answers’)
25 26 27 28 29 30 |
# File 'decidim-core/app/controllers/decidim/download_your_data_controller.rb', line 25 def show (:show, :user, current_user:) @account = form(AccountForm).from_model(current_user) @exports = paginate(current_user.private_exports) end |