Sha256: 333619264109b46bf0888f91d468eaaaa3be98010cddf48e9506b664b7944492

Contents?: true

Size: 1.3 KB

Versions: 9

Compression:

Stored size: 1.3 KB

Contents

# frozen_string_literal: true

module Decidim
  module Votings
    module Admin
      # Controller that allows to (de)activate the content blocks from a voting landing page
      class VotingsLandingPageController < Decidim::Votings::Admin::ApplicationController
        include Decidim::Admin::LandingPage

        layout "decidim/admin/voting"

        helper_method :current_participatory_space

        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: scoped_resource
        end

        def resource_sort_url
          voting_landing_page_path(scoped_resource)
        end

        def active_content_blocks_title
          t("landing_page.edit.active_content_blocks", scope: "decidim.votings.admin")
        end

        def inactive_content_blocks_title
          t("landing_page.edit.inactive_content_blocks", scope: "decidim.votings.admin")
        end

        def resource_content_block_cell
          "decidim/votings/content_block"
        end

        alias current_participatory_space scoped_resource
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
decidim-elections-0.27.9 app/controllers/decidim/votings/admin/votings_landing_page_controller.rb
decidim-elections-0.27.8 app/controllers/decidim/votings/admin/votings_landing_page_controller.rb
decidim-elections-0.27.7 app/controllers/decidim/votings/admin/votings_landing_page_controller.rb
decidim-elections-0.27.6 app/controllers/decidim/votings/admin/votings_landing_page_controller.rb
decidim-elections-0.26.10 app/controllers/decidim/votings/admin/votings_landing_page_controller.rb
decidim-elections-0.26.9 app/controllers/decidim/votings/admin/votings_landing_page_controller.rb
decidim-elections-0.27.5 app/controllers/decidim/votings/admin/votings_landing_page_controller.rb
decidim-elections-0.26.8 app/controllers/decidim/votings/admin/votings_landing_page_controller.rb
decidim-elections-0.27.4 app/controllers/decidim/votings/admin/votings_landing_page_controller.rb