Sha256: 126110e7109e465431e968a323c0d6a7d28d542c24aef8f9c4b374dbbdd87217

Contents?: true

Size: 1.07 KB

Versions: 6

Compression:

Stored size: 1.07 KB

Contents

# frozen_string_literal: true
module ContentProviders
  # Provides forms for a Provider to plan Activities.
  class UnplannedActivityForm < BitCore::ContentProvider
    def render_current(options)
      options.view_context.render(
        template: "think_feel_do_engine/activities/unplanned_activity_form",
        locals: {
          activities: options.participant.activities.random.unplanned.first(4),
          update_path: options.view_context.participant_data_path,
          already_sched_activities: options
                                  .view_context
                                  .current_participant
                                  .activities
                                  .starts_in_the_future
                                  .order(start_time: :asc)
        }
      )
    end

    def data_attributes
      [
        :id, :start_time, :end_time, :activity_type_title,
        :predicted_pleasure_intensity, :predicted_accomplishment_intensity
      ]
    end

    def data_class_name
      "Activity"
    end

    def show_nav_link?
      false
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
think_feel_do_engine-3.22.9 app/models/content_providers/unplanned_activity_form.rb
think_feel_do_engine-3.22.8 app/models/content_providers/unplanned_activity_form.rb
think_feel_do_engine-3.22.7 app/models/content_providers/unplanned_activity_form.rb
think_feel_do_engine-3.22.6 app/models/content_providers/unplanned_activity_form.rb
think_feel_do_engine-3.22.5 app/models/content_providers/unplanned_activity_form.rb
think_feel_do_engine-3.22.4 app/models/content_providers/unplanned_activity_form.rb