Sha256: f3bb7107a13e82235a72d3b0a5b3f0f15787c80bae87ee61ebe18f4a5e4d7ad8

Contents?: true

Size: 771 Bytes

Versions: 34

Compression:

Stored size: 771 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Admin
    # This controller allows admins to manage proposals in a participatory process.
    class ExportsController < Decidim::Admin::ApplicationController
      include Decidim::FeaturePathHelper

      def create
        authorize! :manage, feature
        name = params[:id]

        ExportJob.perform_later(current_user, feature, name, params[:format] || default_format)

        flash[:notice] = t("decidim.admin.exports.notice")

        redirect_back(fallback_location: manage_feature_path(feature))
      end

      private

      def default_format
        "json"
      end

      def feature
        @feature ||= current_participatory_space.features.find(params[:feature_id])
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 2 rubygems

Version Path
decidim-admin-0.10.1 app/controllers/decidim/admin/exports_controller.rb
decidim-admin-0.10.0 app/controllers/decidim/admin/exports_controller.rb
decidim-admin-0.9.3 app/controllers/decidim/admin/exports_controller.rb
decidim-admin-0.9.2 app/controllers/decidim/admin/exports_controller.rb
decidim-admin-0.9.1 app/controllers/decidim/admin/exports_controller.rb
decidim-admin-0.9.0 app/controllers/decidim/admin/exports_controller.rb
decidim-admin-0.8.4 app/controllers/decidim/admin/exports_controller.rb
decidim-admin-0.8.3 app/controllers/decidim/admin/exports_controller.rb
decidim-admin-0.8.2 app/controllers/decidim/admin/exports_controller.rb
decidim-admin-0.8.1 app/controllers/decidim/admin/exports_controller.rb
decidim-admin-0.8.0 app/controllers/decidim/admin/exports_controller.rb
decidim-admin-0.7.4 app/controllers/decidim/admin/exports_controller.rb
decidim-admin-0.7.3 app/controllers/decidim/admin/exports_controller.rb
decidim-admin-0.7.2 app/controllers/decidim/admin/exports_controller.rb
decidim-admin-0.7.1 app/controllers/decidim/admin/exports_controller.rb
decidim-admin-0.7.0 app/controllers/decidim/admin/exports_controller.rb
decidim-admin-0.6.8 app/controllers/decidim/admin/exports_controller.rb
decidim-0.6.8 decidim-admin/app/controllers/decidim/admin/exports_controller.rb
decidim-admin-0.6.7 app/controllers/decidim/admin/exports_controller.rb
decidim-0.6.7 decidim-admin/app/controllers/decidim/admin/exports_controller.rb