Sha256: 8054fa4f7cd12598377a8f54809468bcfbbedcfea2e5f937c1a31ba829abb7a7

Contents?: true

Size: 888 Bytes

Versions: 58

Compression:

Stored size: 888 Bytes

Contents

# frozen_string_literal: true

module Decidim
  # This controller serves static pages using HighVoltage.
  class PagesController < Decidim::ApplicationController
    layout "layouts/decidim/application"

    helper_method :page, :pages
    helper CtaButtonHelper
    helper Decidim::SanitizeHelper

    before_action :set_default_request_format

    def index
      enforce_permission_to :read, :public_page
      @topics = StaticPageTopic.where(organization: current_organization)
      @orphan_pages = StaticPage.where(topic: nil, organization: current_organization)
    end

    def show
      @page = current_organization.static_pages.find_by!(slug: params[:id])
      enforce_permission_to :read, :public_page, page: @page
      @topic = @page.topic
      @pages = @topic&.pages
    end

    private

    def set_default_request_format
      request.format = :html
    end
  end
end

Version data entries

58 entries across 58 versions & 1 rubygems

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