Sha256: dd92f2e31086e26ab6845af1a2108fe703885ffa09966490885a78230845992d

Contents?: true

Size: 1.02 KB

Versions: 18

Compression:

Stored size: 1.02 KB

Contents

# frozen_string_literal: true

module Decidim
  module Assemblies
    # A controller that holds the logic to show Assemblies in a
    # public layout.
    class AssembliesController < Decidim::ApplicationController
      layout "layouts/decidim/assembly", only: [:show]

      before_action -> { extend NeedsAssembly }, only: [:show]

      helper Decidim::AttachmentsHelper
      helper Decidim::IconHelper
      helper Decidim::WidgetUrlsHelper

      helper_method :collection, :promoted_assemblies, :assemblies, :stats

      def index
        authorize! :read, Assembly
      end

      def show
        authorize! :read, current_assembly
      end

      private

      def assemblies
        @assemblies ||= OrganizationPrioritizedAssemblies.new(current_organization)
      end

      alias collection assemblies

      def promoted_assemblies
        @promoted_assemblies ||= assemblies | PromotedAssemblies.new
      end

      def stats
        @stats ||= AssemblyStatsPresenter.new(assembly: current_assembly)
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
decidim-assemblies-0.6.8 app/controllers/decidim/assemblies/assemblies_controller.rb
decidim-0.6.8 decidim-assemblies/app/controllers/decidim/assemblies/assemblies_controller.rb
decidim-assemblies-0.6.7 app/controllers/decidim/assemblies/assemblies_controller.rb
decidim-0.6.7 decidim-assemblies/app/controllers/decidim/assemblies/assemblies_controller.rb
decidim-assemblies-0.6.6 app/controllers/decidim/assemblies/assemblies_controller.rb
decidim-0.6.6 decidim-assemblies/app/controllers/decidim/assemblies/assemblies_controller.rb
decidim-assemblies-0.6.5 app/controllers/decidim/assemblies/assemblies_controller.rb
decidim-0.6.5 decidim-assemblies/app/controllers/decidim/assemblies/assemblies_controller.rb
decidim-assemblies-0.6.4 app/controllers/decidim/assemblies/assemblies_controller.rb
decidim-0.6.4 decidim-assemblies/app/controllers/decidim/assemblies/assemblies_controller.rb
decidim-assemblies-0.6.3 app/controllers/decidim/assemblies/assemblies_controller.rb
decidim-0.6.3 decidim-assemblies/app/controllers/decidim/assemblies/assemblies_controller.rb
decidim-assemblies-0.6.2 app/controllers/decidim/assemblies/assemblies_controller.rb
decidim-0.6.2 decidim-assemblies/app/controllers/decidim/assemblies/assemblies_controller.rb
decidim-assemblies-0.6.1 app/controllers/decidim/assemblies/assemblies_controller.rb
decidim-0.6.1 decidim-assemblies/app/controllers/decidim/assemblies/assemblies_controller.rb
decidim-assemblies-0.6.0 app/controllers/decidim/assemblies/assemblies_controller.rb
decidim-0.6.0 decidim-assemblies/app/controllers/decidim/assemblies/assemblies_controller.rb