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