Sha256: d3d8bbb76528e10c1cb70734ff2534b8ea92b97c5181dd3892d414e230d2f900

Contents?: true

Size: 1.13 KB

Versions: 58

Compression:

Stored size: 1.13 KB

Contents

# frozen_string_literal: true

module Decidim
  module Conferences
    class ConferenceSpeakersController < Decidim::Conferences::ApplicationController
      include ParticipatorySpaceContext

      participatory_space_layout only: :index

      helper_method :collection, :conference

      def index
        raise ActionController::RoutingError, "No speakers for this conference " if speakers.empty?

        enforce_permission_to :list, :speakers
        redirect_to decidim_conferences.conference_path(current_participatory_space) unless current_user_can_visit_space?
      end

      private

      def speakers
        @speakers ||= current_participatory_space.speakers
      end

      alias collection speakers

      def current_participatory_space
        return unless params[:conference_slug]

        @current_participatory_space ||= OrganizationConferences.new(current_organization).query.where(slug: params[:conference_slug]).or(
          OrganizationConferences.new(current_organization).query.where(id: params[:conference_slug])
        ).first!
      end

      def conference
        current_participatory_space
      end
    end
  end
end

Version data entries

58 entries across 58 versions & 1 rubygems

Version Path
decidim-conferences-0.24.2 app/controllers/decidim/conferences/conference_speakers_controller.rb
decidim-conferences-0.23.5 app/controllers/decidim/conferences/conference_speakers_controller.rb
decidim-conferences-0.24.1 app/controllers/decidim/conferences/conference_speakers_controller.rb
decidim-conferences-0.24.0 app/controllers/decidim/conferences/conference_speakers_controller.rb
decidim-conferences-0.24.0.rc2 app/controllers/decidim/conferences/conference_speakers_controller.rb
decidim-conferences-0.23.4 app/controllers/decidim/conferences/conference_speakers_controller.rb
decidim-conferences-0.24.0.rc1 app/controllers/decidim/conferences/conference_speakers_controller.rb
decidim-conferences-0.23.3 app/controllers/decidim/conferences/conference_speakers_controller.rb
decidim-conferences-0.23.2 app/controllers/decidim/conferences/conference_speakers_controller.rb
decidim-conferences-0.23.1 app/controllers/decidim/conferences/conference_speakers_controller.rb
decidim-conferences-0.23.1.rc1 app/controllers/decidim/conferences/conference_speakers_controller.rb
decidim-conferences-0.23.0 app/controllers/decidim/conferences/conference_speakers_controller.rb
decidim-conferences-0.22.0 app/controllers/decidim/conferences/conference_speakers_controller.rb
decidim-conferences-0.21.0 app/controllers/decidim/conferences/conference_speakers_controller.rb
decidim-conferences-0.20.1 app/controllers/decidim/conferences/conference_speakers_controller.rb
decidim-conferences-0.20.0 app/controllers/decidim/conferences/conference_speakers_controller.rb
decidim-conferences-0.19.1 app/controllers/decidim/conferences/conference_speakers_controller.rb
decidim-conferences-0.19.0 app/controllers/decidim/conferences/conference_speakers_controller.rb