Sha256: 1e0c49a03da0c468e75f64d4a754f1a45902a14cb0f8e1e30d66d76a426012c0
Contents?: true
Size: 1.39 KB
Versions: 3
Compression:
Stored size: 1.39 KB
Contents
# frozen_string_literal: true require_dependency "decidim/application_controller" module Decidim # A controller that holds the logic to show ParticipatoryProcesses in a # public layout. class ParticipatoryProcessesController < ApplicationController layout "layouts/decidim/participatory_process", only: [:show] before_action -> { extend(NeedsParticipatoryProcess) }, only: [:show] helper Decidim::AttachmentsHelper helper Decidim::ParticipatoryProcessHelper helper Decidim::IconHelper helper Decidim::WidgetUrlsHelper helper_method :collection, :promoted_participatory_processes, :participatory_processes def index authorize! :read, ParticipatoryProcess authorize! :read, ParticipatoryProcessGroup end def show authorize! :read, current_participatory_process end private def collection @collection ||= (participatory_processes.to_a + participatory_process_groups).flatten end def participatory_processes @participatory_processes ||= OrganizationPrioritizedParticipatoryProcesses.new(current_organization) end def promoted_participatory_processes @promoted_processes ||= participatory_processes | PromotedParticipatoryProcesses.new end def participatory_process_groups @process_groups ||= Decidim::ParticipatoryProcessGroup.where(organization: current_organization) end end end
Version data entries
3 entries across 3 versions & 1 rubygems