Sha256: 81665c0d7756d849249d077769c406cd56438433a6967b84088dac14d0e4c164

Contents?: true

Size: 1.16 KB

Versions: 7

Compression:

Stored size: 1.16 KB

Contents

# frozen_string_literal: true

module Decidim
  module Votings
    module Admin
      # Controller that allows to edit the content of the landing page content blocks
      class VotingsLandingPageContentBlocksController < Decidim::Votings::Admin::ApplicationController
        include Decidim::Admin::ContentBlocks::LandingPageContentBlocks

        layout "decidim/admin/voting"

        helper_method :current_participatory_space

        private

        def content_block_scope
          :voting_landing_page
        end

        def scoped_resource
          @scoped_resource ||= Voting.find_by(slug: params[:voting_slug], organization: current_organization)
        end

        def enforce_permission_to_update_resource
          enforce_permission_to :manage_landing_page, :voting, voting: current_participatory_space
        end

        def edit_resource_landing_page_path
          edit_voting_landing_page_path(scoped_resource)
        end

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

        alias current_participatory_space scoped_resource
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
decidim-elections-0.28.4 app/controllers/decidim/votings/admin/votings_landing_page_content_blocks_controller.rb
decidim-elections-0.28.3 app/controllers/decidim/votings/admin/votings_landing_page_content_blocks_controller.rb
decidim-elections-0.28.2 app/controllers/decidim/votings/admin/votings_landing_page_content_blocks_controller.rb
decidim-elections-0.28.1 app/controllers/decidim/votings/admin/votings_landing_page_content_blocks_controller.rb
decidim-elections-0.28.0 app/controllers/decidim/votings/admin/votings_landing_page_content_blocks_controller.rb
decidim-elections-0.28.0.rc5 app/controllers/decidim/votings/admin/votings_landing_page_content_blocks_controller.rb
decidim-elections-0.28.0.rc4 app/controllers/decidim/votings/admin/votings_landing_page_content_blocks_controller.rb