Sha256: 36da253d879c8376a53052b147401468fa1ef93e724b73b0ad96b6dbcb59cf8c

Contents?: true

Size: 1.13 KB

Versions: 13

Compression:

Stored size: 1.13 KB

Contents

# frozen_string_literal: true
require_dependency "think_feel_do_engine/application_controller"

module ThinkFeelDoEngine
  module Coach
    # Present Participant Activities Visualization to the Coach.
    class ParticipantActivitiesVisualizationsController < ApplicationController
      before_action :authenticate_user!
      rescue_from ActiveRecord::RecordNotFound, with: :record_not_found

      RenderOptions = Struct.new(
        :view_context, :app_context, :position, :participant
      )

      def show
        @participant = Participant.find(params[:participant_id])
        @group = @participant.groups.find(params[:group_id])
        provider = ContentProviders::YourActivitiesProvider.new
        options = RenderOptions.new(
          self,
          @participant.navigation_status,
          @participant.navigation_status.content_position,
          @participant
        )
        provider.render_current(options)
      end

      def record_not_found
        redirect_to main_app.root_path,
                    alert: "The activities visualization you were "\
                    "looking does not exist."
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
think_feel_do_engine-3.22.9 app/controllers/think_feel_do_engine/coach/participant_activities_visualizations_controller.rb
think_feel_do_engine-3.22.8 app/controllers/think_feel_do_engine/coach/participant_activities_visualizations_controller.rb
think_feel_do_engine-3.22.7 app/controllers/think_feel_do_engine/coach/participant_activities_visualizations_controller.rb
think_feel_do_engine-3.22.6 app/controllers/think_feel_do_engine/coach/participant_activities_visualizations_controller.rb
think_feel_do_engine-3.22.5 app/controllers/think_feel_do_engine/coach/participant_activities_visualizations_controller.rb
think_feel_do_engine-3.22.4 app/controllers/think_feel_do_engine/coach/participant_activities_visualizations_controller.rb
think_feel_do_engine-3.22.2 app/controllers/think_feel_do_engine/coach/participant_activities_visualizations_controller.rb
think_feel_do_engine-3.22.1 app/controllers/think_feel_do_engine/coach/participant_activities_visualizations_controller.rb
think_feel_do_engine-3.22.0 app/controllers/think_feel_do_engine/coach/participant_activities_visualizations_controller.rb
think_feel_do_engine-3.21.2 app/controllers/think_feel_do_engine/coach/participant_activities_visualizations_controller.rb
think_feel_do_engine-3.21.1 app/controllers/think_feel_do_engine/coach/participant_activities_visualizations_controller.rb
think_feel_do_engine-3.21.0 app/controllers/think_feel_do_engine/coach/participant_activities_visualizations_controller.rb
think_feel_do_engine-3.20.1 app/controllers/think_feel_do_engine/coach/participant_activities_visualizations_controller.rb