Sha256: f2269ab059fb9885349ab78d6b73da22e35b0b1779dc5635d965f6263405b7ae

Contents?: true

Size: 1.54 KB

Versions: 37

Compression:

Stored size: 1.54 KB

Contents

# frozen_string_literal: true

module Decidim
  module ParticipatoryProcesses
    module Admin
      # Controller that allows to manage the content from the participatory process landing page content blocks
      class ParticipatoryProcessGroupLandingPageContentBlocksController < Decidim::ParticipatoryProcesses::Admin::ApplicationController
        include Decidim::Admin::LandingPageContentBlocks

        layout "decidim/admin/participatory_process_group"

        helper_method :participatory_process_group

        private

        def content_block_scope
          :participatory_process_group_homepage
        end

        def scoped_resource
          @scoped_resource ||= collection.find(params[:participatory_process_group_id])
        end

        def enforce_permission_to_update_resource
          enforce_permission_to :update, :process_group, process_group: scoped_resource
        end

        def edit_resource_landing_page_path
          edit_participatory_process_group_landing_page_path(scoped_resource)
        end

        def resource_landing_page_content_block_path
          participatory_process_group_landing_page_content_block_path(scoped_resource, params[:id])
        end

        def submit_button_text
          t("participatory_process_group_landing_page_content_blocks.edit.update", scope: "decidim.admin")
        end

        alias participatory_process_group scoped_resource

        def collection
          @collection ||= OrganizationParticipatoryProcessGroups.new(current_user.organization).query
        end
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
decidim-participatory_processes-0.27.9 app/controllers/decidim/participatory_processes/admin/participatory_process_group_landing_page_content_blocks_controller.rb
decidim-participatory_processes-0.27.8 app/controllers/decidim/participatory_processes/admin/participatory_process_group_landing_page_content_blocks_controller.rb
decidim-participatory_processes-0.27.7 app/controllers/decidim/participatory_processes/admin/participatory_process_group_landing_page_content_blocks_controller.rb
decidim-participatory_processes-0.27.6 app/controllers/decidim/participatory_processes/admin/participatory_process_group_landing_page_content_blocks_controller.rb
decidim-participatory_processes-0.26.10 app/controllers/decidim/participatory_processes/admin/participatory_process_group_landing_page_content_blocks_controller.rb
decidim-participatory_processes-0.26.9 app/controllers/decidim/participatory_processes/admin/participatory_process_group_landing_page_content_blocks_controller.rb
decidim-participatory_processes-0.27.5 app/controllers/decidim/participatory_processes/admin/participatory_process_group_landing_page_content_blocks_controller.rb
decidim-participatory_processes-0.26.8 app/controllers/decidim/participatory_processes/admin/participatory_process_group_landing_page_content_blocks_controller.rb
decidim-participatory_processes-0.27.4 app/controllers/decidim/participatory_processes/admin/participatory_process_group_landing_page_content_blocks_controller.rb
decidim-participatory_processes-0.27.3 app/controllers/decidim/participatory_processes/admin/participatory_process_group_landing_page_content_blocks_controller.rb
decidim-participatory_processes-0.26.7 app/controllers/decidim/participatory_processes/admin/participatory_process_group_landing_page_content_blocks_controller.rb
decidim-participatory_processes-0.26.5 app/controllers/decidim/participatory_processes/admin/participatory_process_group_landing_page_content_blocks_controller.rb
decidim-participatory_processes-0.27.2 app/controllers/decidim/participatory_processes/admin/participatory_process_group_landing_page_content_blocks_controller.rb
decidim-participatory_processes-0.27.1 app/controllers/decidim/participatory_processes/admin/participatory_process_group_landing_page_content_blocks_controller.rb
decidim-participatory_processes-0.26.4 app/controllers/decidim/participatory_processes/admin/participatory_process_group_landing_page_content_blocks_controller.rb
decidim-participatory_processes-0.27.0 app/controllers/decidim/participatory_processes/admin/participatory_process_group_landing_page_content_blocks_controller.rb
decidim-participatory_processes-0.26.3 app/controllers/decidim/participatory_processes/admin/participatory_process_group_landing_page_content_blocks_controller.rb
decidim-participatory_processes-0.27.0.rc2 app/controllers/decidim/participatory_processes/admin/participatory_process_group_landing_page_content_blocks_controller.rb
decidim-participatory_processes-0.27.0.rc1 app/controllers/decidim/participatory_processes/admin/participatory_process_group_landing_page_content_blocks_controller.rb
decidim-participatory_processes-0.26.2 app/controllers/decidim/participatory_processes/admin/participatory_process_group_landing_page_content_blocks_controller.rb